Anytime the function cannot be evaluated without a numerical value
f[x_, n_: 50] := IdentityMatrix[n].Append[Range[n - 1], x];
Bob Hanlon
---- Sam Takoy <sam.takoy at yahoo.com> wrote:
=============
Hi,
Have read everything I could find regarding delayed assignment, I'm
still not quite sure when to use which.
For example, in the definition
f[x_] = IdentityMatrix[50].Append[Range[1, 49], x];
could there ever be any reason to use := ?
It seems that using := will condemn the function to repeated extra
work every time its called. So could there be a situation where the use
of ":=" for the above function is recommended?
Many thanks in advance,
Sam