Package: alexandria

Function plist-hash-table

Lambda List

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

Arguments

plist -- a property list
hash-table-initargs -- the arguments for initializing a hash table

Return Value

a hash table

Details

Generates a hash table from a property list.

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

Examples

(setf (get 'symbol 'Germany) 'Berlin) => BERLIN
(setf (get 'symbol 'France) 'Paris) => PARIS
(setf (get 'symbol 'Britain) 'London) => LONDON
(defvar table (alexandria:plist-hash-table (symbol-plist 'symbol)))
 => TABLE
(gethash 'Germany table) => BERLIN, T    
 

See also