fix [a:file] and friends.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@192 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
8b0b742bd2
commit
b5882844b8
@ -849,6 +849,11 @@ break :- '$get_value'('$break',BL), NBL is BL+1,
|
||||
'$consult'([F|Fs]) :- !,
|
||||
'$consult'(F),
|
||||
'$consult'(Fs).
|
||||
'$consult'(M:X) :- atom(M), !,
|
||||
'$current_module'(M0),
|
||||
'$change_module'(M),
|
||||
'$consult'(X),
|
||||
'$change_module'(M0).
|
||||
'$consult'(X) :- atom(X), !,
|
||||
'$find_in_path'(X,Y),
|
||||
( '$open'(Y,'$csult',Stream,0), !,
|
||||
|
@ -24,7 +24,7 @@ ensure_loaded(V) :-
|
||||
'$ensure_loaded'([F|Fs]) :- !,
|
||||
'$ensure_loaded'(F),
|
||||
'$ensure_loaded'(Fs).
|
||||
'$ensure_loaded'(M:X) :- !,
|
||||
'$ensure_loaded'(M:X) :- atom(M), !,
|
||||
'$current_module'(M0),
|
||||
'$change_module'(M),
|
||||
'$ensure_loaded'(X),
|
||||
@ -97,6 +97,11 @@ reconsult(Fs) :-
|
||||
'$reconsult'(V) :- var(V), !,
|
||||
throw(error(instantiation_error,reconsult(V))).
|
||||
'$reconsult'([]) :- !.
|
||||
'$reconsult'(M:X) :- atom(M), !,
|
||||
'$current_module'(M0),
|
||||
'$change_module'(M),
|
||||
'$reconsult'(X),
|
||||
'$change_module'(M0).
|
||||
'$reconsult'([F|Fs]) :- !,
|
||||
'$reconsult'(F),
|
||||
'$reconsult'(Fs).
|
||||
@ -108,11 +113,6 @@ reconsult(Fs) :-
|
||||
;
|
||||
throw(error(permission_error(input,stream,X),reconsult(X)))
|
||||
).
|
||||
'$reconsult'(M:X) :- !,
|
||||
'$current_module'(M0),
|
||||
'$change_module'(M),
|
||||
'$reconsult'(X),
|
||||
'$change_module'(M0).
|
||||
'$reconsult'(library(X)) :- !,
|
||||
'$find_in_path'(library(X),Y),
|
||||
( open(Y,'$csult',Stream), !,
|
||||
@ -283,7 +283,7 @@ prolog_load_context(term_position, Position) :-
|
||||
|
||||
|
||||
'$loaded'(Stream) :-
|
||||
'$file_name'(Stream,F),
|
||||
'$file_name'(Stream,F), %
|
||||
'$recorded'('$loaded','$loaded'(F,Age),R), !,
|
||||
'$file_age'(F,CurrentAge),
|
||||
((CurrentAge = Age ; Age = -1) -> true; erase(R), fail).
|
||||
|
@ -68,7 +68,7 @@
|
||||
'$exec_directive'(set_prolog_flag(F,V), _, _) :-
|
||||
set_prolog_flag(F,V).
|
||||
'$exec_directive'(ensure_loaded(F), _, M) :-
|
||||
'$ensure_loaded'(F, M).
|
||||
'$ensure_loaded'(F).
|
||||
'$exec_directive'(char_conversion(IN,OUT), _, _) :-
|
||||
char_conversion(IN,OUT).
|
||||
'$exec_directive'(public(P), _, M) :-
|
||||
|
@ -25,6 +25,11 @@ use_module([]) :- !.
|
||||
use_module([A|B]) :- !,
|
||||
use_module(A),
|
||||
use_module(B).
|
||||
use_module(M:F) :- atom(M), !,
|
||||
'$current_module'(M0),
|
||||
'$change_module'(M),
|
||||
use_module(F),
|
||||
'$change_module'(M0).
|
||||
use_module(File) :-
|
||||
'$find_in_path'(File,X),
|
||||
( '$recorded'('$module','$module'(_,X,Publics),_) ->
|
||||
@ -37,6 +42,11 @@ use_module(File,Imports) :- var(File), !,
|
||||
throw(error(instantiation_error,use_module(File,Imports))).
|
||||
use_module(File,Imports) :- var(Imports), !,
|
||||
throw(error(instantiation_error,use_module(File,Imports))).
|
||||
use_module(M:F, Imports) :- atom(M), !,
|
||||
'$current_module'(M0),
|
||||
'$change_module'(M),
|
||||
use_module(F, Imports),
|
||||
'$change_module'(M0).
|
||||
use_module(File,Imports) :-
|
||||
atom(File), !,
|
||||
'$current_module'(M),
|
||||
|
Reference in New Issue
Block a user