The =
sign in Definition[f]
doesn't mean much: it's just cosmetic. You should look at the DownValues
of f
. As you can see, all DownValues
are delayed rules:
In[13]:= DownValues[f]
Out[13]= {HoldPattern[f[-1, 0, 0]] :> 81,
HoldPattern[f[-1, 0, 2]] :> 121, HoldPattern[f[-1, 1, 0]] :> 100,
HoldPattern[f[-1, 1, 2]] :> 144, HoldPattern[f[-1, 2, 0]] :> 121,
HoldPattern[f[-1, 2, 2]] :> 169, HoldPattern[f[0, 0, 0]] :> 100,
HoldPattern[f[0, 0, 2]] :> 144, HoldPattern[f[0, 1, 0]] :> 121,
HoldPattern[f[0, 1, 2]] :> 169, HoldPattern[f[0, 2, 0]] :> 144,
HoldPattern[f[0, 2, 2]] :> 196, HoldPattern[f[1, 0, 0]] :> 121,
HoldPattern[f[1, 0, 2]] :> 169, HoldPattern[f[1, 1, 0]] :> 144,
HoldPattern[f[1, 1, 2]] :> 196, HoldPattern[f[1, 2, 0]] :> 169,
HoldPattern[f[1, 2, 2]] :> 225}
Furthermore: as a rule of thumb, I would say there's no difference between Set
and SetDelayed[..., Evaluated[...]]
. You can replace your function definition with f[x, y, z] = Module[{tmp1}, tmp1 = tmp; tmp1^2]
and you'll get the exact same result.