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

Re: eql => eq?



(DEFUN FOO (X)
  (SETQ BIG-LIST (CONS X BIG-LIST))
  (SETQ SMALL-LIST (CONS X SMALL-LIST))
  (PRINT (EQ (CAR BIG-LIST) (CAR SMALL-LIST))))

(DEFUN BAR (Z) (FOO (*$ Z 2.0)))

Compile this using the MacLISP compiler.  Then (BAR 3.0) reliably
prints NIL, not T.  The reason is that the compiled code for FOO
gets, as its argument X, a pdl number passed to it by BAR.  The code
for FOO happens to choose to make two distinct heap copies of X,
rather than one, and so the cars of the two lists will contain
distinct pointers.
--Guy