Skip to content

Commit 1a4fda3

Browse files
committed
interpreter should once again see variable arity code
1 parent dceed97 commit 1a4fda3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

prolog/metta_lang/metta_eval.pl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3217,12 +3217,12 @@
32173217
%eval_40(=,_RetType,_,_,['make-var'|Types],Var):- !, 'mx__1_0+_make-var'(Types,Var).
32183218
%eval_40(=,_RetType,_,_,['bless-var',Var|Types],Var):- !, 'mx__1_1+_bless-var'(Var,Types,Var).
32193219

3220-
transpiler_peek(Sym,Len,Type,Fn, N):-
3221-
transpiler_predicate_store(_Builtin, Sym, [Len], _, _, _, _),
3220+
transpiler_peek(Sym,Len,Type,Fn, Min):-
3221+
transpiler_predicate_nary_store(_Builtin, Sym, Min, _, _, _, _, _, _),
3222+
Len>=Min,between(0,Len,N),
32223223
if_t(var(Type),member(Type,['mx','mi','mc'])),
3223-
between(0,Len,N),succ(N,N1),
32243224
format(atom(Fn),'~w__1_~w+_~w',[Type,N,Sym]),
3225-
succ(N1,LenP1), current_predicate(Fn/LenP1),
3225+
succ(N,N1),succ(N1,LenP1), current_predicate(Fn/LenP1),
32263226
%\+ transpiler_predicate_store(_,Sym,[_],_,_,_,_),
32273227
ignore(ok_call_predicate(Sym,Len,Type)).
32283228

@@ -3265,7 +3265,8 @@
32653265
with_metta_ctx(_Eq,_RetType,_Depth,_Self,_MeTTaSrc,Goal):- Goal.
32663266

32673267
:- dynamic memoized_result/3.
3268-
memoize_tf(Goal) :-
3268+
memoize_tf(Goal) :- call(Goal).
3269+
memoize_tf_real(Goal) :-
32693270
term_variables(Goal, Vars),
32703271
copy_term(Goal, CopyGoal),numbervars(CopyGoal,0,_,[attvar(bind)]),
32713272
( memoized_result(CopyGoal, Vars, Result) ->

0 commit comments

Comments
 (0)