I want to construct a function that plus equations. For example:
SomaEqns[eq1,eq2,...] == eq1 + eq2 + ...
It's possible do that with recursive way? Using less then possible the functions of Mathematica.
I know Mathematica already can do that. It's just for exercise.
Fold
helpful for a functional approach that circumvents possible problems with recursion limits $\endgroup$Thread
,Fold
, etc. One way to do thisf[{eqn_}] := eqn
f[eqn_List] := First[eqn] + f[Rest[eqn]]
f[{eq1, eq2, eq3, eq4}] gives eq1 + eq2 + eq3 + eq4 $\endgroup$SomaEqns = Plus
? $\endgroup$List
$\endgroup$