Dan Sugalski <[EMAIL PROTECTED]> writes:
At 11:19 PM +0200 6/29/03, Leopold Toetsch wrote:Dan Sugalski wrote:... I'd also like to be able to manipulate the stacks in a context, pushing things on them, changing values on them, and generally messing about with the things, so I'm all for it.
Do you have some examples for a usage of such manipulations? I thought that a return continuations should exactly match the state of the caller, so that the C<updatecc> op would do the work. But there are for sure some hacks, that might need some:
updatecc <.stack> <.action> item
Yep, that could work.
There are a few actual good reasons to do this:
*) A subroutine may want to affect the warnings state of its caller *) A sub may want to add in block exit actions (though that's more an inspection for the block exit item on the caller's stack) *) It's possible the callee may want to mess around with an exception handler at an outer level, though that's probably a bad idea *) The callee may want to insert elements onto the control stack of the caller
Not *very* good reasons, mind, but... :)
Yeah, but at least one of 'em is required in Perl 6 (the 'affect the warnings state of the caller' thing) isn't it?
Yup, and I want to be able to put lexicals in the calling scopes as well, which we'll have to do to support the wacky MY stuff.
--
Dan
--------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk