bootstrap right
This commit is contained in:
parent
b2fe557503
commit
dc2ed1bea8
44
pl/boot.yap
44
pl/boot.yap
@ -324,23 +324,14 @@ true :- true.
|
|||||||
set_value('$yap_inited', true),
|
set_value('$yap_inited', true),
|
||||||
% do catch as early as possible
|
% do catch as early as possible
|
||||||
(
|
(
|
||||||
|
% \+ '$uncaught_throw'
|
||||||
current_prolog_flag(halt_after_consult, false),
|
current_prolog_flag(halt_after_consult, false),
|
||||||
current_prolog_flag(verbose, normal)
|
current_prolog_flag(verbose, normal)
|
||||||
% \+ '$uncaught_throw'
|
|
||||||
->
|
->
|
||||||
'$version'
|
'$version'
|
||||||
;
|
;
|
||||||
true
|
true
|
||||||
),
|
),
|
||||||
% '$init_preds', % needs to be done before library_directory
|
|
||||||
% (
|
|
||||||
% retractall(user:library_directory(_)),
|
|
||||||
% '$system_library_directories'(D),
|
|
||||||
% assertz(user:library_directory(D)),
|
|
||||||
% fail
|
|
||||||
% ;
|
|
||||||
% true
|
|
||||||
% ),
|
|
||||||
current_prolog_flag(file_name_variables, OldF),
|
current_prolog_flag(file_name_variables, OldF),
|
||||||
set_prolog_flag(file_name_variables, true),
|
set_prolog_flag(file_name_variables, true),
|
||||||
'$init_consult',
|
'$init_consult',
|
||||||
@ -360,14 +351,25 @@ true :- true.
|
|||||||
prolog_flag(resource_database, RootPath),
|
prolog_flag(resource_database, RootPath),
|
||||||
file_directory_name( RootPath, Dir ),
|
file_directory_name( RootPath, Dir ),
|
||||||
atom_concat( Dir, '/init.yap' , Init),
|
atom_concat( Dir, '/init.yap' , Init),
|
||||||
|
(
|
||||||
|
% is lib_dir set?
|
||||||
|
system_library( LibDir )
|
||||||
|
->
|
||||||
|
true
|
||||||
|
;
|
||||||
|
% get it from boot.yap
|
||||||
|
atom_concat( LibDir, '/pl' , Dir),
|
||||||
|
system_library(LibDir)
|
||||||
|
),
|
||||||
bootstrap(Init),
|
bootstrap(Init),
|
||||||
set_prolog_flag(verbose, OldV),
|
set_prolog_flag(verbose, OldV),
|
||||||
module( user ),
|
module( user ),
|
||||||
'$make_saved_state'
|
'$make_saved_state'
|
||||||
;
|
;
|
||||||
true
|
% use saved state
|
||||||
|
|
||||||
|
'$init_state'
|
||||||
),
|
),
|
||||||
'$init_state',
|
|
||||||
'$db_clean_queues'(0),
|
'$db_clean_queues'(0),
|
||||||
% this must be executed from C-code.
|
% this must be executed from C-code.
|
||||||
% '$startup_saved_state',
|
% '$startup_saved_state',
|
||||||
@ -379,7 +381,7 @@ true :- true.
|
|||||||
'$make_saved_state' :-
|
'$make_saved_state' :-
|
||||||
current_prolog_flag(os_argv, Args),
|
current_prolog_flag(os_argv, Args),
|
||||||
(
|
(
|
||||||
member( Arg, Args ),
|
lists:member( Arg, Args ),
|
||||||
atom_concat( '-B', _, Arg )
|
atom_concat( '-B', _, Arg )
|
||||||
->
|
->
|
||||||
qsave_program( 'startup.yss'),
|
qsave_program( 'startup.yss'),
|
||||||
@ -627,9 +629,10 @@ number of steps.
|
|||||||
O = (:- G1)
|
O = (:- G1)
|
||||||
->
|
->
|
||||||
'$current_module'(M),
|
'$current_module'(M),
|
||||||
|
|
||||||
'$process_directive'(G1, Option, M, VL, Pos)
|
'$process_directive'(G1, Option, M, VL, Pos)
|
||||||
;
|
;
|
||||||
'$execute_commands'(O,VL,Pos,Option,O)
|
'$execute_commands'(G1,VL,Pos,Option,O)
|
||||||
).
|
).
|
||||||
'$execute_command'((?-G), VL, Pos, Option, Source) :-
|
'$execute_command'((?-G), VL, Pos, Option, Source) :-
|
||||||
Option \= top,
|
Option \= top,
|
||||||
@ -1312,19 +1315,6 @@ not(G) :- \+ '$execute'(G).
|
|||||||
'$check_callable'(_,_).
|
'$check_callable'(_,_).
|
||||||
|
|
||||||
|
|
||||||
'$bootstrap' :-
|
|
||||||
bootstrap('init.yap'),
|
|
||||||
module(user),
|
|
||||||
'$live'.
|
|
||||||
|
|
||||||
|
|
||||||
'$silent_bootstrap'(F) :-
|
|
||||||
yap_flag(verbose, Old, silent),
|
|
||||||
bootstrap( F ),
|
|
||||||
yap_flag(verbose, _, Old),
|
|
||||||
'$live'.
|
|
||||||
|
|
||||||
|
|
||||||
bootstrap(F) :-
|
bootstrap(F) :-
|
||||||
% '$open'(F, '$csult', Stream, 0, 0, F),
|
% '$open'(F, '$csult', Stream, 0, 0, F),
|
||||||
% '$file_name'(Stream,File),
|
% '$file_name'(Stream,File),
|
||||||
|
Reference in New Issue
Block a user