[plt-scheme] Procedure equality

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Apr 30 08:30:59 EDT 2009

On Apr 30, 2009, at 8:26 AM, Matthew Flatt wrote:

> At Thu, 30 Apr 2009 15:01:35 +0300, Abdulaziz Ghuloum wrote:
>> 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.
>
> This is correct for many dialects of Scheme, including standard
> dialects. But in PLT Scheme, `(let ([x <expr>]) (eq? x x))'  
> produces #t
> for any `<expr>'.

It is my distinct impression that Aziz's proposed inlining violates  
some report's notion of eq? i.e. some standard. Will would know.  
(Then again, I really don't care. Ptr equality on functions is iffy  
and when you program with it you get what the compiler gives you.)

-- Matthias




Posted on the users mailing list.