MathGroup Archive 2007

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

Search the Archive

Re: Function as an argument

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76702] Re: [mg76625] Function as an argument
  • From: Sseziwa Mukasa <mukasa at jeol.com>
  • Date: Sat, 26 May 2007 04:27:11 -0400 (EDT)
  • References: <200705251020.GAA06125@smc.vnet.net>

On May 25, 2007, at 6:20 AM, 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?

MyFunction[2+#^3&]


  • Prev by Date: Re: Function as an argument
  • Next by Date: UpValues and exponents
  • Previous by thread: Function as an argument
  • Next by thread: Re: Function as an argument