Previous: syslib closures, Up: syslib [Index]
The library (vicare system comparison-procedures)
defines
comparison procedures or the core object–types. When applied to two
values A and B of the same type, a comparison procedure
returns a fixnum:
If A is less than B.
If A is equal to B.
If A is greater than B.
The following syntactic binding are exported by the library
(vicare system comparison-procedures)
.
Build and return a comparison procedure using the equality predicate equal-to and the “less than” predicate less-than. The arguments of the comparison procedures are validated using the type predicate type-pred.
(define compar-fx (make-comparison-procedure fixnum? fx=? fx<?)) (compar-fx -1 +1) ⇒ -1 (compar-fx +1 +1) ⇒ 0 (compar-fx +1 -1) ⇒ +1
• syslib compar numerics: | Numeric comparison procedures. | |
• syslib compar textual: | Textual comparison procedures. | |
• syslib compar misc: | Miscellaneous comparison procedures. |