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

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Sat Sep 5 18:39:32 UTC 2020


Hi Tobias,


> That said, 'super' needs a lexical scope,


Not sure about that either, because [Compiler evaluate: 'super yourself' for: Object new] gives me a MNU (MessageNotUnderstood: ProtoObject>>yourself). A do it block is nothing else than a normal method that is parsed with noPattern (with a default do it selector), isn't it?

But yes, of course:


> can you do the whole thing in a proper method?


ProtoObject compile: 'superCallingMethod  ^ super foo'.
ProtoObject new superCallingMethod.
Context runSimulated: [ProtoObject new superCallingMethod]

Same error pattern as described below.

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 18:59 Uhr
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] Two new questions about VM machinery :-)


> 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



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200905/e5d68afd/attachment-0001.html>


More information about the Squeak-dev mailing list