Package: alexandria

Function maphash-keys

Lambda List

maphash-keys (function table)

Arguments

function -- a designator for a function of one argument, the key.
table -- a hash table

Details

Iterates over all keys in a hash table.

Like the Common Lisp function maphash, but calls function with each key in the hash table table.

Examples

(defvar table (make-hash-table)) => TABLE
(setf (gethash 'Germany table) 'Berlin) => BERLIN
(setf (gethash 'France table) 'Paris) => PARIS
(setf (gethash 'Britain table) 'London) => LONDON
(maphash-keys #'print table)
 >> GERMANY BRITAIN FRANCE
 => NIL    
 

See also