Re: Pharo - Squeak VM bug?

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

Re: Pharo - Squeak VM bug?

Stéphane Ducasse

On Oct 6, 2009, at 10:03 AM, Petr Vácha wrote:

> Hi there,
> sorry for contacting you directly, there are reasons why I do not have
> a Google account. Sorry for that.

but you do not have too.
the mail-ling is free access.

> I believe I found cool bug (probably in Squeak VM, also affects  
> Exupery
> VM), but also other Smalltalks are affected, incl. Smalltalk/X, Cuis
> and Squeak itself .. not checked with Visual Works though.
>
> Just try to inspect "a:=Array new: SmallInteger maxVal." and see what
> is value of "a" variable - interestingly, primitive (in Squeak VM,  
> primitive
> 71) DOES NOT fail on too big arguments (however, it fails on negative
> arguments). What is interesting is that Smalltalk/X crashes, while  
> Cuis,
> Pharo a Squeak actually assign "a" a value - check yourself what is
> assigned (depends on Smalltalk variant). No Smalltalk variant I  
> checked
> fails a primitive.
>
> Maybe it is on purpose, but I believe this situation shall be somehow
> signalled to developer as "Array>>new:" method did not provide what
> is expected (returns junk).
>
> In case of a miscall, sorry for your time.
>
> Greets,
> Petr Vacha
>
>
>
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Hierarchy browsers & implementers of

Stéphane Ducasse
I suggest you to read the chapter on the Smalltalk model in the Squeak  
or pharo by example book
the key is:

        when you look for a message you look in the CLASS of the receiver  
then its superclasses.

So when you look for new sent to Array you should look in the Array  
class superclasses and you will see it contains
Behavior before ProtoObject

Stef

PS: you can sent to the mailing-list just register to it. You do not  
need to have a google account.

On Oct 7, 2009, at 1:00 PM, Petr Vácha wrote:

> Hi again,
> when try to find out that Array>>new: bug I found one thing that I  
> think
> may be very confusing - somehow mangled information from hierarchy  
> browsers
> (see figure).
>
> Array>>new: calls primitive and uses self>>basicNew: call as fallback.
> Array does not implement basicNew: so I tried to find implementors of
> it. Behavior has this implementation. However, when you show hierarchy
> of Array, it ends in ProtoObject with no Behavior involved. I think
> this to be is somewhat confusing for beginners especially when they
> are trying to get into method lookup chain.
>
> Petr Vacha
>
>
> <pharo-browsers.jpg>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Hierarchy browsers & implementers of

Petr Vácha
I know Smalltalk hierarchy, I just wanted to point out, that Hierarchy
Browser does not provide (maybe I am dumb, but I do not see any) obvious
way to show the hierarchy to see that Array class inherits from Behavior.

PV.

----- PŮVODNÍ ZPRÁVA -----
Od: "Stéphane Ducasse" <[hidden email]>
Komu: "Petr Vácha" <[hidden email]>
Předmět: Re: Hierarchy browsers & implementers of
Datum: 7.10.2009 - 21:22:42

> I suggest you to read the chapter on the Smalltalk
> model in the Squeak
> or pharo by example book
> the key is:
>
> when you look for a message you look in the CLASS of
> the receiver
> then its superclasses.
>
> So when you look for new sent to Array you should look
> in the Array
> class superclasses and you will see it contains
> Behavior before ProtoObject
>
> Stef
>
> PS: you can sent to the mailing-list just register
> to it. You do not
> need to have a google account.
>
> On Oct 7, 2009, at 1:00 PM, Petr Vácha wrote:
>
> > Hi again,
> > when try to find out that Array>>new: bug I found
> > one thing that I
> > > think
> > may be very confusing - somehow mangled information
> > from hierarchy
> > > browsers
> > (see figure).
> >
> > Array>>new: calls primitive and uses self>>basicNew:
> > call as fallback.
> > > Array does not implement basicNew: so I tried to
> > find implementors of
> > > it. Behavior has this implementation. However, when
> > you show hierarchy
> > > of Array, it ends in ProtoObject with no Behavior
> > involved. I think
> > > this to be is somewhat confusing for beginners especially
> > when they
> > > are trying to get into method lookup chain.
> >
> > Petr Vacha
> >
> >
> > <pharo-browsers.jpg>
>



_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Hierarchy browsers & implementers of

Alexandre Bergel
Hi!

you're very right, the browser does not show this. Open a browser,  
look for the class ProtoObject. You can see that the superclass of  
ProtoObject is nil, but if you select the 'class' tab, you just see  
the declaration of instance variable names for the meta-class.
This does not show you the superclass of the meta-class. In practice,  
this is not something that you need to know. Well, maybe for #new and  
#new:

You need to open a workspace and type 'ProtoObject class superclass'  
to discover that it is Class.

Cheers,
Alexandre


On 7 Oct 2009, at 16:32, Petr Vácha wrote:

> I know Smalltalk hierarchy, I just wanted to point out, that Hierarchy
> Browser does not provide (maybe I am dumb, but I do not see any)  
> obvious
> way to show the hierarchy to see that Array class inherits from  
> Behavior.
>
> PV.
>
> ----- PŮVODNÍ ZPRÁVA -----
> Od: "Stéphane Ducasse" <[hidden email]>
> Komu: "Petr Vácha" <[hidden email]>
> Předmět: Re: Hierarchy browsers & implementers of
> Datum: 7.10.2009 - 21:22:42
>
>> I suggest you to read the chapter on the Smalltalk
>> model in the Squeak
>> or pharo by example book
>> the key is:
>>
>> when you look for a message you look in the CLASS of
>> the receiver
>> then its superclasses.
>>
>> So when you look for new sent to Array you should look
>> in the Array
>> class superclasses and you will see it contains
>> Behavior before ProtoObject
>>
>> Stef
>>
>> PS: you can sent to the mailing-list just register
>> to it. You do not
>> need to have a google account.
>>
>> On Oct 7, 2009, at 1:00 PM, Petr Vácha wrote:
>>
>>> Hi again,
>>> when try to find out that Array>>new: bug I found
>>> one thing that I
>>>> think
>>> may be very confusing - somehow mangled information
>>> from hierarchy
>>>> browsers
>>> (see figure).
>>>
>>> Array>>new: calls primitive and uses self>>basicNew:
>>> call as fallback.
>>>> Array does not implement basicNew: so I tried to
>>> find implementors of
>>>> it. Behavior has this implementation. However, when
>>> you show hierarchy
>>>> of Array, it ends in ProtoObject with no Behavior
>>> involved. I think
>>>> this to be is somewhat confusing for beginners especially
>>> when they
>>>> are trying to get into method lookup chain.
>>>
>>> Petr Vacha
>>>
>>>
>>> <pharo-browsers.jpg>
>>
>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Hierarchy browsers & implementers of

Stéphane Ducasse
In reply to this post by Petr Vácha
Ahh ok that!
The problem is that imagine that you would see superclasses of  
ProtoObject class
then how would you relate let's say Behavior when you click back on  
the instance button.

I think that the instance class button is somehow misleading. and may  
be it would be better to have

Object class
        Collection class
                ....
instead of
        Object
                Collection

and class button pressed

Stef

On Oct 7, 2009, at 10:32 PM, Petr Vácha wrote:

> I know Smalltalk hierarchy, I just wanted to point out, that Hierarchy
> Browser does not provide (maybe I am dumb, but I do not see any)  
> obvious
> way to show the hierarchy to see that Array class inherits from  
> Behavior.
>
> PV.
>
> ----- PŮVODNÍ ZPRÁVA -----
> Od: "Stéphane Ducasse" <[hidden email]>
> Komu: "Petr Vácha" <[hidden email]>
> Předmět: Re: Hierarchy browsers & implementers of
> Datum: 7.10.2009 - 21:22:42
>
>> I suggest you to read the chapter on the Smalltalk
>> model in the Squeak
>> or pharo by example book
>> the key is:
>>
>> when you look for a message you look in the CLASS of
>> the receiver
>> then its superclasses.
>>
>> So when you look for new sent to Array you should look
>> in the Array
>> class superclasses and you will see it contains
>> Behavior before ProtoObject
>>
>> Stef
>>
>> PS: you can sent to the mailing-list just register
>> to it. You do not
>> need to have a google account.
>>
>> On Oct 7, 2009, at 1:00 PM, Petr Vácha wrote:
>>
>>> Hi again,
>>> when try to find out that Array>>new: bug I found
>>> one thing that I
>>>> think
>>> may be very confusing - somehow mangled information
>>> from hierarchy
>>>> browsers
>>> (see figure).
>>>
>>> Array>>new: calls primitive and uses self>>basicNew:
>>> call as fallback.
>>>> Array does not implement basicNew: so I tried to
>>> find implementors of
>>>> it. Behavior has this implementation. However, when
>>> you show hierarchy
>>>> of Array, it ends in ProtoObject with no Behavior
>>> involved. I think
>>>> this to be is somewhat confusing for beginners especially
>>> when they
>>>> are trying to get into method lookup chain.
>>>
>>> Petr Vacha
>>>
>>>
>>> <pharo-browsers.jpg>
>>
>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project