MathGroup Archive 2004

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

Search the Archive

Re: Defining a function in module problem?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46003] Re: Defining a function in module problem?
  • From: "Bo Le" <bole79 at email.si>
  • Date: Mon, 2 Feb 2004 05:20:51 -0500 (EST)
  • References: <bvhpvs$8dh$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

May it be, that Evaluates should get a general expression - a function to evaluate it? You set a symbol z/3 to a symbol g, whereas the single parameter z in Function construct is not this same symbol z, but is treated as a local variable.


Correction:

g[z_]:=z/3;
f=Function[z,Evaluate[g[z]]];



Bye,

Borut



"jose flanigan" <jflanigan at netzero.net> wrote in message news:bvhpvs$8dh$1 at smc.vnet.net...
> why does this
>
> a[x_] := Module[{f, g}, g = z/3; f = Function[z, Evaluate[g]]; f[x]]
>
> produce
>
> a[1] = z/3
>
> instead of
>
> a[1]=1/3
>
> I don't understand the philosophy here.
>
> thanks in advance.
>


  • Prev by Date: Re: Defining a function in module problem?
  • Next by Date: Re: Defining a function in module problem?
  • Previous by thread: Re: Defining a function in module problem?
  • Next by thread: Re: Defining a function in module problem?