Re: [eclipse-clp-users] ECLiPSe's equivalence for "set_prolog_flag(unknown, fail)"

From: Kish Shen <kisshen_at_...5...>
Date: Sun, 04 Jan 2009 08:53:33 +0000
Huy Pham wrote:
> Greetings,
> 
> Would someone kindly let me know what is the ECLiPSe's equivalence for
> 
>     :- set_prolog_flag(unknown, fail).
> 
> Thanks,
> 
> Huy
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> ECLiPSe-CLP-Users mailing list
> ECLiPSe-CLP-Users_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users
Hi Huy,

You did not state which Prolog you are refering to. I assume you are 
referring to SWI-Prolog, where there is a set_prolog_flag/2, and the 
above changes the behaviour when you call an undefined predicate, it 
siliently fails rather than raise an error.

This is normally a bad idea, but if you really want to do it in ECLiPSe, 
you can redefine the error handler for the "calling an undefined 
procedure" error (event/error 68 -- you can find a list of the events in 
Appendix C of the User manual):

:- set_error_handler(68, fail/0).

Cheers,

Kish


-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.
Received on Sun Jan 04 2009 - 09:22:31 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 22 2024 - 18:13:20 CET