Equality of Recursive Structures [Was: Closure Compiler in 3.9 ?]

Klaus D. Witzel klaus.witzel at cobss.com
Fri May 11 18:51:43 UTC 2007


On Fri, 11 May 2007 20:40:57 +0200, Lukas Renggli wrote:

>> The queastion remains: why does the mere existence of such recursive
>> structures throw Squeak into a tizzy?
>> No one answered this.  What does the doIt mechanism do before it  
>> executes my
>> code?
>
> This is because the compiler internally stores the bindings of the
> Workspace in a dictionary with the binding-association as a key.
> Unfortunately the association are calculating the #hash using the key
> and the value, what causes an infinite recursion on your dictionary
> before you code is even compiled.

*after* the code was compiled *and* *executed* the first time ;-)

> The implementation of #hash in Association should not use the value to
> calculate the key, this is clearly a bug.

Yes, this slows down compiler's binding of variables, for example (Unicode  
generalCategory size) => 917632.

/Klaus

> Cheers,
> Lukas
>





More information about the Squeak-dev mailing list