MathGroup Archive 2006

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

Search the Archive

Question about UpSet vs SetDelayed

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63751] Question about UpSet vs SetDelayed
  • From: "Andy Somogyi" <andy_somogyi at hotmail.com>
  • Date: Fri, 13 Jan 2006 04:48:33 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello

I'm trying to work out what how exactly := and ^= differ and what are uses 
for ^=.

Say I want to have some 'properties' of a symbol 's', I can do:

someFunc[s] := True;

and I can also do:

someOtherFunc[s] ^= True;

When I execute either, someFunc[s] and someOtherFunc[s], they both obviously 
return True, and when I apply them to some other symbol or value for which 
they are not defined for, they both obviously return the expected result:

In[20]:= someFunc[SomethingOtherThanS]
Out[20]:= someFunc[SomehingOtherThanS]

and


In[20]:= someOtherFunc[SomethingOtherThanS]
Out[20]:= someOtherFunc[SomehingOtherThanS]

So, both := and ^= aperently behave very similarly, so my question how 
exactly do they differ and in what cases should I use one over the other?

thanks



  • Prev by Date: Re: problem with numerical values in Solve/NSolve
  • Next by Date: Recommended learning exercises for beginners?
  • Previous by thread: Re: Pattern Matching: Keep those summands not depending on x
  • Next by thread: Re: Question about UpSet vs SetDelayed