[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Atoms in association lists



   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