On Nov 15, 2005, at 4:28, Chip Salzenberg wrote:

On Sun, Nov 13, 2005 at 11:33:07AM +0100, Leopold Toetsch wrote:

OK, call frame as PMC looks like a non-starter.  Consider it rescinded.

Autrijus mentioned on #parrot that we'd need weak pointers at some time. Then we can reconsider callframe PMCs.

    interp."get_caller"(n_levels)    # interpreter method or
    sub_class = getclass 'Sub'
sub_class."get_caller"(n_levels) # class method 0 = this sub, 1 = caller, ... a_sub."get_caller"(nlevels) # obj method, if you already have a sub

Well, like I explained WRT lexicals, subroutines don't have callers
(nor do they have LexPads).  _Call_frames_ have callers (and LexPads).

Sure. The interpreter or the sub implement "get_caller" on behalf of the callframe.

Which leads to:

The current introspection model only walks back the current call chain.
That's good but not enough.  We also need to walk back any live call
chain, using any live continuation as a starting point.

Yup

How about if we implement get_caller() on Interpreter and Continuation,
rather than Interpreter and Sub?

... Interpreter and Sub and Continuation ;-) Dropping the interface from Sub would again need to expose the RetContinuation, which converts it (and all up the call chain) to real Continuations. If you already have a Continuation then that's fine.

  Alternatively, I guess we could make
get_caller() take two parameters: a Continuation as a starting point
(Null would mean "me"), and a number of levels up.

Hmm. That are 3 params in the method: object, start, level. I guess this needs first some thoughts, how we handle class methods, when invoked by an instance of the class.

leo

Reply via email to