diff --git a/.Attic/metta_lang/metta_eval.pl b/.Attic/metta_lang/metta_eval.pl index 92b112f4bc9..8b616c83b56 100755 --- a/.Attic/metta_lang/metta_eval.pl +++ b/.Attic/metta_lang/metta_eval.pl @@ -823,9 +823,11 @@ %;; superpose-bind because `superpose` doesnt guarentee shared bindings % @TODO need to keep bindings eval_20(Eq,RetType,Depth,Self,['superpose-bind',List],Res):- !, - member(E,List), + re_member(Res,E,List), eval_ret(Eq,RetType,Depth,Self,E,Res). +re_member(Res,E,List):- term_variables(Res+E+List,TV),copy_term(TV,Copy), + member(E,List),TV=Copy. %[collapse,[1,2,3]] eval_20(Eq,RetType,Depth,Self,['collapse',List],Res):-!, @@ -1635,12 +1637,12 @@ fromNumber(N,RetVal), check_returnval(Eq,RetType,RetVal). */ -eval_20(Eq,RetType,Depth,Self,['dedup!',Eval],RetVal):- !, + +eval_20(Eq,RetType,Depth,Self,['unique',Eval],RetVal):- !, term_variables(Eval+RetVal,Vars), - no_repeats_var(YY),!, + no_repeats_var(YY), eval_20(Eq,RetType,Depth,Self,Eval,RetVal),YY=Vars. - eval_20(Eq,RetType,Depth,Self,PredDecl,Res):- Do_more_defs = do_more_defs(true), clause(eval_21(Eq,RetType,Depth,Self,PredDecl,Res),Body),