Logiweb(TM)

7.4.3 Catching exceptions

Prev Up Next Page 184 of 800 Search internet


The x catch construct evaluates x and returns a pair e :: v. The value of e is true if the value of x is an exception and false otherwise. In the former case, v is the payload of the exception. In the latter case, v is the value of x. Some examples read:

( 2 + 3 raise ) catch == true :: 3

( 2 + 3 ) catch == false :: 5

The x catch construct is the fourth example in this chapter of a construct which is not eager left-relaying. It is not eager left-relaying because it is not relaying.

Prev Up Next Page 184 of 800 Search logiweb.eu

Copyright © 2010 Klaus Grue, GRD-2010-01-05