Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: := vs = in some function definitions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg113631] Re: := vs = in some function definitions
  • From: Sam Takoy <sam.takoy at yahoo.com>
  • Date: Fri, 5 Nov 2010 05:12:41 -0500 (EST)
  • References: <i9m7u7$j41$1@smc.vnet.net> <i9r80e$hp5$1@smc.vnet.net> <ia67b0$sqp$1@smc.vnet.net> <ia8qnq$1tp$1@smc.vnet.net>

Hi,

I'm just following up on this topic, because it's rising up to cause 
trouble.

I'm working on an elaborate project with elements of differential 
geometry. So what I have is some global elements describing the geometry 
and some functions that represent differential operators. I don't know 
what other details to mention. There are many details, but I'm not sure 
which ones are relevant and I have not been able to construct a 
self-contained example.

I try to use "=" rather than ":=" so that as much as possible is 
calculated once. For example, I use "curvature[x_, y_]=" rather than 
"curvature[x_, y_]:=" because I want it to be calculated once and for 
all.  The "curvature" function uses some of the global elements 
describing the surface.

Then I have a differential operator ddt, defined like this:

ddt0[tensor_][x_, y_] := yadda Derivative[1, 0][tensor][x, y] yadda

and when I use "=" in place of ":=" the code produces the wrong answer.

Why could this be? I have made sure that variables tensor,x,y are not 
defined anywhere in the code, but beyond that I can't figure out from 
the previous responses what might be causing different action to take place.

Many thanks in advance for giving this long post your attention!

Thank you,

Sam


  • Prev by Date: Re: EventHandler vs ControllerState
  • Next by Date: Re: Graphics3D default lighting?
  • Previous by thread: Re: Graphics: How to get values corresponding to
  • Next by thread: Re: Numerical solution of the heat equation on a disk