tiny.preserves.valueCompare
Defined in tiny.preserves.
Returns the order of a against b, the same answer as a.compare(b).
Source
Source: lib/preserves/src/any.zig:91
zig
/// Returns the order of `a` against `b`, the same answer as `a.compare(b)`. Code that sorts values/// passes this as the comparison, for the package's one total order. Values of different kinds/// order by kind: booleans, doubles, integers, strings, byte strings, symbols, records, sequences,/// sets, dictionaries, embedded values, then the four pattern forms. Doubles order by a total order/// over their bits, so every double, `NaN` included, has one place. Sets and dictionaries compare/// their elements in ascending order under `compare`, whatever their storage order. The call/// allocates nothing. Its cost on two sets grows with the square of their size.pub fn valueCompare(a: AnyValue, b: AnyValue) std.math.Order { return a.compare(b);}Source: lib/preserves/src/root.zig:184
zig
pub const valueCompare = any.valueCompare;Audit
| Definitions | 1 |
|---|---|
| Public names | 1 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |