Update of /cvsroot/xsb/XSB/syslib
In directory usw-pr-cvs1:/tmp/cvs-serv15045/syslib
Modified Files:
string.P standard.P standard.O standard.H loader.P loader.O
loader.H
Log Message:
fixed a buglet in undefined predicate hook handling
Index: string.P
===================================================================
RCS file: /cvsroot/xsb/XSB/syslib/string.P,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- string.P 2001/05/31 18:00:31 1.15
+++ string.P 2001/06/17 09:37:31 1.16
@@ -69,6 +69,8 @@
atom_codes(Atom,List),
atom_to_charlist(Rest,Slist,Lrest).
+%% Get substring of String beginning at from and ending at To.
+%% Negating To counts from the end.
substring(String,From,To,Subst) :- substring(String,From,To,Subst).
string_substitute(String,SubstSpec,SubstList,ResultStr) :-
string_substitute(String,SubstSpec,SubstList,ResultStr).
Index: standard.P
===================================================================
RCS file: /cvsroot/xsb/XSB/syslib/standard.P,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- standard.P 2001/05/22 17:37:31 1.45
+++ standard.P 2001/06/17 09:37:31 1.46
@@ -952,6 +952,7 @@
psc_prop(Psc, Cp),
close_open_tables,
'_$cutto'(Cp),
+ reset_undef_pred_handlers,
fail.
Index: standard.O
===================================================================
RCS file: /cvsroot/xsb/XSB/syslib/standard.O,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
Binary files /tmp/cvsz8EQYD and /tmp/cvskyKrr7 differ
Index: standard.H
===================================================================
RCS file: /cvsroot/xsb/XSB/syslib/standard.H,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- standard.H 2001/05/22 17:37:31 1.23
+++ standard.H 2001/06/17 09:37:32 1.24
@@ -84,7 +84,9 @@
/* The following predicates are directly imported from other modules */
-:- import '_$load_undef'/1 from loader.
+:- import '_$load_undef'/1,
+ reset_undef_pred_handlers/0
+ from loader.
:- import psc_set_prop/2, psc_name/2, psc_arity/2, psc_prop/2, psc_type/2,
term_psc/2, term_new/2, term_type/2, stat_set_flag/2,
stat_flag/2, psc_set_type/2, term_compare/3,
Index: loader.P
===================================================================
RCS file: /cvsroot/xsb/XSB/syslib/loader.P,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- loader.P 2001/03/23 03:48:18 1.29
+++ loader.P 2001/06/17 09:37:32 1.30
@@ -295,15 +295,15 @@
call_undef_pred_handlers(PSC,AbortMsg) :-
%% the _$_$_undefhook trick guards against Undefined preds in
%% the hook themselves; prevents going into an infinite loop
- ( conget('_$_$_undefhook',0)
+ ( not_handling_undef_pred
; abort(['[In undefined predicate handler] ' | AbortMsg])
),
- conset('_$_$_undefhook',1),
+ set_undef_pred_handling,
!,
- ( call_xsb_hook(xsb_undefined_predicate_hook(_),
- [PSC,RetCode],
- until_true),
- conset('_$_$_undefhook',0)
+ ( call_xsb_hook(xsb_undefined_predicate_hook(_),
+ [PSC,RetCode],
+ until_true),
+ reset_undef_pred_handlers
%% found a handler that agrees to handle this predicate
-> ( RetCode==true
-> psc_type(PSC, Type1),
@@ -321,10 +321,13 @@
; fail
)
%% if all else fails -- abort
- ; conset('_$_$_undefhook',0),
+ ; reset_undef_pred_handlers,
abort(AbortMsg)
).
+reset_undef_pred_handlers :- conset('_$_$_undefhook',0).
+set_undef_pred_handling :- conset('_$_$_undefhook',1).
+not_handling_undef_pred :- conget('_$_$_undefhook',0).
/*
* Loads and executes the directives of a module. The file containing
Index: loader.O
===================================================================
RCS file: /cvsroot/xsb/XSB/syslib/loader.O,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
Binary files /tmp/cvsuwxAvG and /tmp/cvsS0JvEc differ
Index: loader.H
===================================================================
RCS file: /cvsroot/xsb/XSB/syslib/loader.H,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- loader.H 2001/02/23 02:22:57 1.12
+++ loader.H 2001/06/17 09:37:32 1.13
@@ -24,8 +24,10 @@
*/
-:- export load_pred/1, load/1, libpath/1, set_inthandler/2, '_$load_undef'/1,
- windows_os_loader/0.
+:- export load_pred/1, load/1, libpath/1, set_inthandler/2,
+ '_$load_undef'/1,
+ reset_undef_pred_handlers/0,
+ windows_os_loader/0.
:- import abort/1 from standard.
:- import conset/2 from gensym.
|