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


6.19.8 Custom record hash functions

A record–type’s hash function is a function accepting as single argument an instance of the record–type; the return value is a non–negative fixnum representing the hash value of the record.

When a record–type does not have a custom hash function: we can always use the core primitive record-hash, record-hash.

Function: record-type-hash-function-set! rtd hash-func

Select the procedure hash-func as hash function for records of type rtd; if hash-func is #f, instances of type rtd make use of the built–in Scheme objects hash function.

Function: record-type-hash-function rtd

Return the function set as custom hash function for records of type rtd; return #f if rtd has no custom hash function.

Function: record-hash-function record

Return #f or the function being the custom record hash function for the record record.