Subject: Re: How to turn off exceptions?

From: [email-masked] (Uwe Lesta)
Date: Thu, 21 Oct 1999 23:33:14 +0200

arol Roslaniec schrieb:
> 
> Hi,
> 
> I have just started to learn Prolog, and I have one question (suppose very
> trival for you).
> I downloaded two versions of Prolog:
> 1. Amzi! Logic Explorer,
> 2. SWI-Prolog.
> 
> Assume, there is no facts in datebase (it is empty).
> In "Amzi!", when I type
> ?- any_goal(anything).
> it answers simply "no", whereas "SWI-Prolog" answers:
> [WARNING: Undefined predicate: `any_goal/1']
> No
> 
> My question is:
> is it possible to TURN OFF exceptions handling in SWI-Prolog.

IMHO NO only for special exceptioans or a special goal.

> I've read about catch/3, but i do not understand much of it.
> At the begining, i would prefer to turn them off globally.
> Or maybe should i use 'exception/3'? I have no idea (cause i do not know
> Prolog good enough).
> BTW, I know what exceptions are and how they work from Object Oriented
> Languages as: Delphi, C++, Java; but using exceptions in Prolog is too
> difficult for me (at least just now).
> 
> Could you help me?

Yes. Try :

?- dynamic any_goal/1.

Yes
?- any_goal(anything).

No
?-

see olso unknown/2 in the manual.

-- 

Regards

Uwe
[email-masked]