Expand description
Structural operations on values: equality, hashing, ordering, formatting, and arbitrary-precision integer arithmetic.
Operations that may need user code (==, hash, <=>, to_s defined on a class) go through
the Interop trait, which the VM implements. Implementations never hold a borrow of an object’s
contents across such a call; they re-read by index instead.
Structs§
Statics§
Traits§
- Interop
- Calls back into the VM for operations defined in Catallaxy code.
Functions§
- compare
<=>-style comparison. Returns None if the values are not comparable.- compare_
or_ panic - Compares or panics with a clear message.
- dict_
lookup - Finds
keyin a dict or set, returning its entry index. - dict_
lookup_ hashed - float_
to_ int - Truncates a float toward zero into an Int (panics on NaN/infinity).
- format_
float - Formats a float the way Catallaxy prints it: always with a decimal point or exponent.
- format_
int - hash_
bytes - hash_
int - hash_
value - Hash consistent with
values_eq. - inspect
inspect: strings print quoted.- int_add
- int_
as_ i64 - The value as i64 if it is an Int that fits.
- int_
bitop - int_cmp
- int_div
- Floor division (rounds toward negative infinity).
- int_mod
- Floor modulo: the result has the sign of the divisor.
- int_mul
- int_neg
- int_pow
- int_sub
- int_
to_ f64 - is_int
- quote_
str - Writes
sas a quoted string literal. - sign_of
- to_
bigint - to_s
to_s: strings print raw, everything else asinspect.- values_
eq ==: structural for builtins, enums and tuples; user==for classes defining it; identity otherwise.Int == Floatcompares numerically.