MOO-cows Mailing List Archive

[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: `expr ! err => whatever'



Ack your right, you know I tried to remember that statement for a while
before I gave up figuring it misremembered it?
Sorry for the spam

On Wed, 23 Jul 1997, Gustavo Glusman wrote:

> >What would the chances be of sometime in the future of getting a patch (or
> >getting it integrated into the main tree) so that the
> >`expr ! ERR => value' stuff would take any value in place of the error?
> >So you could do something like
> >x = `#obj:verb() ! E_PERM, E_VERBNF, 0 => 1'; or such
> 
> The error-catching expression does just that - catches raised errors. This
> is different from looking at the returned value.
> If it were modified, then, to catch errors *and* filter returned values,
> how would you distinguish between the expression having raised an error, or
> having returned an error value?
> 
> >It seems to me that it would be very useful to add the functionality if it
> >would be at little cost.
> 
> In your particular example, it's simple enough to use:
>   x = `#obj:verb() ! E_PERM, E_VERBNF => 1' || 1;
> 
> For logically true returned values that you want to filter, why not just
> use an if?
> 
> To summarise, no functionality would be added - just a shorthand for
> existing functionality. And some functionality would be lost -
> distinguishing between raised errors and returned error values.


References:
Home | Subject Index | Thread Index