[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in documentation for eq? ?

From: Andy Wingo
Subject: Re: Bug in documentation for eq? ?
Date: Wed, 20 Jun 2012 12:58:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

On Wed 20 Jun 2012 12:40, David Kastrup <address@hidden> writes:

>      Numbers and characters are not equal to any other object, but the
>      problem is they're not necessarily `eq?' to themselves either.
>      This is even so when the number comes directly from a variable,
>           (let ((n (+ 2 3)))
>             (eq? n n))       => *unspecified*

Note that this example is taken from R5RS section 6.1.

> A variable reference can't really be anything except eq? to itself in
> my opinion.

Depends on inlining.  Numbers are not considered to have identity, so
they may be copied in some situations.  Therefore that expression is
equivalent to

  (eq? (+ 2 3) (+ 2 3))

which is unspecified.

In summary, I think the documentation is correct.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]