Daniel Hartwig writes:
> On 18 February 2013 17:16, Ludovic Courtès wrote:
>> Quoth R5RS:
>>
>> `Eq?''s behavior on numbers and characters is
>> implementation-dependent, but it will always return either true or
>> false, and will return true only when `eqv?' would also return
>>
On 18 February 2013 17:16, Ludovic Courtès wrote:
> Daniel Hartwig skribis:
>
>> scheme@(guile-user)> (define x 1/2)
>> scheme@(guile-user)> (eq? x 2/4)
>> $7 = #f
>> scheme@(guile-user)> ,optimize (eq? x 2/4)
>> $8 = (eq? x 1/2)
>> scheme@(guile-user)> (define y 2/4)
>> scheme@(gui
l...@gnu.org (Ludovic Courtès) writes:
> However, it’s fundamentally wrong to rely on eq? to compare numbers. So
> the test case you mention seems buggy, to start with.
Agreed. I removed the buggy test.
Thanks,
Mark
On Mon 18 Feb 2013 10:16, l...@gnu.org (Ludovic Courtès) writes:
> Daniel Hartwig skribis:
>
>> scheme@(guile-user)> (define x 1/2)
>> scheme@(guile-user)> (eq? x 2/4)
>> $7 = #f
>> scheme@(guile-user)> ,optimize (eq? x 2/4)
>> $8 = (eq? x 1/2)
>> scheme@(guile-user)> (define y 2/4)
>
Daniel Hartwig skribis:
> scheme@(guile-user)> (define x 1/2)
> scheme@(guile-user)> (eq? x 2/4)
> $7 = #f
> scheme@(guile-user)> ,optimize (eq? x 2/4)
> $8 = (eq? x 1/2)
> scheme@(guile-user)> (define y 2/4)
> scheme@(guile-user)> (eq? x y)
> $9 = #f
> scheme@(guile-user)> ,opt
Version: 2.0.7
# stable-2.0, around commit: 3d2b267
# ./configure (no arguments)
hash.test has a failing case:
FAIL: tests/hash.test: hash-set and hash-ref:
;; 1/2 and 2/4 are equal? and eqv? but not eq?
(pass-if (equal? #f
(let ((table (make-hash-table)))