[plt-scheme] Procedure equality

From: Alex Shinn (alexshinn at gmail.com)
Date: Thu Apr 30 09:24:00 EDT 2009

Abdulaziz Ghuloum <aghuloum at gmail.com> writes:

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

Isn't the trick here to order the optimization passes so
that the (eq? x x) => #t rewrite always occurs before the
copy propagation pass? ;)

-- 
Alex


Posted on the users mailing list.