Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CPS and the call stack

9 views
Skip to first unread message

Luke Palmer

unread,
Jun 28, 2003, 7:32:45 AM6/28/03
to perl6-i...@perl.org
So, now that we're using CPS, will there be a standard way of seeing
what the call stack is (for purposes of debugging/C<caller>/&c.)? Is
it just a matter of looking in P0 and then P0's P0, and so on? Or
will that croak in certain cases?

Luke

Leopold Toetsch

unread,
Jun 28, 2003, 9:08:10 AM6/28/03
to Luke Palmer, perl6-i...@perl.org

These are $HL features. I can imagine that Perl6 will stuff the
C<caller>, the subroutine's name and more into P0's properties, if e.g.
debugging is on, or these items are referenced.

For one level the return continuation in P1 is the caller. But you can't
assume to be able to follow up the chain, because PRegs might be saved
away and may contain different stuff.

> Luke

leo

Dan Sugalski

unread,
Jun 29, 2003, 3:13:37 PM6/29/03
to l...@toetsch.at, Luke Palmer, perl6-i...@perl.org
At 3:08 PM +0200 6/28/03, Leopold Toetsch wrote:
>Luke Palmer <fibo...@babylonia.flatirons.org> wrote:
>> So, now that we're using CPS, will there be a standard way of seeing
>> what the call stack is (for purposes of debugging/C<caller>/&c.)? Is
>> it just a matter of looking in P0 and then P0's P0, and so on? Or
>> will that croak in certain cases?
>
>These are $HL features. I can imagine that Perl6 will stuff the
>C<caller>, the subroutine's name and more into P0's properties, if e.g.
>debugging is on, or these items are referenced.

Exactly. If a language want to expose any sort of introspective
information, it should do so.

Having said that, a standard mechanism to do so--perhaps a sub
pushing the passed-in continuation onto the control stack as a
special type of entry, or pushing its name on the stack (or both)
wouldn't be out of order so those languages that want to do this can
do so in a standard way.
--
Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk

0 new messages