[plt-scheme] Convention for alists?

From: ian barland (inland arab) (ian at cs.rice.edu)
Date: Sun Apr 3 10:22:30 EDT 2005

Hi Richard -- 

> Is there a commonly-accepted convention for the shape of an association
> list?  I've seen both
Just as an anecdotal data point -- I tend to use the non-dotted version,
for no good reason I can think of.

> it's just a question of how one extracts the values.
I'd be unsurprised if many people do the same I do:
a homebrew version of assoc goes ahead and extracts the associated 
value; to handle the handle the not-found-sentinel problem
it accepts an optional argument (the sentinel value).

> (Here's the context: my environment library, in PLaneT/300, exports an
> env->alist function that returns a list of the second form above.
> Should I change it to the first?)
Probably -- I'd expect a library to return the dotted version,
even if I don't write my own that way.  [Is that a recipe for
disaster, or what ?-]


Posted on the users mailing list.