Re: nesting pure functions
- To: mathgroup at smc.vnet.net
- Subject: [mg85978] Re: nesting pure functions
- From: Ryan Olf <ryan at efrus.com>
- Date: Fri, 29 Feb 2008 06:23:59 -0500 (EST)
- References: <47C7144C.4040305@berkeley.edu>
I have figured out how to do this in one manner. What I want is this:
g = Function[{x,y,f},f[x,y,#]&]
Now, the question remains: is there a way to do this without naming
variables explicitly? I would not be surprised if the answer is no.
Ryan
Ryan Olf wrote:
> I'm trying to define a function, g, such that given some parameters and
> a function as arguments, it returns a pure function:
>
> g[x_,y_,f_Function] = Function[f[x,y,#]]
>
> However, I need to define g itself as a pure function. I'm not sure how
> to do this. It may be something like this:
>
> g = Function[Function[#3[#1,#2,#?????]]]
>
> Obviously, I want #?????? to be the argument of the of the outermost
> Function, and #1, #2, #3 of the innermost function.
>
> Is there a way of defining g as a pure function (of a pure function) in
> Mathematica?
>
> I appreciate your help,
> Ryan