Next: , Previous: , Up: SRFI-207 String-notated bytevectors   [Contents][Index]


7.5.49.6 Comparison

To compare bytevectors for equality, use the bytevector=? procedure from (rnrs bytevectors) (see Bytevectors) or equal?.

Scheme Procedure: bytestring<? bytevector1 bytevector2
Scheme Procedure: bytestring>? bytevector1 bytevector2
Scheme Procedure: bytestring<=? bytevector1 bytevector2
Scheme Procedure: bytestring>=? bytevector1 bytevector2

Returns #t if bytevector1 is less than / greater than / less than or equal to / greater than or equal to bytevector2. Comparisons are lexicographical: shorter bytevectors compare before longer ones, all elements being equal.

(bytestring<? #u8"Heart Of Gold" #u8"Heart of Gold")#t
(bytestring<=? #u8(#x81 #x95) #u8(#x80 #xa0))#f
(bytestring>? #u8(1 2 3) #u8(1 2))#t