[Vm-dev] [Pharo-project] is there a way to avoid all the #tryNamedPrimitive:with: * in ProtoObject

stephane ducasse stephane.ducasse at gmail.com
Fri Jan 27 07:43:49 UTC 2012


> 
> do step-by-step evaluation.
> 
> I thinking that there should be special primitive which:
>  - takes a context, a receiver, a method and arguments (or just a
> context, if debugger ensures to pass it in prepared state i.e.
> receiver and args already on stack)
>  - invokes method's primitive
>  - answers a nil if primitive failed or a new context object, which
> holds an updated context state after primitive possibly manipulated
> with context(s)
> 
> No, not needed.  Manipulation of contexts does not require primitives since contexts are first-class, and the effect of these primitives can be simulated in Smalltalk (just as the effect of executing bytecodes can be simulated).  Look at the caller of tryPrimitive:withArgs: and tryNamedPrimitiveIn:for:withArgs:, namely ContextPart>doPrimitive:method:receiver:args:.  It handles all these primitives such as perform:[*], value[:value:*], withArgs:executeMethod:.

Eliot I think that you misunderstood what and why igor is saying that. He knows pretty well 
> doPrimitive:method:receiver:args:. I imagine that he will reply.

Stef


More information about the Vm-dev mailing list