Re: := vs = in some function definitions
- To: mathgroup at smc.vnet.net
- Subject: [mg113257] Re: := vs = in some function definitions
- From: Pierre Albarede <pa.news at free.fr>
- Date: Thu, 21 Oct 2010 07:00:47 -0400 (EDT)
- References: <i9m7u7$j41$1@smc.vnet.net>
On Oct 20, 10:06 am, Sam Takoy <sam.ta... at yahoo.com> wrote: > 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 := ? If x has a value when you evaluate your definition, il will be used in the definition, which is not usually what you want. For example, try : x = 4 Clear@f; f@x_ = 2 x ?f