From b46dd8d392224776ac9b5610b466e16c3b7a0a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Mon, 25 Nov 2013 23:08:35 +0100 Subject: [PATCH] speed-up imports --- pl/modules.yap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pl/modules.yap b/pl/modules.yap index b28e89ce1..1788bb0dd 100644 --- a/pl/modules.yap +++ b/pl/modules.yap @@ -105,7 +105,7 @@ module(N) :- % redefining a previously-defined file, no problem. '$add_preexisting_module_on_file'(F, F, Mod, Exports, R) :- !, erase(R), - ( recorded('$import','$import'(Mod,_,_,_,_,_),R), erase(R), fail; true), + ( recorded('$import','$import'(Mod,M,_,_,N,A),R), erase(R), abolish(M:N/A), fail; true), ( source_location(_, Line) -> true ; Line = 0 ), recorda('$module','$module'(F,Mod,Exports, Line),_). '$add_preexisting_module_on_file'(F,F0,Mod,Exports,R) :- @@ -622,7 +622,7 @@ abolish_module(Mod) :- recorded('$module','$module'(_,Mod,_,_),R), erase(R), fail. abolish_module(Mod) :- - recorded('$import','$import'(Mod,_,_,_,_,_),R), erase(R), + recorded('$import','$import'(Mod,M,_,_,N,A),R), erase(R), abolish(M:N/A), fail. abolish_module(Mod) :- '$current_predicate'(Mod,Na,Ar), @@ -806,9 +806,9 @@ export_list(Module, List) :- G1=..[N1|Args], ( '$check_import'(M0,ContextMod,N1,K) -> ( ContextMod = user -> - ( recordzifnot('$import','$import'(M0,user,G0,G1,N1,K),_) -> true ; true) + ( recordzifnot('$import','$import'(M0,user,G0,G1,N1,K),_) -> Cl = (G1:- M0:G0), '$compile'(Cl, 0, Cl, user) ; true ) ; - ( recordaifnot('$import','$import'(M0,ContextMod,G0,G1,N1,K),_) -> true ; true ) + ( recordaifnot('$import','$import'(M0,ContextMod,G0,G1,N1,K),_) -> Cl = (G1:- M0:G0), '$compile'(Cl, 0, Cl, ContextMod) ; true ) ) ; true