code source should never had the head in the module
This commit is contained in:
parent
9b89e6fd92
commit
f23b8b5418
11
pl/meta.yap
11
pl/meta.yap
@ -209,7 +209,7 @@ meta_predicate declaration
|
||||
% A6: head module (this is the one used in compiling and accessing).
|
||||
%
|
||||
%
|
||||
%'$expand_goals'(V,NG,NG,HM,SM,BM,HVars):-l writeln(V), fail.
|
||||
%'$expand_goals'(V,NG,NG,HM,SM,BM,HVars):- writeln(V), fail.
|
||||
'$expand_goals'(V,NG,NGO,HM,SM,BM,HVars-H) :-
|
||||
var(V),
|
||||
!,
|
||||
@ -328,12 +328,14 @@ meta_predicate declaration
|
||||
!.
|
||||
'$import_expansion'(MG, MG).
|
||||
|
||||
'$meta_expansion'(GM:G, BM, HVars, GM:GF) :-
|
||||
'$meta_expansion'(GMG, BM, HVars, GM:GF) :-
|
||||
'$yap_strip_module'(GMG, GM, G ),
|
||||
functor(G, F, Arity ),
|
||||
'$meta_predicate'(F, GM, Arity, PredDef),
|
||||
!,
|
||||
'$meta_expand'(G, PredDef, BM, HVars, GF).
|
||||
'$meta_expansion'(GM:G, _BM, _HVars, GM:G).
|
||||
'$meta_expansion'(GMG, _BM, _HVars, GM:G) :-
|
||||
'$yap_strip_module'(GMG, GM, G ).
|
||||
|
||||
/**
|
||||
* @brief Perform meta-variable and user expansion on a goal _G_
|
||||
@ -398,7 +400,7 @@ o:p(B) :- n:g, X is 2+3, call(B).
|
||||
'$build_up'(HM, NH, SM, true, NH, true, NH) :- HM == SM, !.
|
||||
'$build_up'(HM, NH, _SM, true, HM:NH, true, HM:NH) :- !.
|
||||
'$build_up'(HM, NH, SM, B1, (NH :- B1), BO, ( NH :- BO)) :- HM == SM, !.
|
||||
'$build_up'(HM, NH, _SM, B1, (HM:NH :- B1), BO, ( HM:NH :- BO)) :- !.
|
||||
'$build_up'(HM, NH, _SM, B1, (NH :- B1), BO, ( HM:NH :- BO)) :- !.
|
||||
|
||||
'$expand_clause_body'(true, _NH1, _HM1, _SM, _M, true, true ) :- !.
|
||||
'$expand_clause_body'(B, H, HM, SM, M, B1, BO ) :-
|
||||
@ -463,6 +465,7 @@ o:p(B) :- n:g, X is 2+3, call(B).
|
||||
'$build_up'(HM, NH, SM0, B1, Cl1, BO, ClO).
|
||||
|
||||
|
||||
|
||||
expand_goal(Input, Output) :-
|
||||
'$expand_meta_call'(Input, [], Output ).
|
||||
|
||||
|
Reference in New Issue
Block a user