Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

:= vs = in some function definitions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg113234] := vs = in some function definitions
  • From: Sam Takoy <sam.takoy at yahoo.com>
  • Date: Wed, 20 Oct 2010 04:06:37 -0400 (EDT)

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


  • Prev by Date: Table of tables
  • Next by Date: Re: Release dates for Mathematica versions
  • Previous by thread: Re: Table of tables
  • Next by thread: Re: := vs = in some function definitions