[racket] Getting a list of keys in specified order

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Wed Jul 11 17:49:03 EDT 2012

Kieron Hardy wrote at 07/11/2012 05:22 PM:
> I need to get the list of all the keys, of a small collection of key/value pairs, in creation/insertion order.
>    

Sounds like you almost certainly want an association list (aka alist).

Alists are low-level and lightweight, and once you get some familiarity 
with using them, they're often an elegant fit for recursive algorithms.

Alist lookup operations like "assq" are O(n), but in practice are 
sufficiently fast for most any purpose.

Neil V.


Posted on the users mailing list.