Il giorno 18/mag/2015, alle ore 22.25, Alexander D. Knauth ha scritto:

> 
> On May 18, 2015, at 1:19 AM, Michael Tiedtke <michael.tied...@o2online.de> 
> wrote:
> 
>> 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
> 
> In Racket, (eq? 2 2) is specified as true.
> 
> It says here:
> http://docs.racket-lang.org/reference/numbers.html
> 
>> A fixnum is an exact integer whose two’s complement representation fit into 
>> 31 bits on a 32-bit platform or 63 bits on a 64-bit platform; furthermore, 
>> no allocation is required when computing with fixnums. See also the 
>> racket/fixnum module, below.
>> 
>> Two fixnums that are = are also the same according to eq?. Otherwise, the 
>> result of eq?applied to two numbers is undefined, except that numbers 
>> produced by the default reader in read-syntax mode are interned and 
>> therefore eq? when they are eqv?.

But it's better not to rely on some arbitrary limit that denotes where bignums 
start. Because bignums (usually) are not eq?

(define n (expt 2 128))
(define m (expt 2 128))
(eq? n m)
#f
(eqv? n m)
#t


> 
> And about symbols, they should always be eq? if they are interned, which they 
> always are unless they are produced by a function like gensym or 
> string->uninterned-symbol.  The symbol=? predicate uses eq? to compare the 
> symbols.

On the one hand that's because they might be stored or better interned in a 
some directed graph like data structure. One the other hand semiotics does have 
some definition of abstract things that only reference or denote themselves. 
They might even be called symbols.
Don't know about uninterned symbols though.

-- 
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