Subject: exception/3

From: "Noord G.J.M. van" <[email-masked]>
Date: Tue, 2 Nov 1999 20:42:33 +0100 (MET)

why doens't exception work the way it is described in the manual?
(version 3.2.9 on HP-UX 10.20)

If I define exception/3 to treat a unknown predicate, then apparantly
exception/3 is called succesfully, but swi prints an error message of 
its own nonetheless...

Moreover, goals which are typed to the input prompt are not passed on
to exception/3 at all ??? (Is there a difference between an
undefined predicate and an undefined procedure?)

Ex:

consult(user).
| exception(undefined_predicate,X,fail):-
|    format(user_error,"undef: ~w~n",[X]).
| ^D
user compiled, 0.00 sec, 328 bytes.

Yes
7 ?- jan.
[WARNING: Undefined predicate: `jan/0']

No
8 ?- [user].
2 |: jan :- piet.
2 |:
user compiled, 0.00 sec, 0 bytes.

Yes
9 ?- jan.
[WARNING: Undefined procedure: piet/0]
   Exception: (  8) piet ?                       

Another question, is there a way to `hook' print_message/2 so that
I can provide message printers for my own exceptions?

- 
Gertjan van Noord Alfa-informatica, RUG,  Postbus 716, 9700 AS Groningen
vannoord at let dot rug dot nl            http://www.let.rug.nl/~vannoord/