On Sunday 20 January 2002 08:29, [EMAIL PROTECTED] wrote: > On Saturday 19 January 2002 22:05, Brent Dax wrote: > > > Is this list of special blocks complete and correct? > > Close and close. As of two days ago, Larry's thinking was: >
Note to self: Program flow > BEGIN Executes at the beginning of compilation > CHECK Executes at the end of compilation > INIT Executes at the beginning of run > END Executes at the end of run Note to self: Block flow > PRE Executes at block entry. > Inherited if block is a method. No side-effects >allowed. > POST Executes at block exit. > Inherited if block is a method. No side-effects >allowed. > NEXT Executes on (explicit or implicit) call to next() > within current block > CATCH Executes on exception within current block > LAST Executes on any form of block exit. > Not inherited (c.f. POST), even if block is a method. > Side-effects allowed. > KEEP Specialized form of CATCH. > Executes on "control" exception in the current block > UNDO Specialized form of CATCH. > Executes on non-"control" exception in the current >block Is it POST, LAST or LAST, POST, at runtime? How does one enforce the no side-effects rule, and how deeply does it traverse? Do I remember right that 'return' creates a control exception? Do KEEP and UNDO take the place of CATCH within a block? (ie, you may either CATCH, or you may KEEP and UNDO, but not both?) If all three are allowed, what is the exception handling order? Which blocks may you have more than one of within the same block, and in what order will they execute? In one cannot (or does not) inherit a PRE, POST, or LAST block, is there a way to add one without recreating the entire block. When you say inheritence (which implies a sub), not inheriting only applies to the outer-most scope - the sub scope - currect? Any container blocks should still have their full semantics preserved, so that an embedded while block, for instance, would still have its corresponding LAST, I hope. If that were the case, could you then get around the inheritence issue by enclosing the entire body of the sub inside its own block? (I'm not saying that that's a good idea, just asking whether it could be done.) sub non_method { loop { PRE { print "PRE\n"; # Is printing a side-effect? ... } POST { print "POST\n"; ... } LAST { print "LAST\n"; ... } code(); last; } } -- Bryan C. Warnock [EMAIL PROTECTED]