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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Frank Shearar-3
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 <[hidden email]> 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!

frank

Reply | Threaded
Open this post in threaded view
|

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

Levente Uzonyi-2
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 <[hidden email]> 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.


Levente

>
> frank
>
>

Reply | Threaded
Open this post in threaded view
|

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

Eliot Miranda-2


On Wed, Apr 4, 2012 at 4:59 AM, Levente Uzonyi <[hidden email]> 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 <[hidden email]> 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