Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

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?