diff --git a/C/load_foreign.c b/C/load_foreign.c index b970181c0..1ab27d057 100755 --- a/C/load_foreign.c +++ b/C/load_foreign.c @@ -242,9 +242,10 @@ Yap_ReOpenLoadForeign(void) { ForeignObj *f_code = ForeignCodeLoaded; Term OldModule = CurrentModule; - YapInitProc InitProc = NULL; while (f_code != NULL) { + YapInitProc InitProc = NULL; + CurrentModule = f_code->module; if(Yap_ReLoadForeign(f_code->objs,f_code->libs,f_code->f,&InitProc)==LOAD_SUCCEEDED) { if (InitProc) diff --git a/docs/yap.tex b/docs/yap.tex index f8a6d838e..7de3b0c48 100644 --- a/docs/yap.tex +++ b/docs/yap.tex @@ -9578,10 +9578,9 @@ plus_if_pos(X,Y,Z) :- Y > 0, Z is X + Y. vars(X, Y, [X|Y]) :- var(X), !. vars(_, Y, Y). trans(TermIn, TermOut) :- - (compound(TermIn) ; atom(TermIn)), + nonvar(TermIn), TermIn =.. [p|Args], - TermOut =..[q|Args], - !. + TermOut =..[q|Args], !. trans(X,X). %success @@ -9592,8 +9591,8 @@ selectlist(<(0), [-1,0,1], [1]). convlist(plus_if_pos(1), [-1,0,1], [2]). sumlist(plus, [1,2,3,4], 1, 11). mapargs(number_atom,s(1,2,3), s('1','2','3')). -sumargs(vars, s(1,X,2,Y), [], [Y,X]). -mapnodes(trans, p(a,p(b,a),c), q(a,q(b,a),c)). +sumargs(vars, s(1,X,2,Y), [], [Y,X]).m +apnodes(trans, p(a,p(b,a),c), q(a,q(b,a),c)). checknodes(\==(T), p(X,p(Y,X),Z)). sumnodes(vars, [c(X), p(X,Y), q(Y)], [], [Y,Y,X,X]). % another one diff --git a/library/maplist.yap b/library/maplist.yap index f0de33566..4ba4a08af 100644 --- a/library/maplist.yap +++ b/library/maplist.yap @@ -206,7 +206,7 @@ sumargs_args(Pred, Term, A1, A3, N) :- sumargs_args(Pred, Term, A2, A3, N1). mapnodes(Pred, TermIn, TermOut) :- - (atomic(TermIn); var(TermOut)), !, + (atomic(TermIn); var(TermIn)), !, call(Pred, TermIn, TermOut). mapnodes(Pred, TermIn, TermOut) :- call(Pred, TermIn, Temp), diff --git a/packages/clib/memfile.pl b/packages/clib/memfile.pl index b121bdd4a..57c483411 100644 --- a/packages/clib/memfile.pl +++ b/packages/clib/memfile.pl @@ -43,6 +43,8 @@ utf8_position_memory_file/3 % +Handle, -Here, -Size ]). +:- expects_dialect(swi). + :- use_module(library(shlib)). :- use_foreign_library(foreign(memfile)).