[perl6-annonce list snipped from Cc:, didn't even notice it the first time]
"Brust, Corwin" wrote:
>
> Let me see If I have it...
>
> try {...} is synonmous with eval {...} which is syntatic sugar for { ... }
Hmmm, I think I'd put it this way: if there's a catch or cleanup statement
(however they're speled) after the closing '}', any BLOCK is promoted to be
an 'eval { ... }' BLOCK. And eval could be spelled 'try', of course.
Not sure that the following need work, though I think it looks ok in
a short example (the cuddling is my way of hinting that the catch and
cleanup BLOCKs are tightly associated with the preceding BLOCKs.:
if ( foo ) {
kaboom ;
} catch X::blah {
}
else {
} cleanup {
}
I kind like this, though:
while (<>) {
} cleanup {
}
> So the changes, as far as diction is concerned would be:
>
> New keywords:
> try (same as eval)
I suggest not changing the spelling of eval unless need be.
> catch (same as C<else>, or maybe C<elsif>)
Just to be clear, I see it as more like Jave/C++ catches than perl's
else statement. It needs one or more matching expressions, and perhaps
a variable name:
catch my X::err1, X:Err2 $x {
}
But that's being hashed out separately.
- Barrie