July 28, 2011
3:54 p.m.
On Jul 28, 2011, at 5:11 PM, Dario Trussardi wrote:
and methodB:
methodB
| a b c |
a := 'a'.
......... i can now at this step reference the var1 defined in methodA ?
I think it's in the stack or i wrong ?
Yes, it is on the stack: thisContext sender tempNamed: 'var1'. but tempNamed: has to look at the sources... so faster is: thisContext sender tempAt: 1.
It's no elegant do it ?
I would not do it... it's hard to understand, easy to break (adding a temp will break it, refactoring breaks it easily, calling the method from somewhere else will lead to funny effects, and so on). And it's slow (on the jit it means that the context needs to be created) and far too much magic. Marcus -- Marcus Denker -- http://marcusdenker.de