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


6.34.3 Additional hash functions

Function: bytevector-hash bv
Function: bytevector-hash bv max-len

Return a non–negative fixnum representing the hash value for bv, based on its current contents. When creating hash tables using bytevectors as keys: this hash function is suitable for use with bytevector=? as an equivalence function.

About the max-len argument:

NOTE When the hash value is computed using a number of bytes N less than the bytevector length: applications must not assume that two bytevectors having the first N bytes equal will have the same hash value.

Function: vector-hash vec
Function: vector-hash vec max-len

Return a non–negative fixnum representing the hash value for vec, based on its current contents. When creating hash tables using vectors as keys: this hash function is suitable for use with vector=? as an equivalence function.

About the max-len argument:

NOTE When the hash value is computed using a number of items N less than the vector length: applications must not assume that two vectors having the first N items equal will have the same hash value.

Function: list-hash ell
Function: list-hash ell max-len

Return a non–negative fixnum representing the hash value for ell, based on its current contents. When creating hash tables using lists as keys: this hash function is suitable for use with equal? as an equivalence function.

About the max-len argument:

NOTE When the hash value is computed using a number of items N less than the list length: applications must not assume that two lists having the first N items equal will have the same hash value.

Function: pair-hash pair
Function: ipair-hash ipair

Hash functions for pairs and immutable pairs.

Function: char-hash ch
Function: char-ci-hash ch

Hash function for characters. char-ci-hash first applies char-foldcase to ch.

Function: boolean-hash bool

Hash function for booleans.

Function: fixnum-hash fx

Hash function for fixnums.

Function: bignum-hash bn

Hash function for bignums.

Function: exact-integer-hash N

Hash function for exact integers, fixnums and bignums.

Function: flonum-hash fl

Hash function for flonums.

Function: ratnum-hash rn

Hash function for ratnums.

Function: cflonum-hash cfl

Hash function for cflonums.

Function: flonum-hash fl

Hash function for flonums.

Function: compnum-hash Z

Hash function for compnum objects.

Function: struct-hash stru

Hash function for Vicare structs. This is a very low quality hash function.

NOTE The result returned by this hash function depends on the values in the struct fields, so: it will change if the struct is mutated.

Function: record-hash reco

Hash function for R6RS records. This is a very low quality hash function. Notice that it does not use the custom hash function of reco (if any).

NOTE The result returned by this hash function depends on the values in the record fields, so: it will change if the record is mutated.

Function: enum-set-hash es

Hash function for enumeration sets.

Function: pointer-hash ptr

Return a fixnum representing the hash value of ptr.

Function: promise-hash prom

Hash function for promise objects.

Function: void-hash obj
Function: eof-object-hash obj
Function: would-block-hash obj
Function: sentinel-hash obj

Ignore obj and return a non–negative exact integer representing the hash value for (void), (eof-object), (would-block-object) and (sentinel).

Function: object-hash obj

Hash function for any Scheme object. For some object types: this is a very low quality hash function.

When obj is a record whose record–type defines a custom hash function: object-hash makes use of such custom function; otherwise record-hash is used.

Function: pointer-value obj

This is used by eq? hashtables to obtain a fixnum from references to objects that are meant to be compared with eq?.


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