more PL fixes
This commit is contained in:
parent
c4b78e161b
commit
394ecd4657
97
pl/boot.yap
97
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,26 +83,25 @@ private(_).
|
|||||||
%
|
%
|
||||||
% boootstrap predicates.
|
% boootstrap predicates.
|
||||||
%
|
%
|
||||||
:- system_module( '$_boot', [
|
:- system_module( '$_boot',
|
||||||
bootstrap/1,
|
[
|
||||||
call/1,
|
!/0,
|
||||||
catch/3,
|
':-'/1,
|
||||||
catch_ball/2,
|
'?-'/1,
|
||||||
expand_term/2,
|
[]/0,
|
||||||
print_message/2,
|
bootstrap/1,
|
||||||
import_system_module/2,
|
call/1,
|
||||||
system_module/2,
|
catch/3,
|
||||||
private/1,
|
catch_ball/2,
|
||||||
incore/1,
|
expand_term/2,
|
||||||
(not)/1,
|
print_message/2,
|
||||||
repeat/0,
|
import_system_module/2,
|
||||||
throw/1,
|
system_module/2,
|
||||||
true/0]).
|
private/1,
|
||||||
|
incore/1,
|
||||||
:- system_module( '$_init', [!/0,
|
(not)/1,
|
||||||
':-'/1,
|
repeat/0,
|
||||||
'?-'/1,
|
throw/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 )
|
||||||
*
|
*
|
||||||
|
@ -29,7 +29,7 @@ live :-
|
|||||||
( Module==user ->
|
( Module==user ->
|
||||||
true % '$compile_mode'(_,0)
|
true % '$compile_mode'(_,0)
|
||||||
;
|
;
|
||||||
format(user_error,'[~w]~n', [Module])
|
format(user_error,'[~w]~n', [Module])
|
||||||
),
|
),
|
||||||
'$system_catch'('$enter_top_level',Module,Error,'$Error'(Error)).
|
'$system_catch'('$enter_top_level',Module,Error,'$Error'(Error)).
|
||||||
|
|
||||||
|
@ -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