Bryan C. Warnock asked:

> Is it POST, LAST or LAST, POST, at runtime?

LAST then POST I suspect. For reasons already given in someone else's
reply. But, just possibly: intermixed in reverse order of definition.


> How does one enforce the no side-effects rule, and how deeply does it
> traverse?

By prohibiting mutation of variables not lexical to the block,
forbidding I/O, allowing calls only to already-defined subs, and
applying the same restrictions recursively to those subs.

 
 
> Do I remember right that 'return' creates a control exception?

Yes.

 
> 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?

Correct. KEEP+UNDO = CATCH and you can only have one CATCH per block.


> If one cannot (or does not) inherit a PRE, POST, or LAST block,

LAST blocks aren't ever inherited.


> is there a way to add one without recreating the entire block.

Probably not. If there were, it would be via the block's MY pseudoclass
and be subject to the same "compile-time modifications only" constraints
as other up-scope lexical manipulations.


> When you say inheritence (which implies a sub)

....implies a method. Not the same thing in Perl 6.

> 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

Of course.

> 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.)

Err. I'm afraid you lost me there. What are you trying to achieve, again?


>     sub non_method {
>         loop {
>             PRE {
>                 print "PRE\n"; # Is printing a side-effect?
>                 ...
>             }

Printing can be a side effect. For example, your example modifies a
global filehandle.

Damian


Reply via email to