MathGroup Archive 2007

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

Search the Archive

Function as an argument

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76625] Function as an argument
  • From: "dXdYdZdu" <dxdydzdu at gmail.com>
  • Date: Fri, 25 May 2007 06:20:57 -0400 (EDT)

Hi, I have problem. I want to do something like this:

ss[x_] = 2 + x^3 ;
MyFunction[expression_] := Module[{}, Return[expression[2]]]
Calling MyFunction[ss] will produce 10 and this is working case.

but this is what I can not do:

MyFunction[2 + x^3]

Is there a way to make this to work as well?







  • Prev by Date: Re: Re: Compatibility woes
  • Next by Date: Running math in shell with notebook as output
  • Previous by thread: Re: Style sheet primer
  • Next by thread: Re: Function as an argument