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

Re: Atoms in association lists



    Date: Thu, 9 Jul 87 06:23 EDT
    From: sidney%acorn@oak.lcs.mit.edu


       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

But NIL is not a cons.  See page 281 of CLtL.

 as well as an atom and (car NIL) => NIL
    the correct result is
       (assoc NIL '((c . 3) NIL (NIL . 4))) => NIL

(NIL . 4) should be returned, as someone stated earlier.

    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