MOO-cows Mailing List Archive

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

Re: `expr ! err => whatever'



At 22:28 -0800 26/7/97, Richard Connamacher wrote:
>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

Not quite. What was suggested was that the error-catching expression
'catch' any value *that is returned*, in addition to those that are raised.

His example was: x = `#obj:verb() ! E_PERM, E_VERBNF, 0 => 1';
I guess you could modify it to: x = `raise(#obj:verb()) ! E_PERM, E_VERBNF,
0 => 1';
This would accomplish *some* of what he wanted, but not exactly what he
wanted (e.g. if now the verb returns a 1, he wanted it to be returned
normally, but it would be raised and not catched). Moreover, returned and
raised errors would be undistinguishable (as I said in my previous posting).

Cheers,

     ____________________________________________________________
     Gustavo Glusman              Founder/administrator of BioMOO
     Gustavo@bioinfo.weizmann.ac.il    (public PGP key available)
     http://bioinfo.weizmann.ac.il/Gustavo
        Visit BioMOO, the biologists' virtual meeting place, at
     ___________ http://bioinfo.weizmann.ac.il/BioMOO ___________



References:
Home | Subject Index | Thread Index