- make-enum-comparator enum-typeprocedure
Returns a SRFI 128 comparator suitable for comparing enums that belong to enum-type. The comparator contains both an ordering predicate and a hash function, and orders enums based on their ordinal values.
(define pizza-comparator (make-enum-comparator pizza)) (comparator-hashable? pizza-comparator) ⇒ #t (comparator-test-type pizza-comparator pizza-funghi) ⇒ #t (<? pizza-comparator pizza-margherita pizza-chicago) ⇒ #t