27.2.6.3 Bytevector and numeric parts lexicographic comparison
Bytevector/numbers comparison splits the bytevectors to compare into
their numeric and non–numeric parts and compares the parts one by one;
numeric parts are sequences of bytes which correspond to number digits
in ASCII encoding. For example, the string ‘foo4bar3zab10’ is
the bytevector:
#vu8(102 111 111 52 98 97 114 51 122 97 98 49 48)
and it is split into the following list:
(#vu8(102 111 111) 4
#vu8(98 97 114) 3
#vu8(122 97 98) 10)
in which non–numeric parts are retained as Scheme bytevectors and
numeric parts become exact integers; numeric parts only become
exact integer, never flonums. Bytevector parts are compared
with the ordinary lexicographic operators bytevector-u8<
and
bytevector=?
(or bytevector-u8-ci<
and
bytevector-u8-ci=
), while numeric parts are compared with the
ordinary <
and =
operators; a bytevector part and a
numeric part are compared by comparing the bytevectors.
- Function: bytevector-s8/numbers-compare bv1 bv2
- Function: bytevector-u8/numbers-compare bv1 bv2
- Function: %bytevector-s8/numbers-compare bv1 bv2
- Function: %bytevector-u8/numbers-compare bv1 bv2
Compare the bytevector and numeric parts of the arguments and return a
ternary result: ‘-1’ if bv1 is less than bv2, ‘0’
if bv1 is equal to bv2, ‘+1’ if bv1 is greater
than bv2. The comparison is case sensitive.
- Function: bytevector-s8/numbers=? bv1 bv2
- Function: bytevector-u8/numbers=? bv1 bv2
- Function: bytevector-s8/numbers<>? bv1 bv2
- Function: bytevector-u8/numbers<>? bv1 bv2
- Function: bytevector-s8/numbers<? bv1 bv2
- Function: bytevector-u8/numbers<? bv1 bv2
- Function: bytevector-s8/numbers<=? bv1 bv2
- Function: bytevector-u8/numbers<=? bv1 bv2
- Function: bytevector-s8/numbers>? bv1 bv2
- Function: bytevector-u8/numbers>? bv1 bv2
- Function: bytevector-s8/numbers>=? bv1 bv2
- Function: bytevector-u8/numbers>=? bv1 bv2
- Function: %bytevector-s8/numbers=? bv1 bv2
- Function: %bytevector-u8/numbers=? bv1 bv2
- Function: %bytevector-s8/numbers<>? bv1 bv2
- Function: %bytevector-u8/numbers<>? bv1 bv2
- Function: %bytevector-s8/numbers<? bv1 bv2
- Function: %bytevector-u8/numbers<? bv1 bv2
- Function: %bytevector-s8/numbers<=? bv1 bv2
- Function: %bytevector-u8/numbers<=? bv1 bv2
- Function: %bytevector-s8/numbers>? bv1 bv2
- Function: %bytevector-u8/numbers>? bv1 bv2
- Function: %bytevector-s8/numbers>=? bv1 bv2
- Function: %bytevector-u8/numbers>=? bv1 bv2
Return #t
or #f
, depending on whether the arguments comply
with the predicate.
- Function: bytevector-s8/numbers-compare-ci bv1 bv2
- Function: bytevector-u8/numbers-compare-ci bv1 bv2
- Function: %bytevector-s8/numbers-compare-ci bv1 bv2
- Function: %bytevector-u8/numbers-compare-ci bv1 bv2
Compare the string and numeric parts of the arguments and return a
ternary result: ‘-1’ if bv1 is less than bv2, ‘0’
if bv1 is equal to bv2, ‘+1’ if bv1 is greater
than bv2. The comparison is case insensitive.
- Function: bytevector-s8/numbers-ci=? bv1 bv2
- Function: bytevector-u8/numbers-ci=? bv1 bv2
- Function: bytevector-s8/numbers-ci<>? bv1 bv2
- Function: bytevector-u8/numbers-ci<>? bv1 bv2
- Function: bytevector-s8/numbers-ci<? bv1 bv2
- Function: bytevector-u8/numbers-ci<? bv1 bv2
- Function: bytevector-s8/numbers-ci>? bv1 bv2
- Function: bytevector-u8/numbers-ci>? bv1 bv2
- Function: bytevector-s8/numbers-ci<=? bv1 bv2
- Function: bytevector-u8/numbers-ci<=? bv1 bv2
- Function: bytevector-s8/numbers-ci>=? bv1 bv2
- Function: bytevector-u8/numbers-ci>=? bv1 bv2
- Function: %bytevector-s8/numbers-ci=? bv1 bv2
- Function: %bytevector-u8/numbers-ci=? bv1 bv2
- Function: %bytevector-s8/numbers-ci<>? bv1 bv2
- Function: %bytevector-u8/numbers-ci<>? bv1 bv2
- Function: %bytevector-s8/numbers-ci<? bv1 bv2
- Function: %bytevector-u8/numbers-ci<? bv1 bv2
- Function: %bytevector-s8/numbers-ci>? bv1 bv2
- Function: %bytevector-u8/numbers-ci>? bv1 bv2
- Function: %bytevector-s8/numbers-ci<=? bv1 bv2
- Function: %bytevector-u8/numbers-ci<=? bv1 bv2
- Function: %bytevector-s8/numbers-ci>=? bv1 bv2
- Function: %bytevector-u8/numbers-ci>=? bv1 bv2
Return #t
or #f
, depending on whether the arguments comply
with the predicate. The comparison is case insensitive.