chickadee » callable-data-structures » make-callable-hash-table

make-callable-hash-table #!rest argsprocedure

Return a callable hash table object. The initial value is an alist, and it is optional if no other keyword parameter is provided.

All the keyword parameters for make-hash-table are valid for make-callable-hash-table.

Examples:

#;1> (use callable-hash-tables)
#;2> (define hash-table (make-callable-hash-table))
#;3> hash-table
#<procedure callable-hash-table>
#;4> (hash-table)
#<hash-table (0)>
#;5> (set! (hash-table 'foo) 42)
#;6> (hash-table 'foo)
42
#;1> (use callable-hash-tables)
#;2> (define hash-table (make-callable-hash-table '((foo . 42) (bar . 0))))
#;3> (hash-table 'foo)
42
#;4> (hash-table 'bar)
0
#;1> (use callable-hash-tables)
#;2> (define hash-table (make-callable-hash-table '(("foo" . 42) ("bar" . 0)) test: equal?))
#;3> (hash-table "foo")
42
#;4> (hash-table "bar")
0