develooper Front page | perl.perl5.porters | Postings from July 2013

Re: Try/Catch Exception Objects: Possible?

Thread Previous | Thread Next
David Golden
July 25, 2013 13:35
Re: Try/Catch Exception Objects: Possible?
Message ID:
On Thu, Jul 25, 2013 at 6:42 AM, David E. Wheeler <> wrote:
>> On Tue, Jul 23, 2013 at 3:56 PM, David E. Wheeler <> wrote:
>>> The catch block should not do conditional execution. One should use a switch statement or whatever inside the catch block.
>> Why not? Please make a real case for that opinion.
> The case is just that we should try to focus on fundamentals, first. This sort of thing can be added once the fundamentals work.

That's different than what you said.  "the catch block should not do
conditional execution" versus "the catch block shouldn't do
conditional execution in the first draft".   For prototyping, fine,
but I'd be cautious actually adding an experiment for which we might
change the syntax later.  I wouldn't necessarily want to wind up with
"catch" and "catchif" just because "catch" was introduced first
without any conditionality.

>> How about using a non-argument lexical like "for" blocks:
>>   for my $foo ( list() ) { ... }
> IIRC, Chip apologized for this syntax, because it’s declared outside the block yet lexically defined inside the block. Is it really something we want to spread?

It works that way for "while" and "if" and "elseif", too, so at this
point, I think that's a pretty well-understood, commonly-used Perl 5
way to do things.


David Golden <>
Take back your inbox! →
Twitter/IRC: @xdg

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About