[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eql => eq?
- To: HEDRICK at RUTGERS (Mngr DEC-20's/Dir LCSR Comp Facility)
- Subject: Re: eql => eq?
- From: Guy.Steele at CMU-10A
- Date: Fri, 29 Jan 1982 18:52:00 -0000
- Cc: common-lisp at SU-AI
- In-reply-to: HEDRICK@RUTGERS's message of 29 Jan 82 13:54-EST
(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