develooper Front page | perl.perl6.internals | Postings from August 2002

Stack mark ops & such.

Thread Next
From:
Dan Sugalski
Date:
August 5, 2002 00:52
Subject:
Stack mark ops & such.
Message ID:
a05111b14b973d63571a3@[63.120.19.221]
Okay, I'm about half a step from putting pushmark, popmark, stack 
marks, and suchlike things into the core. This is everyone's chance 
to tell me how bad an idea that is. :)

First important note--Marks can be popped to either as an error (for 
example when unwinding because of an exception) or as normal (for 
regular pops on scope leave and such). This is to facilitate rollback 
activities on error and suchlike things.

pushmark: push a marker on the control stack. Does nothing else.

popmark: Pop a marker from the control stack.

popmarkerror: Pop to a marker, passing an error status to everything 
being popped.

mark[ispnuf]: mark where the int, string, pmc, number, user, or 
fastint stacks are. When popped, they go back there.

rememberval: Pushes a pointer and a value. When popped, the value is 
put back in the pointer

tempval: Like rememberval, only it only gets undone on error

This all goes on the control stack, FWIW. Dunno what (if anything) 
we'll do special for the user stack.
-- 
                                         Dan

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

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About