[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Atoms in association lists
- To: dml@NADC.ARPA
- Subject: Re: Atoms in association lists
- From: sidney%acorn@oak.lcs.mit.edu
- Date: Thu, 9 Jul 87 06:23 EDT
- Cc: common-lisp@sail.stanford.edu
- In-reply-to: <8707081900.AA11071@NADC.ARPA>
Actually, GCLisp handles atoms in alists by ignoring them,
whether they are strings, NIL, or other symbols. E.g.,
(SETQ abc '(c (c . 3) NIL (NIL . 4)))
(ASSOC 'c abc) --> (c . 3)
(ASSOC nil abc) --> (NIL . 4)
This is in accordance with CLtL, I believe.
David Loewenstern
--------
Since NIL is a list as well as an atom and (car NIL) => NIL
the correct result is
(assoc NIL '((c . 3) NIL (NIL . 4))) => NIL
The version of GCLisp I work with (2.4) evaluates it correctly. If an
earlier version does return (NIL . 4) then it is a bug. (I didn't try it
on any earlier versions.)
-- sidney markowitz <sidney%acorn@oak.mit.edu>
Gold Hill Computers