Why does the function EER[1,2] have a different value than the function EERR[1,2]? Isn't the entry Kx[x, y] equivalent to this Kx[Sequence @@ var]? How to write EERR[Sequence @@ varr] so that it produces the same number as this EER[x_, y_]?
ClearAll["Global`*"]
Kx[x_, y_] := x^2 + y;
var = {x, y};
varr = Pattern[#, Blank[]] & /@ var;
Px[x1_, y1_] := x1^3 - y1;
var1 = {x1, y1};
EER[x_, y_] := Kx[x, y] + Px[x, y];
EER[1, 2]
(*2*)
EERR[Sequence @@ varr] := Kx[Sequence @@ var] + Px[Sequence @@ var];
EERR[1, 2]
(*x^2 + x^3*)
Evaluatethe RHS of EERR (in the definition). $\endgroup$EERR[Sequence @@ varr] := Evaluate[Kx[Sequence @@ var] + Px[Sequence @@ var]];$\endgroup$