Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Function as an argument

  • To: mathgroup at
  • Subject: [mg76725] Re: Function as an argument
  • From: Albert <awnl at>
  • Date: Sat, 26 May 2007 04:39:05 -0400 (EDT)
  • References: <f36ddj$71m$>

dXdYdZdu 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?

If you want to use a function as argument, then use one, like below:


Note that there is a difference between a function and an expression. 
Look up Function in the help browser to learn more about pure functions...



  • Prev by Date: Re: V6 evaluation inside Table and plot
  • Next by Date: Re: Function as an argument
  • Previous by thread: Re: Function as an argument
  • Next by thread: Re: Function as an argument