diff --git a/pl/boot.yap b/pl/boot.yap index 6f8cbb383..85cb7ea3b 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -1461,7 +1461,7 @@ bootstrap(F) :- !, '$yap_strip_module'(M1:MH,M,H), ( M == M1 -> B = B0 ; B = M1:B0), - error:is_callable(M:H,P). + is_callable(M:H,P). '$check_head_and_body'(MH, M, H, true, P) :- '$yap_strip_module'(MH,M,H), diff --git a/pl/consult.yap b/pl/consult.yap index 1332668fd..9561af4b4 100644 --- a/pl/consult.yap +++ b/pl/consult.yap @@ -1418,8 +1418,8 @@ initialization(_G,_OPT) :- stop_low_level_trace. '$initialization'(G,OPT) :- - error:must_be_of_type(callable, G, initialization(G,OPT)), - error:must_be_of_type(oneof([after_load, now, restore]), + must_be_of_type(callable, G, initialization(G,OPT)), + must_be_of_type(oneof([after_load, now, restore]), OPT, initialization(G,OPT)), ( OPT == now diff --git a/pl/newmod.yap b/pl/newmod.yap index ca566eac6..0cf857a43 100644 --- a/pl/newmod.yap +++ b/pl/newmod.yap @@ -42,12 +42,16 @@ to other modules; they can, however, be accessed by prefixing the module name with the `:/2` operator. **/ +'$module_dec'(system(N, Ss), Ps) :- !, + new_system_module(N), + '$mk_system_predicates'( Ss , N ), + '$module_dec'(N, Ps). '$module_dec'(system(N), Ps) :- !, new_system_module(N), - recordz('$system_initialization', prolog:'$mk_system_predicates'( Ps , N ), _), - '$current_module'(_,N). +% '$mk_system_predicates'( Ps , N ), + '$module_dec'(N, Ps). '$module_dec'(N, Ps) :- - source_location(F,_Line), + source_location(F,_Line), '$nb_getval'( '$user_source_file', F0 , fail), '$add_module_on_file'(N, F, F0, Ps), '$current_module'(_,N). @@ -55,7 +59,7 @@ name with the `:/2` operator. '$mk_system_predicates'( Ps, N ) :- lists:member(Name/A , Ps), functor(P,Name,A), - '$mk_system_predicate'(P, N), + '$new_system_predicate'(P, prolog), fail. '$mk_system_predicates'( _Ps, _N ). diff --git a/pl/protect.yap b/pl/protect.yap index 02b0a2c89..4ba693085 100755 --- a/pl/protect.yap +++ b/pl/protect.yap @@ -20,11 +20,20 @@ % This protects all code from further changes % and also makes it impossible from some predicates to be seen '$protect' :- - '$current_predicate'(Name,M,P,_), + '$current_predicate'(Name,prolog,P,_), M \= user, functor(P,Name,Arity), '$new_system_predicate'(Name,Arity,M), sub_atom(Name,0,1,_, '$'), + functor(P,Name,Arity), + '$hide_predicate'(P,M), + fail. +'$protect' :- + '$system_module'(M), + '$current_predicate'(Name,M,P,_), + M \= user, + functor(P,Name,Arity), + '$new_system_predicate'(Name,Arity,M), fail. '$protect' :- current_atom(Name),