Grupos de Google ya no admite nuevas publicaciones ni suscripciones de Usenet. El contenido anterior sigue siendo visible.

CPS and the call stack

Visto 7 veces
Saltar al primer mensaje no leído

Luke Palmer

no leída,
28 jun 2003, 7:32:4528/6/03
a 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

no leída,
28 jun 2003, 9:08:1028/6/03
a 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

no leída,
29 jun 2003, 15:13:3729/6/03
a 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 mensajes nuevos