diff --git a/library/autoloader.yap b/library/autoloader.yap index 341005599..69e9e3298 100644 --- a/library/autoloader.yap +++ b/library/autoloader.yap @@ -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), !. diff --git a/library/dialect/swi.yap b/library/dialect/swi.yap index b1c321df7..b53bc2ac3 100644 --- a/library/dialect/swi.yap +++ b/library/dialect/swi.yap @@ -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).