7.4.1 Raising exceptions

Prev Up Next Page 182 of 800 Search internet

An exception is a data structure which represents an exceptional situation. As an example, x div y returns x integer divided by y which usually is an integer. But division by zero yields an exception:

1 div 0 == exception

The x raise construct forges an exception with 'payload' x and is said to 'throw' x.

The exception construct forges an exception with payload true:

exception == true raise

Prev Up Next Page 182 of 800 Search logiweb.eu

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