My question is about assigning the resulting expression after evaluation of a function.
So what I want:
FOCf[x, y] := D[f[x, y], x]
such it immediately evaluates the right hand side, making it a conditional expression.
How I do it now.
I first shift-enter: D[f[x, y], x]. Then, I manually copy the resulting output to the right end of FOCf[x, y] :=.
Is there a better way to do this? I already tried using Evaluate, but that did not seem to work.
fdefined prior to definingFOCf? – Edmund Feb 28 '19 at 22:20=(without the colon) to first evaluate the r.h.s. and then assign the result to the l.h.s. symbol. Btw., normally you indicate variables with an underscore on the left side, e.g.FOCf[x_, y_]. – JEM_Mosig Feb 28 '19 at 22:23FOCf[x, y] := Evaluate @ D[f[x, y], x]– m_goldberg Mar 01 '19 at 07:07=fails when parameter patterns are involved) - although /nothing here explains at all whyEvaluategets treated differently thanDwith respect to order of evaluation/! – BadZen Mar 20 '22 at 18:28