Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

.Re: keys of hash table

5 views
Skip to first unread message

Robert L.

unread,
Jan 20, 2017, 10:17:24 PM1/20/17
to
> >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))

Ruby:

{foo: 2, bar: 3, zoo: 4}.keys
==>[:foo, :bar, :zoo]

In Forth?


--
General Mills ... aired a television commercial for ... Cheerios ... promoting
Aryan hybridization with blacks (depicting, as usual, a white woman and a black
man). ... The ad agency responsible for the campaign was ... [Jewish] Saatchi &
Saatchi.... www.counter-currents.com/2013/08/behind-anti-white-advertising
0 new messages