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
|
||||
YAP_FLAG(ARCH_FLAG, "arch", false, isatom, YAP_ARCH, NULL), /**<
|
||||
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(ARITHMETIC_EXCEPTIONS_FLAG, "arithmetic_exceptions", true,
|
||||
booleanFlag, "true", NULL),
|
||||
/**< `arithmetic_exceptions`
|
||||
/**<
|
||||
|
||||
Read-write flag telling whether arithmetic exceptions generate
|
||||
Prolog exceptions. If enabled:
|
||||
@ -97,7 +96,7 @@ opportunity. Initial value is 10,000. May be changed. A value of 0
|
||||
ProbLog.
|
||||
*/
|
||||
YAP_FLAG(BACK_QUOTES_FLAG, "back_quotes", true, isatom, "true", bqs),
|
||||
/**>
|
||||
/**<
|
||||
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,
|
||||
`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 ).
|
||||
|
||||
'$load_files'(Files, Opts, Call) :-
|
||||
( '__NB_getval__'('$lf_status', OldTOpts, fail), nonvar(OldTOpts) - '$lf_opt'(autoload, OldTOpts, OldAutoload)
|
||||
;
|
||||
'$lf_option'(last_opt, LastOpt),
|
||||
functor( OldTOpts, opt, LastOpt ),
|
||||
'$lf_opt'('$context_module', OldTOpts, user)
|
||||
),
|
||||
'$lf_option'(last_opt, LastOpt),
|
||||
functor( TOpts, opt, LastOpt ),
|
||||
( source_location(ParentF, Line) -> true ; ParentF = user_input, Line = -1 ),
|
||||
'$lf_opt'('$location', TOpts, ParentF:Line),
|
||||
'$lf_opt'('$files', TOpts, Files),
|
||||
'$lf_opt'('$call', TOpts, Call),
|
||||
'$lf_opt'('$options', TOpts, Opts),
|
||||
'$lf_opt'('$parent_topts', TOpts, OldTOpts),
|
||||
'$process_lf_opts'(Opts,TOpts,Files,Call),
|
||||
'$lf_default_opts'(1, LastOpt, TOpts),
|
||||
'$lf_opt'(stream, TOpts, Stream),
|
||||
( nonvar(Stream) ->
|
||||
'$set_lf_opt'('$from_stream', TOpts, true )
|
||||
;
|
||||
'$check_files'(Files,load_files(Files,Opts))
|
||||
),
|
||||
'$check_use_module'(Call,UseModule),
|
||||
'$lf_opt'('$use_module', TOpts, UseModule),
|
||||
'$current_module'(M0),
|
||||
( '$lf_opt'(autoload, TOpts, Autoload),
|
||||
var(Autoload) ->
|
||||
Autoload = OldAutoload
|
||||
;
|
||||
true
|
||||
),
|
||||
% make sure we can run consult
|
||||
'$init_consult',
|
||||
'$lf'(Files, M0, Call, TOpts).
|
||||
'$lf_option'(last_opt, LastOpt),
|
||||
( '__NB_getval__'('$lf_status', OldTOpts, fail),
|
||||
nonvar(OldTOpts)
|
||||
->
|
||||
'$lf_opt'(autoload, OldTOpts, OldAutoload)
|
||||
;
|
||||
current_prolog_flag(autoload, OldAutoload),
|
||||
functor( OldTOpts, opt, LastOpt ),
|
||||
'$lf_opt'(autoload, OldTOpts, OldAutoload),
|
||||
'$lf_opt'('$context_module', OldTOpts, user)
|
||||
),
|
||||
functor( TOpts, opt, LastOpt ),
|
||||
( source_location(ParentF, Line) -> true ; ParentF = user_input, Line = -1 ),
|
||||
'$lf_opt'('$location', TOpts, ParentF:Line),
|
||||
'$lf_opt'('$files', TOpts, Files),
|
||||
'$lf_opt'('$call', TOpts, Call),
|
||||
'$lf_opt'('$options', TOpts, Opts),
|
||||
'$lf_opt'('$parent_topts', TOpts, OldTOpts),
|
||||
'$process_lf_opts'(Opts,TOpts,Files,Call),
|
||||
'$lf_default_opts'(1, LastOpt, TOpts),
|
||||
'$lf_opt'(stream, TOpts, Stream),
|
||||
( nonvar(Stream) ->
|
||||
'$set_lf_opt'('$from_stream', TOpts, true )
|
||||
;
|
||||
'$check_files'(Files,load_files(Files,Opts))
|
||||
),
|
||||
'$check_use_module'(Call,UseModule),
|
||||
'$lf_opt'('$use_module', TOpts, UseModule),
|
||||
'$current_module'(M0),
|
||||
( '$lf_opt'(autoload, TOpts, Autoload),
|
||||
var(Autoload) ->
|
||||
Autoload = OldAutoload
|
||||
;
|
||||
true
|
||||
),
|
||||
% make sure we can run consult
|
||||
'$init_consult',
|
||||
'$lf'(Files, M0, Call, TOpts).
|
||||
|
||||
'$check_files'(Files, Call) :-
|
||||
var(Files), !,
|
||||
|
@ -22,7 +22,6 @@
|
||||
'$pred_exists'(G, user).
|
||||
% autoload
|
||||
'$get_undefined_predicates'(G, ImportingMod, G0, ExportingMod) :-
|
||||
recorded('$dialect',swi,_),
|
||||
prolog_flag(autoload, true),
|
||||
prolog_flag(unknown, OldUnk, fail),
|
||||
(
|
||||
|
20
pl/init.yap
20
pl/init.yap
@ -33,17 +33,15 @@
|
||||
nb_setval('$chr_toplevel_show_store',false).
|
||||
|
||||
'$init_consult' :-
|
||||
set_value('$open_expands_filename',true),
|
||||
nb_setval('$assert_all',off),
|
||||
nb_setval('$if_level',0),
|
||||
nb_setval('$endif',off),
|
||||
nb_setval('$initialization_goals',off),
|
||||
nb_setval('$included_file',[]),
|
||||
nb_setval('$loop_streams',[]),
|
||||
\+ '$undefined'('$init_preds',prolog),
|
||||
'$init_preds',
|
||||
fail.
|
||||
'$init_consult'.
|
||||
set_value('$open_expands_filename',true),
|
||||
nb_setval('$assert_all',off),
|
||||
nb_setval('$if_level',0),
|
||||
nb_setval('$endif',off),
|
||||
nb_setval('$initialization_goals',off),
|
||||
nb_setval('$included_file',[]),
|
||||
nb_setval('$loop_streams',[]),
|
||||
\+ '$undefined'('$init_preds',prolog),
|
||||
'$init_preds'.
|
||||
|
||||
'$init_win_graphics' :-
|
||||
'$undefined'(window_title(_,_), system), !.
|
||||
|
Reference in New Issue
Block a user