HaloO,
Yaakov Belch wrote:
I believe that ---from a usability point of view--- it's very important to:
* classify exceptions by "severity" or other characteristics,
* provide named adverbs/pragmas to modify default CATCH handlers,
* make them configurable by "outer scopes".
> [..]
The program
Thank you very much!
my $bill =
try ack() orelse
try thpp() orelse
do ppt();
This certainly does what I asked for, and it's short enough (even if we
need to add a few brackets).
Yes, the basic problem with the proposal is that it catches all
exceptions willy nilly and u
Yaakov Belch perl6-at-yaakovnet.net |Perl 6| wrote:
Let me explain why this is useful and why I think this is "the right thing":
First of all, it provides a very light-weight exception handling using
well-known ideoms like:
$file_content=read_file($filename) // $default_value;
compute_statist
On Wed, Aug 06, 2008 at 09:36:16AM -0700, jerry gay wrote:
: i don't think this will work for perl 6. since perl 6 has resumeable
: exceptions (like C), the meaning of the C operator could be
: ambiguous. given the following statement,
:
: my $bill = ack() // thpp() // ppt();
:
: with perl 6's
> in my mind, this strays too far from the meaning of C and adds
> ambiguity that makes the operator unusable. perhaps there's room for
> an operator that gives some sugar for
>
> my $bill = try { ack() CATCH { thpp() } };
>
> but to me that code is concise enough that it doesn't warrant syntacti
On Wed, Aug 6, 2008 at 8:58 AM, Yaakov Belch <[EMAIL PROTECTED]> wrote:
> In a little language that I wrote some time ago, I found it very useful to
> let the // operator catch exceptions:
>
> f(x) // g(y) does:
> * If f(x) returns a defined value, use this value.
> * If f(x) returns an undefined v
In a little language that I wrote some time ago, I found it very useful to
let the // operator catch exceptions:
f(x) // g(y) does:
* If f(x) returns a defined value, use this value.
* If f(x) returns an undefined value, use the value of g(x) instead.
* If f(x) throws an exception, catch and keep