Hello everyone,

So i am trying to learn scheme in my free time (unfortunately my
university doesn't use scheme in their undergraduate courses) and i was
comparing the equality operators in gambit and racket and encountered a
strange behaviour with the eq? operator in racket. To my surprise
comparing the "same" symbol with eq? returns sometimes a different value
in the repl. I expected the return value #t. 

This is the behaviour:

---------------------------
$ racket
Welcome to Racket v6.1.1.
> (eq? 'l 'l)
#f
> (eq? 'l 'l)
#t
> 

$ racket --no-jit
Welcome to Racket v6.1.1.
> (eq? 'l 'l)
#f
> (eq? 'l 'l)
#t
> (eq? 'l 'l)
#f
> (eq? 'l 'l)
#t
> (eq? 'l 'l)
#t
> (eq? 'l 'l)
#t
> (eq? 'l 'l)
#f
> (eq? 'l 'l)
#f
> 

---------------------------

How to reproduce this behaviour? Just start racket from the command line
and type '(eq? 'l 'l), this should return #f (or sometimes #t). The next
time the same expression returns #t. Whats also interesting is that with
the command line option --no-jit the return value seems to randomly
change between #t and #f.

This seems to happen only when you type the expression into the repl.

Can someone explain why the eq? operator behaves like this in the racket
repl? The eq? operator shows the expected behavior in gambit but not in
racket. Do i miss something?


Btw a big thank you to the racket team for developing, maintaining and
improving racket. Racket is awesome.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to