[squeak-dev] Two new questions about VM machinery :-)

Tobias Pape Das.Linux at gmx.de
Sat Sep 5 16:59:06 UTC 2020


> On 05.09.2020, at 13:34, Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:
> 
> Hi Tobias,
> 
> are you sure about that?
> [Compiler evaluate: 'self identityHash' for: ProtoObject new] answers a me a SmallInteger. Compiler >> #evaluate:[...] returns the last stack value automatically, just a like a printIt. See senders of #returnSelfIfNoOther: in Parser. :-)

Ah, I thought it be just a method, I misread that.
That said, 'super' needs a lexical scope, can you do the whole thing in a proper method?
-t

> 
> Best,
> Christoph
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Tobias Pape <Das.Linux at gmx.de>
> Gesendet: Samstag, 5. September 2020 13:25:26
> An: The general-purpose Squeak developers list
> Betreff: Re: [squeak-dev] Two new questions about VM machinery :-)
>  
> 
> > On 05.09.2020, at 13:10, Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:
> > 
> > What would you expect the following to return?
> > x := Compiler evaluate: 'super identityHash' for: ProtoObject new.
> > thisContext objectClass: x.
> > I would have guessed that either the VM crashes or ProtoObject >> #cannotInterpret: is called.
> > But actually, it answers you the ProtoObject instance, which I find very interesting because it means that if a message cannot be looked up, it is simply and silently skipped.
> 
> No. you're just missing the return, that's why it answers self…
> -t




More information about the Squeak-dev mailing list