Exceptions

In addition to success and failure, a program may give an exception that is thrown explicitly by a call of throw/2 or raised by a built-in or caused by your typing of control-c. An exception raised by a built-in is an one-argument structure where the functor tells the type and the argument tells the source of the exception.5.1

The following lists some of the exceptions:

The exception caused by the typing of control-c is an atom named interrupt.

An exception that is not caught by your program will be handled by the system. The system reports the type and the source of the exception, and aborts execution of the query. For example, for the query a=:=1, the system will report:

   ***  error(type_error(evaluable,a/0),=:=/2)
where evaluable is the type and =:=/2 is the source.

Neng-Fa Zhou 2012-01-03