Jonathan Scott Duff wrote:
> 
> Tony Olekshy wrote:
> >
> > The "try" is not necessarily for Perl's sake.  It's for the
> > programmer's sake.  It says, watch out, some sort of non-local
> > flow control may be going on here.  It signals intent to deal
> > with action at a distance (unwinding semantics).
> 
> How important are the exceptions?  What about putting them first?
> 
>         exceptions {
>            # code that does exception handling
>         }
>         {
>            # code that may throw exceptions
>         }
> 
> Note that's a two-block keyword.

Note that's a really bad idea.  Two-block keywords are evil.
That's why the proposed omnibus Exceptions RFC has except:
we could do it with a two block catch, but I can't read that
in any but the simplest cases (blocks can get somewhat large,
after all).  So you end up adding a comment like "# Try" to
all these "anonymous" blocks.  Why not just bite the bullet
and make it part of the syntax?

Leave the try in, put your cursor on the "{", hit % (or whatever
your editor uses), and you've got the next clause.  That's what
try's for.

> > I don't think we should obfuscate classic try/throw/catch/finally
> > from the ground up.
> 
> I'm inclined to agree with you, but as you can see, I'm not letting
> that hamper my brainstorming effort :-)

Brainstorming is a big part of what we're here for.  I certainly
appreciate your contributions.

Yours, &c, Tony Olekshy

Reply via email to