[plt-scheme] Procedure equality

From: Abdulaziz Ghuloum (aghuloum at gmail.com)
Date: Thu Apr 30 08:01:35 EDT 2009

On Apr 30, 2009, at 2:52 PM, Robby Findler wrote:

> I think that, in principle, compiler optimizations can get in the way
> of that working properly, but as far as I know, it will only make more
> things eq? not fewer (as compared to what you might think).

It can go both ways.

For example, the expression

   (let ([foo (lambda () 42)])
     (eq? foo foo))

might be transformed after copy propagation to

   (eq? (lambda () 42) (lambda () 42))

and this expression may evaluate to #f.

The same nonguarantee applies to numbers (afaik).  For example

   (let ([x 1.0]) (eq? x x))

may return #f.


Posted on the users mailing list.