support search for predicates
This commit is contained in:
parent
84e4162435
commit
197a943cd3
@ -10,7 +10,7 @@ make_library_index :-
|
||||
scan_swi_exports.
|
||||
|
||||
scan_library_exports :-
|
||||
% init table file.
|
||||
% init table file.
|
||||
open('INDEX.pl', write, W),
|
||||
close(W),
|
||||
scan_exports('../GPL/aggregate', library(aggregate)),
|
||||
@ -109,9 +109,15 @@ publish_export(F, A, W, Path, Module) :-
|
||||
portray_clause(W, index(F, A, Module, Path)).
|
||||
|
||||
find_predicate(G,ExportingModI) :-
|
||||
nonvar(G), !,
|
||||
functor(G, Name, Arity),
|
||||
index(Name,Arity,ExportingModI,File),
|
||||
ensure_file_loaded(File).
|
||||
find_predicate(G,ExportingModI) :-
|
||||
var(G),
|
||||
index(Name,Arity,ExportingModI,File),
|
||||
functor(G, Name, Arity),
|
||||
ensure_file_loaded(File).
|
||||
|
||||
ensure_file_loaded(File) :-
|
||||
loaded(File), !.
|
||||
|
@ -326,7 +326,7 @@ require(F) :-
|
||||
required_predicates(F, Mod).
|
||||
|
||||
required_predicates([], _).
|
||||
required_predicates(F.Fs, M) :-
|
||||
required_predicates([F|Fs], M) :-
|
||||
required_predicate(F, M),
|
||||
required_predicates(Fs, M).
|
||||
|
||||
|
Reference in New Issue
Block a user