MathGroup Archive 2004

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

Search the Archive

Defining a function in module problem?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45975] Defining a function in module problem?
  • From: jflanigan at netzero.net (jose flanigan)
  • Date: Sat, 31 Jan 2004 05:20:40 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

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: Question: formatting text, sections
  • Next by Date: Re: Difference of numbers in the list
  • Previous by thread: Re: one liner for a function?
  • Next by thread: How to make the Mathematica Kernel return DisplayPackets?