From: Brian M. <br...@ma...> - 2007-04-02 00:39:53
|
On 4/1/07 7:15 PM, "David" <rsu...@sn...> wrote: > Hi, > > I'm using SBCL 1.0.2 and think I found a bug in the reader. The > following code returns NIL. I believe it should return T. > > (let ((foo (cons #1=(cons nil nil) #1#))) > (eq (car foo) (cdr foo))) > > Can someone confirm this? The behavior that SBCL exhibits is correct. To prove this to yourself, eval a quoted version of the whole expression so you can see what it looks like after the reader is done with it: CL-USER(1): '(let ((foo (cons #1=(cons nil nil) #1#))) (eq (car foo) (cdr foo))) (LET ((FOO (CONS (CONS NIL NIL) (CONS NIL NIL)))) (EQ (CAR FOO) (CDR FOO))) It's irrelevant that the code shares structure; the objects it produces do not. -- Brian Mastenbrook br...@ma... http://brian.mastenbrook.net |