MathGroup Archive 2007

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

Search the Archive

Re: Function as an argument


On 25 Mai, 12:22, "dXdYdZdu" <dxdyd... at gmail.com> wrote:
> 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?

Hello

MyFunction[(2 + #^3) &]

Best Regards
Norbert Marxer



  • Prev by Date: Mathematica V6. ComplexMap
  • Next by Date: Re: Function as an argument
  • Previous by thread: Re: Function as an argument
  • Next by thread: Re: Function as an argument