Next: , Previous: , Up: iklib records defs   [Index]


6.19.1.7 The custom comparison procedure

In a use of the syntax define-record-type, the definition clause:

(comparison-procedure ?expr)

allows the specification of an expression ?expr which must evaluate to a custom comparison procedure protocol for instances of the record–type; iklib records comparison, for details on record’s comparison procedures.

If the record–type has a parent: the protocol function is applied to the comparison procedure of the parent (or #f if the parent has no comparison procedure) and the resulting value must be a function, which becomes the comparison procedure of the record–type.

If the record–type has no parent: the protocol function is called as a thunk and the resulting value must be a function, which becomes the comparison procedure of the record–type.