MOO-cows Mailing List Archive

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

Re: `expr ! err => whatever'



Well, you know, you _can_ raise any value as an error, including 0. :)

;`raise(0) ! E_DIV, E_INVARG, 0 => "I'm a happy camper"'
=> "I'm a happy camper"
[used 4 ticks, 0 seconds.]

The server already does what Zephaniah proposed, though he may not have
realized what he proposed. :-)

Phantom

>>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?




Follow-Ups:
Home | Subject Index | Thread Index