more PL fixes
This commit is contained in:
parent
c4b78e161b
commit
394ecd4657
69
pl/boot.yap
69
pl/boot.yap
@ -28,6 +28,27 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
% be careful here not to generate an undefined exception..
|
||||||
|
|
||||||
|
print_message(informational,_) :-
|
||||||
|
yap_flag(verbose, silent),
|
||||||
|
!.
|
||||||
|
print_message(informational,E) :-
|
||||||
|
format('informational message ~q.~n',[E]),
|
||||||
|
!.
|
||||||
|
%%
|
||||||
|
% boot:print_message( Type, Error )
|
||||||
|
%
|
||||||
|
print_message(Type,error(error(_,_),exception(Desc))) :-
|
||||||
|
!,
|
||||||
|
'$print_exception'(Desc).
|
||||||
|
print_message(Type,error(warning(_,_),exception(Desc))) :-
|
||||||
|
!,
|
||||||
|
'$print_exception'(Desc),
|
||||||
|
!.
|
||||||
|
print_message(Type,Error) :-
|
||||||
|
format( user_error, '~w while bootstraping: event is ~q~n',[Type,Error]).
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @pred system_module( _Mod_, _ListOfPublicPredicates, ListOfPrivatePredicates *
|
* @pred system_module( _Mod_, _ListOfPublicPredicates, ListOfPrivatePredicates *
|
||||||
* Define a system module _Mod_. _ListOfPublicPredicates_ . Currentlt, all
|
* Define a system module _Mod_. _ListOfPublicPredicates_ . Currentlt, all
|
||||||
@ -62,7 +83,12 @@ private(_).
|
|||||||
%
|
%
|
||||||
% boootstrap predicates.
|
% boootstrap predicates.
|
||||||
%
|
%
|
||||||
:- system_module( '$_boot', [
|
:- system_module( '$_boot',
|
||||||
|
[
|
||||||
|
!/0,
|
||||||
|
':-'/1,
|
||||||
|
'?-'/1,
|
||||||
|
[]/0,
|
||||||
bootstrap/1,
|
bootstrap/1,
|
||||||
call/1,
|
call/1,
|
||||||
catch/3,
|
catch/3,
|
||||||
@ -76,12 +102,6 @@ private(_).
|
|||||||
(not)/1,
|
(not)/1,
|
||||||
repeat/0,
|
repeat/0,
|
||||||
throw/1,
|
throw/1,
|
||||||
true/0]).
|
|
||||||
|
|
||||||
:- system_module( '$_init', [!/0,
|
|
||||||
':-'/1,
|
|
||||||
'?-'/1,
|
|
||||||
[]/0,
|
|
||||||
extensions_to_present_answer/1,
|
extensions_to_present_answer/1,
|
||||||
fail/0,
|
fail/0,
|
||||||
false/0,
|
false/0,
|
||||||
@ -89,39 +109,17 @@ private(_).
|
|||||||
goal_expansion/3,
|
goal_expansion/3,
|
||||||
otherwise/0,
|
otherwise/0,
|
||||||
term_expansion/2,
|
term_expansion/2,
|
||||||
version/2],
|
version/2,
|
||||||
|
true/0],
|
||||||
[
|
[
|
||||||
'$do_log_upd_clause'/6,
|
'$do_log_upd_clause'/6,
|
||||||
'$do_log_upd_clause0'/6,
|
'$do_log_upd_clause0'/6,
|
||||||
'$do_log_upd_clause_erase'/6,
|
'$do_log_upd_clause_erase'/6,
|
||||||
'$do_static_clause'/5],
|
'$do_static_clause'/5,
|
||||||
'$system_module'/1]).
|
'$system_module'/1]).
|
||||||
|
|
||||||
:- use_system_module( '$_boot', ['$cut_by'/1]).
|
:- use_system_module( '$_boot', ['$cut_by'/1]).
|
||||||
|
|
||||||
% be careful here not to generate an undefined exception..
|
|
||||||
|
|
||||||
print_message(informational,_) :-
|
|
||||||
yap_flag(verbose, silent),
|
|
||||||
!.
|
|
||||||
print_message(informational,E) :-
|
|
||||||
format('informational message ~q.~n',[E]),
|
|
||||||
!.
|
|
||||||
%%
|
|
||||||
% boot:print_message( Type, Error )
|
|
||||||
%
|
|
||||||
print_message(Type,error(_,exception(Desc))) :-
|
|
||||||
'$get_exception'(Desc),
|
|
||||||
print_boot_message(Type,Error,Desc),
|
|
||||||
'$print_exception'(Desc),
|
|
||||||
print_message(Type,warning(_,exception(Desc))) :-
|
|
||||||
'$get_exception'(Desc),
|
|
||||||
print_boot_message(Type,Error,Desc),
|
|
||||||
'$print_exception'(Desc),
|
|
||||||
!.
|
|
||||||
print_message(Type,Error) :-
|
|
||||||
format( user_error, '~w while bootstraping: event is ~q~n',[Type,Error]).
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print_boot_message(Type,Error,Desc) :-
|
print_boot_message(Type,Error,Desc) :-
|
||||||
@ -138,13 +136,6 @@ print_boot_message(Type,Error,Desc) :-
|
|||||||
'$query_exception'(errorLine, Desc, FilePos),
|
'$query_exception'(errorLine, Desc, FilePos),
|
||||||
format(user_error,'~a:~d: ~a: ~q~n', [File,FilePos,Type,Error]).
|
format(user_error,'~a:~d: ~a: ~q~n', [File,FilePos,Type,Error]).
|
||||||
|
|
||||||
'$undefp0'([M|G], _Action) :-
|
|
||||||
functor(G,N,A),
|
|
||||||
print_message( error, error(error(unknown, M:N/A),M:G)),
|
|
||||||
fail.
|
|
||||||
|
|
||||||
:- '$undefp_handler'('$undefp0'(_,_),prolog).
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @pred $system_meta_predicates'( +L )
|
* @pred $system_meta_predicates'( +L )
|
||||||
*
|
*
|
||||||
|
@ -94,7 +94,7 @@ undefined_query(G0, M0, Cut) :-
|
|||||||
'$get_undefined_predicates'(M0:G0, MG), !.
|
'$get_undefined_predicates'(M0:G0, MG), !.
|
||||||
|
|
||||||
% undef handler
|
% undef handler
|
||||||
'$undefp'([M0|G0],MG) :-
|
'$undefp_'([M0|G0],MG) :-
|
||||||
% make sure we do not loop on undefined predicates
|
% make sure we do not loop on undefined predicates
|
||||||
'$undef_setup'(M0:G0, Action,Debug,Current, MGI),
|
'$undef_setup'(M0:G0, Action,Debug,Current, MGI),
|
||||||
('$get_undefined_predicates'( MGI, MG )
|
('$get_undefined_predicates'( MGI, MG )
|
||||||
|
Reference in New Issue
Block a user