I'm new to Racket but even R5RS is rather clear about this issue: (citation from doc/r5rs/r5rs-std/r5rs-Z-H-9.html) > (eq? 2 2) ===> unspecified > > Rationale: It will usually be possible to implement eq? much more > efficiently than eqv?, for example, as a simple pointer comparison instead of > as some more complicated operation. One reason is that it may not be possible > to compute eqv? of two numbers in constant time, whereas eq? implemented as > pointer comparison will always finish in constant time. Eq? may be used like > eqv? in applications using procedures to implement objects with state since > it obeys the same constraints as eqv?.
You should use "=" with numbers as far as I remember. Il giorno 18/mag/2015, alle ore 02.41, George Neuner ha scritto: > Hi, > > On 5/17/2015 5:32 PM, Atticus wrote: >> --------------------------- >> $ 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. ... > > I can't reproduce this. Might there have been some control characters > accidentally in your input? > > I have 6.1.1 32-bit and 64-bit on Windows 7, and 64-bit on Centos 6.6 and > Ubuntu 14.04. Tried them all with and without JIT. Also tried the repl in > DrRacket on Windows (Linux are command line only). All worked as expected. > > George > > > -- > 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. > -- 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.