WJ
unread,May 2, 2012, 5:37:51 AM5/2/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Peter Van Eynde wrote:
> On 25 Jun 1999 13:31:18 +0100 (BST), Mark Carroll wrote:
>
> >I can't find an easy way of obtaining a list of the keys of a hash
> >table in Common Lisp. Can anyone do better than,
>
> >(defun keys-of-hash-table (ht)
> > (let ((keys nil))
> > (labels ((getkey (x y) (push x keys)))
> > (maphash #'getkey ht)
> > keys)))
>
> (defun keys-of-hash-table (ht)
> (loop for key being the hash-keys in ht
> collect key))
Racket:
> (hash-keys (hash 'a 1 'b 2 'c 3))
'(c b a)