fix library_directory
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1723 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
93fd5bf9d5
commit
d9029c6c56
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
<h2>Yap-5.1.2:</h2>
|
<h2>Yap-5.1.2:</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li> FIXED: library_directory/1 was not being used.</li>
|
||||||
|
<li> FIXED: style_checker was failing on DCGs (obs from Miguel Filgueiras).</li>
|
||||||
<li> FIXED: +inf is a number (obs from Trevor Walker).</li>
|
<li> FIXED: +inf is a number (obs from Trevor Walker).</li>
|
||||||
<li> FIXED: if peek finds EOF get should not return an error (obs
|
<li> FIXED: if peek finds EOF get should not return an error (obs
|
||||||
from Miguel Filgueiras).</li>
|
from Miguel Filgueiras).</li>
|
||||||
|
@ -934,12 +934,17 @@ bootstrap(F) :-
|
|||||||
( '$open'(F,Mode,S,0) -> '$close'(S), set_value(fileerrors,V) ; set_value(fileerrors,V), fail).
|
( '$open'(F,Mode,S,0) -> '$close'(S), set_value(fileerrors,V) ; set_value(fileerrors,V), fail).
|
||||||
|
|
||||||
|
|
||||||
|
% This sequence must be followed:
|
||||||
|
% user and user_input are special;
|
||||||
|
% library(F) must check library_directories
|
||||||
|
% T(F) must check file_search_path
|
||||||
|
% all must try search in path
|
||||||
'$find_in_path'(user,user_input, _) :- !.
|
'$find_in_path'(user,user_input, _) :- !.
|
||||||
'$find_in_path'(user_input,user_input, _) :- !.
|
'$find_in_path'(user_input,user_input, _) :- !.
|
||||||
'$find_in_path'(library(File),NewFile, _) :-
|
'$find_in_path'(library(File),NewFile, _) :-
|
||||||
'$dir_separator'(D),
|
'$dir_separator'(D),
|
||||||
atom_codes(A,[D]),
|
atom_codes(A,[D]),
|
||||||
'$system_library_directories'(Dir),
|
( user:library_directory(Dir), '$do_not_creep' ; '$do_not_creep', fail),
|
||||||
'$extend_path'(Dir, A, File, NFile, Goal),
|
'$extend_path'(Dir, A, File, NFile, Goal),
|
||||||
'$search_in_path'(NFile, NewFile), !.
|
'$search_in_path'(NFile, NewFile), !.
|
||||||
'$find_in_path'(S,NewFile, _) :-
|
'$find_in_path'(S,NewFile, _) :-
|
||||||
|
@ -170,6 +170,13 @@ use_module(F,Is) :-
|
|||||||
'$load_files'(F, [if(not_loaded),imports(Is)], use_module(F,Is)).
|
'$load_files'(F, [if(not_loaded),imports(Is)], use_module(F,Is)).
|
||||||
|
|
||||||
use_module(M,F,Is) :-
|
use_module(M,F,Is) :-
|
||||||
|
'$use_module'(M,F,Is).
|
||||||
|
|
||||||
|
'$use_module'(M,F,Is) :- nonvar(M), !,
|
||||||
|
recorded('$module','$module'(F1,M,_),_),
|
||||||
|
'$load_files'(F1, [if(not_loaded),imports(Is)], use_module(M,F,Is)),
|
||||||
|
F1 = F.
|
||||||
|
'$use_module'(M,F,Is) :- nonvar(F),
|
||||||
'$load_files'(F, [if(not_loaded),imports(Is)], use_module(M,F,Is)).
|
'$load_files'(F, [if(not_loaded),imports(Is)], use_module(M,F,Is)).
|
||||||
|
|
||||||
'$csult'(V, _) :- var(V), !,
|
'$csult'(V, _) :- var(V), !,
|
||||||
@ -333,7 +340,8 @@ prolog_load_context(file, FileName) :-
|
|||||||
( IncFileName = [] ->
|
( IncFileName = [] ->
|
||||||
get_value('$consulting_file',FileName)
|
get_value('$consulting_file',FileName)
|
||||||
;
|
;
|
||||||
FileName = IncFileName
|
FileName
|
||||||
|
= IncFileName
|
||||||
).
|
).
|
||||||
prolog_load_context(module, X) :-
|
prolog_load_context(module, X) :-
|
||||||
'$current_module'(X).
|
'$current_module'(X).
|
||||||
|
@ -104,8 +104,8 @@
|
|||||||
'$load_files'(M:F, [if(not_loaded)],use_module(F)).
|
'$load_files'(M:F, [if(not_loaded)],use_module(F)).
|
||||||
'$exec_directive'(use_module(F,Is), _, M) :-
|
'$exec_directive'(use_module(F,Is), _, M) :-
|
||||||
'$load_files'(M:F, [if(not_loaded),imports(Is)],use_module(F,Is)).
|
'$load_files'(M:F, [if(not_loaded),imports(Is)],use_module(F,Is)).
|
||||||
'$exec_directive'(use_module(_Mod,F,Is), _, M) :-
|
'$exec_directive'(use_module(Mod,F,Is), _, M) :-
|
||||||
'$load_files'(F, [if(not_loaded),imports(Is)],use_module(M,F,Is)).
|
'$use_module'(Mod,F,Is).
|
||||||
'$exec_directive'(block(BlockSpec), _, _) :-
|
'$exec_directive'(block(BlockSpec), _, _) :-
|
||||||
'$block'(BlockSpec).
|
'$block'(BlockSpec).
|
||||||
'$exec_directive'(wait(BlockSpec), _, _) :-
|
'$exec_directive'(wait(BlockSpec), _, _) :-
|
||||||
|
10
pl/init.yap
10
pl/init.yap
@ -94,6 +94,13 @@ system_mode(verbose,off) :- set_value('$verbose',off).
|
|||||||
|
|
||||||
:- default_sequential(off).
|
:- default_sequential(off).
|
||||||
|
|
||||||
|
:- multifile user:library_directory/1.
|
||||||
|
|
||||||
|
:- dynamic user:library_directory/1.
|
||||||
|
|
||||||
|
user:library_directory(D) :-
|
||||||
|
prolog:'$system_library_directories'(D).
|
||||||
|
|
||||||
%
|
%
|
||||||
% cleanup ensure loaded and recover some data-base space.
|
% cleanup ensure loaded and recover some data-base space.
|
||||||
%
|
%
|
||||||
@ -131,7 +138,4 @@ file_search_path(library, Dir) :-
|
|||||||
file_search_path(system, Dir) :-
|
file_search_path(system, Dir) :-
|
||||||
prolog_flag(host_type, Dir).
|
prolog_flag(host_type, Dir).
|
||||||
|
|
||||||
:- multifile library_directory/1.
|
|
||||||
|
|
||||||
:- dynamic library_directory/1.
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user