autoload
This commit is contained in:
parent
2e8dd92d89
commit
101bdf0f6c
@ -70,13 +70,12 @@ opportunity. Initial value is 10,000. May be changed. A value of 0
|
|||||||
#endif
|
#endif
|
||||||
YAP_FLAG(ARCH_FLAG, "arch", false, isatom, YAP_ARCH, NULL), /**<
|
YAP_FLAG(ARCH_FLAG, "arch", false, isatom, YAP_ARCH, NULL), /**<
|
||||||
read-only atom, it describes the ISA used in this version of YAP.
|
read-only atom, it describes the ISA used in this version of YAP.
|
||||||
Available from YAP_AEH.
|
Available from YAP_ARCH.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
YAP_FLAG(ARGV_FLAG, "argv", false, argv, "@boot", NULL),
|
YAP_FLAG(ARGV_FLAG, "argv", false, argv, "@boot", NULL),
|
||||||
YAP_FLAG(ARITHMETIC_EXCEPTIONS_FLAG, "arithmetic_exceptions", true,
|
YAP_FLAG(ARITHMETIC_EXCEPTIONS_FLAG, "arithmetic_exceptions", true,
|
||||||
booleanFlag, "true", NULL),
|
booleanFlag, "true", NULL),
|
||||||
/**< `arithmetic_exceptions`
|
/**<
|
||||||
|
|
||||||
Read-write flag telling whether arithmetic exceptions generate
|
Read-write flag telling whether arithmetic exceptions generate
|
||||||
Prolog exceptions. If enabled:
|
Prolog exceptions. If enabled:
|
||||||
@ -97,7 +96,7 @@ opportunity. Initial value is 10,000. May be changed. A value of 0
|
|||||||
ProbLog.
|
ProbLog.
|
||||||
*/
|
*/
|
||||||
YAP_FLAG(BACK_QUOTES_FLAG, "back_quotes", true, isatom, "true", bqs),
|
YAP_FLAG(BACK_QUOTES_FLAG, "back_quotes", true, isatom, "true", bqs),
|
||||||
/**>
|
/**<
|
||||||
If _Value_ is unbound, tell whether a back quoted list of characters
|
If _Value_ is unbound, tell whether a back quoted list of characters
|
||||||
token is converted to a list of atoms, `chars`, to a list of integers,
|
token is converted to a list of atoms, `chars`, to a list of integers,
|
||||||
`codes`, or to a single atom, `atom`. If _Value_ is bound, set to
|
`codes`, or to a single atom, `atom`. If _Value_ is bound, set to
|
||||||
|
@ -274,40 +274,44 @@ load_files(_Files,_Opts).
|
|||||||
setarg( Id, TOpts, Val ).
|
setarg( Id, TOpts, Val ).
|
||||||
|
|
||||||
'$load_files'(Files, Opts, Call) :-
|
'$load_files'(Files, Opts, Call) :-
|
||||||
( '__NB_getval__'('$lf_status', OldTOpts, fail), nonvar(OldTOpts) - '$lf_opt'(autoload, OldTOpts, OldAutoload)
|
'$lf_option'(last_opt, LastOpt),
|
||||||
;
|
( '__NB_getval__'('$lf_status', OldTOpts, fail),
|
||||||
'$lf_option'(last_opt, LastOpt),
|
nonvar(OldTOpts)
|
||||||
functor( OldTOpts, opt, LastOpt ),
|
->
|
||||||
'$lf_opt'('$context_module', OldTOpts, user)
|
'$lf_opt'(autoload, OldTOpts, OldAutoload)
|
||||||
),
|
;
|
||||||
'$lf_option'(last_opt, LastOpt),
|
current_prolog_flag(autoload, OldAutoload),
|
||||||
functor( TOpts, opt, LastOpt ),
|
functor( OldTOpts, opt, LastOpt ),
|
||||||
( source_location(ParentF, Line) -> true ; ParentF = user_input, Line = -1 ),
|
'$lf_opt'(autoload, OldTOpts, OldAutoload),
|
||||||
'$lf_opt'('$location', TOpts, ParentF:Line),
|
'$lf_opt'('$context_module', OldTOpts, user)
|
||||||
'$lf_opt'('$files', TOpts, Files),
|
),
|
||||||
'$lf_opt'('$call', TOpts, Call),
|
functor( TOpts, opt, LastOpt ),
|
||||||
'$lf_opt'('$options', TOpts, Opts),
|
( source_location(ParentF, Line) -> true ; ParentF = user_input, Line = -1 ),
|
||||||
'$lf_opt'('$parent_topts', TOpts, OldTOpts),
|
'$lf_opt'('$location', TOpts, ParentF:Line),
|
||||||
'$process_lf_opts'(Opts,TOpts,Files,Call),
|
'$lf_opt'('$files', TOpts, Files),
|
||||||
'$lf_default_opts'(1, LastOpt, TOpts),
|
'$lf_opt'('$call', TOpts, Call),
|
||||||
'$lf_opt'(stream, TOpts, Stream),
|
'$lf_opt'('$options', TOpts, Opts),
|
||||||
( nonvar(Stream) ->
|
'$lf_opt'('$parent_topts', TOpts, OldTOpts),
|
||||||
'$set_lf_opt'('$from_stream', TOpts, true )
|
'$process_lf_opts'(Opts,TOpts,Files,Call),
|
||||||
;
|
'$lf_default_opts'(1, LastOpt, TOpts),
|
||||||
'$check_files'(Files,load_files(Files,Opts))
|
'$lf_opt'(stream, TOpts, Stream),
|
||||||
),
|
( nonvar(Stream) ->
|
||||||
'$check_use_module'(Call,UseModule),
|
'$set_lf_opt'('$from_stream', TOpts, true )
|
||||||
'$lf_opt'('$use_module', TOpts, UseModule),
|
;
|
||||||
'$current_module'(M0),
|
'$check_files'(Files,load_files(Files,Opts))
|
||||||
( '$lf_opt'(autoload, TOpts, Autoload),
|
),
|
||||||
var(Autoload) ->
|
'$check_use_module'(Call,UseModule),
|
||||||
Autoload = OldAutoload
|
'$lf_opt'('$use_module', TOpts, UseModule),
|
||||||
;
|
'$current_module'(M0),
|
||||||
true
|
( '$lf_opt'(autoload, TOpts, Autoload),
|
||||||
),
|
var(Autoload) ->
|
||||||
% make sure we can run consult
|
Autoload = OldAutoload
|
||||||
'$init_consult',
|
;
|
||||||
'$lf'(Files, M0, Call, TOpts).
|
true
|
||||||
|
),
|
||||||
|
% make sure we can run consult
|
||||||
|
'$init_consult',
|
||||||
|
'$lf'(Files, M0, Call, TOpts).
|
||||||
|
|
||||||
'$check_files'(Files, Call) :-
|
'$check_files'(Files, Call) :-
|
||||||
var(Files), !,
|
var(Files), !,
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
'$pred_exists'(G, user).
|
'$pred_exists'(G, user).
|
||||||
% autoload
|
% autoload
|
||||||
'$get_undefined_predicates'(G, ImportingMod, G0, ExportingMod) :-
|
'$get_undefined_predicates'(G, ImportingMod, G0, ExportingMod) :-
|
||||||
recorded('$dialect',swi,_),
|
|
||||||
prolog_flag(autoload, true),
|
prolog_flag(autoload, true),
|
||||||
prolog_flag(unknown, OldUnk, fail),
|
prolog_flag(unknown, OldUnk, fail),
|
||||||
(
|
(
|
||||||
|
20
pl/init.yap
20
pl/init.yap
@ -33,17 +33,15 @@
|
|||||||
nb_setval('$chr_toplevel_show_store',false).
|
nb_setval('$chr_toplevel_show_store',false).
|
||||||
|
|
||||||
'$init_consult' :-
|
'$init_consult' :-
|
||||||
set_value('$open_expands_filename',true),
|
set_value('$open_expands_filename',true),
|
||||||
nb_setval('$assert_all',off),
|
nb_setval('$assert_all',off),
|
||||||
nb_setval('$if_level',0),
|
nb_setval('$if_level',0),
|
||||||
nb_setval('$endif',off),
|
nb_setval('$endif',off),
|
||||||
nb_setval('$initialization_goals',off),
|
nb_setval('$initialization_goals',off),
|
||||||
nb_setval('$included_file',[]),
|
nb_setval('$included_file',[]),
|
||||||
nb_setval('$loop_streams',[]),
|
nb_setval('$loop_streams',[]),
|
||||||
\+ '$undefined'('$init_preds',prolog),
|
\+ '$undefined'('$init_preds',prolog),
|
||||||
'$init_preds',
|
'$init_preds'.
|
||||||
fail.
|
|
||||||
'$init_consult'.
|
|
||||||
|
|
||||||
'$init_win_graphics' :-
|
'$init_win_graphics' :-
|
||||||
'$undefined'(window_title(_,_), system), !.
|
'$undefined'(window_title(_,_), system), !.
|
||||||
|
Reference in New Issue
Block a user