chickadee » srfi-128 » comparator-register-default!

comparator-register-default! comparatorprocedure

Registers comparator for use by default comparators, such that if the objects being compared both satisfy the type test predicate of comparator, it will be employed by default comparators to compare them. Returns an unspecified value. It is an error if any value satisfies both the type test predicate of comparator and any of the following type test predicates: boolean?, char?, null?, pair?, symbol?, bytevector?, number?, string?, vector?, or the type test predicate of a comparator that has already been registered.

This procedure is intended only to extend default comparators into territory that would otherwise be undefined, not to override their existing behavior. In general, the ordering of calls to comparator-register-default! should be irrelevant. However, implementations that support inheritance of record types may wish to ensure that default comparators always check subtypes before supertypes.