NextPrevUpTopContentsIndex

make-hash-table

Function
Summary

Creates and returns a new hash table which, in addition to the standard functionality, can have a user-defined test, a user-defined hash function, and be a weak hash table.

Package

common-lisp

Signature

make-hash-table &key test size rehash-size rehash-threshold hash-function weak-kind => hash-table

Arguments

test

A designator for a function of two arguments, which returns t if they should be regarded as the same and nil otherwise.

hash-function

A designator for a function of one argument, which returns a hash value.

weak-kind

One of :value , t , :key , :both , :one , :either , nil . The default is nil .

Description

The standard definition of make-hash-table is extended such that test can be any suitable user-defined function. If test is not one of the standard test functions ( eq , eql , equal and equalp ), and if hash-function is not supplied, then the hash value is the same as would be used if test were equalp .

hash-function may be supplied only if test is not one of the standard test functions. It takes a hash key as its argument and returns a hash value to use for hashing.

If weak-kind is non- nil , it makes hash-table weak. Its semantics are the same as the second argument of set-hash-table-weak, that is:

(make-hash-table :weak-kind weak-kind <other-args> )

is equivalent to

(let ((ht (make-hash-table <other-args>
)))
  (set-hash-table-weak ht weak-kind
)
  ht)
See also

set-hash-table-weak


LispWorks Reference Manual - 23 Jul 2004

NextPrevUpTopContentsIndex