>>> 
>> 
>> 
>> Interesting, I would never have guessed the test would be broken at first 
>> sight. So maybe some people enlightened in the ways of the compiler can 
>> provide a better explanation than me. Here is my guess:
>> 
>> #(1) is a special construct which creates a compile-time array. The 
>> compile-time makes the trick: in short the array is more or less encoded 
>> directly into the bytecodes of the method as a constant.
>> But modifying the array with #at:put: directly modifies the bytecodes in the 
>> compiled method itself. So you create a side-effect directly into your 
>> method.
>> 
>> Am I the only one to find this a bit dangerous and not intuitive? Is it a 
>> well-known behavior?
> 
> I would never have guessed that in a million years.
welcome to the time traveling machine

it is a bit ugly and nobody should rely on such bad behavior.
Consider that it should not exist.

Stef

Reply via email to