Package: alexandria

Function alist-hash-table

Lambda List

alist-hash-table (alist &rest hash-table-initargs)

Arguments

alist -- an association list
hash-table-initargs -- the arguments for initializing a hash table

Return Value

a hash table

Details

Generates a hash table from an association list.

Returns a hash table containing the keys and values of the association list alist. The hash table is initialized using the arguments hash-table-initargs. See the Common Lisp function make-hash-table for the possible arguments.

Examples

(defvar alist '((Germany . Berlin) (Britain . London) (France . Paris)))
 => ALIST
(defvar table (alexandria::alist-hash-table alist))
 => TABLE
(gethash 'France table) => PARIS, T    
 

See also