[squeak-dev] Accessing temp variables bindings in a BlockClosure

Eliot Miranda eliot.miranda at gmail.com
Mon Apr 20 04:48:04 UTC 2020


Hi Stef,

    take a look at ContextInspector and DebuggerMethodMap.  The clue is that the debugger correctly displays the names of block temporaries and values in the hi text inspector in the bottom left of a debugger. 

The interface is not easy because of the indirect temp vector implementation of modified closed over temporaries.  I apologize for the complexity and inconvenience but it is key to achieving high performance context-to-stack mapping, which itself is key to efficient execution while retaining contexts with their many benefits.  Note that the indirect temp vector implementation of modified closed over temporaries is a standard one taken from lisp implementations.

_,,,^..^,,,_ (phone)

> On Apr 19, 2020, at 9:18 AM, Stéphane Rollandin <lecteur at zogotounga.net> wrote:
> 
> Hello,
> 
> Is there a way to map the temp variables stored in a BlockClosure with their names as they appear in the decompileString?
> 
> For example we have:
> 
>    | y |
>    y := 10.
>    [:x | y + x] basicAt: 1        "returns 10"
> 
> and
> 
>    | y |
>    y := 10.
>    [:x | y + x] decompileString    "returns '[:x | y + x]'"
> 
> 
> What I would like is something like
> 
>    | y |
>    y := 10.
>    [:x | y + x] tempBindingAt: 1    "would return #y -> 10"
> 
> 
> Stef
> 


More information about the Squeak-dev mailing list