try x else y -- returns the value of x unless an error or
alarm occurs during the evaluation of x, in which case it
returns the value of y.
try x -- returns the value of x unless an error or
alarm occurs during the evaluation of x, in which case it
returns null.
The behavior of interrupts (other than alarms) is unaffected.
i1 : apply(-3..3,i->try 1/i else infinity) |
We will change the behavior of this function soon so that it will be possible to catch errors of a particular type. Meanwhile, users are recommended to use this function sparingly, if at all.