> "given nothing...":
>
> given () { ... }
do { ... }
seems simpler.
> Suppose you want to preserve $_ and alias
>
> given $value -> $g {
'->' seems more visually noisy than it need be in this case.
Perhaps:
given $value as $g { ... }
for @foo as $f { ... }
But, I can see how
> for 0 .. Inf; "a" .. "z" x 1000 -> $i; $a {
for 0 .. Inf; "a" .. "z" x 1000 as $i; $a {
would be seen as a counterexample by some.
> Similarly, if we make a word to mean to explicitly break
> out of a topicalizer, it should not be last. I'd suggest break!
> So it looks to me like we need a break.
I'm glad Larry didn't suggest 'done', because I really enjoyed Apo4.
I'll suggest it instead.
> I also happen to think that Exception is too long a name to
> prefix most common exceptions...
> c::NEXT
Based purely on visual impact, c:: seems best.
Perhaps 'when', or CATCH, could cause the parser to automatically
try an Error:: (or Exit:: or whatever) class prefix when it encounters a
classname.
> KEEP blocks would only be executed if the block succeeded.
> UNDO blocks would only be executed if the block failed.
What defines success? I sometimes raise exceptions to signal
that I'm done, with success, and it's time to wrap up and go back
to some calling code several levels up the stack. But I guess this
is an unusual case so not being able to use KEEP and UNDO
as intended is OK.
Or maybe each block has a Success class exception object
associated with it unless a different exception is raised, and
KEEP is called if the exception isa(Success). Then I can raise
a subclass of Success.
> However, X::Control exceptions (such as X::NEXT) are a
> subset of Exceptions
..
..
> Where exactly control exceptions fit in the class hierarchy is
> still open to debate
What about a change of perspective and terminology:
Exit (or Flow)
NEXT
Exception
ie exeptions are a subset of the ways to exit a block.
--me