On Apr 28, 2009, at 4:59 PM, Joel VanderWerf wrote:

> Sebastian Hungerecker wrote:
>> Joel VanderWerf wrote:
>>> Oops. That never seemed right to me. Float#equal? should hide the  
>>> fact
>>> that floats are allocated, and not immediate.
>> Why would it? It doesn't do it for any other type of object. And if  
>> it would, what would be the difference to == ?
>
> Because it is only a quirk of cpu architecture that forces them to  
> be allocated rather than immediate. Maybe some future ruby  
> implementation (on >32 bit systems) will use immediate double- 
> precision floats. Other types will never be immediate.

A quick look at the IEEE format suggests that there are (2^51 - 1) bit  
patterns that are all considered NaN (not a number).

Seems like it might be possible to encode Ruby references in there.

Does anyone know of a language implementation that tags references in  
that way?


Gary Wright