[squeak-dev] Fwd: [Pharo-project] type-inference: it works!

Eliot Miranda eliot.miranda at gmail.com
Thu Apr 5 17:10:02 UTC 2012


On Wed, Apr 4, 2012 at 4:59 AM, Levente Uzonyi <leves at elte.hu> wrote:

> On Wed, 4 Apr 2012, Frank Shearar wrote:
>
>  I ported Francisco Garau's TypeInference engine to Squeak (well,
>> changed the one thing I needed to make it run on Squeak), and Marcus
>> noted the following:
>>
>> Marcus Denker <marcus.denker at inria.fr> says:
>>
>>
>>>> It turns out that in Pharo we use Association and in Squeak we use
>>>> ReadOnlyVariableBinding; by changing VariableNode >> #isSharedVarNode
>>>>
>>>
>>  You should think about cleaning that up... in the SystemDictonary, old
>>> classes
>>> are ReadOnlyVariableBinding, new ones are Associations. The code to make
>>> a binding into a ReadOnlyVariableBinding is never called...
>>>
>>
>> Given that I know next to nothing about this part of Squeak, I offer
>> it up to those more knowledgeable than I for assessment!
>>
>
> Markus is right, the code is not called, but I'm not sure it shouldn't be
> called. Just try the following in a throw-away image:
>
> Object subclass: #Foo
>        instanceVariableNames: ''
>        classVariableNames: ''
>        poolDictionaries: ''
>        category: 'Foo'.
> Foo := 1.
>
> The value of Foo will be 1 and your browser will go nuts when you try to
> browse the Foo category.
>

Right.  ReadOnlyVariableBinding is a *good* idea!  (with
ReadOnlyVariableBinding
evaluating Foo := 1 will raise an error).


>
>
> Levente
>
>
>> frank
>>
>>
>>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20120405/c631140f/attachment.htm


More information about the Squeak-dev mailing list