MathGroup Archive 2006

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

Search the Archive

Re: Map-like behaviour for functions of more than a single argument?


You can do it without the intermediate g. Is the following what you had
in mind? I use your definition of f, and map it directly to a list of
arguments:

f[#, #^2 &] & /@ {{x1, y1}, {x2, y2}}

or:

f[#, Function[{z}, z^2]] & /@ {{x1, y1}, {x2, y2}}

or:

Map[Function[{z}, f[z, #^2 &]], {{x1, y1}, {x2, y2}}]

or:

Map[Function[{z}, f[z, Function[{z2}, z2^2]]], {{x1, y1}, {x2, y2}}]


They all do the same thing, I only wrote out the four combinations of
using two anonymous (pure) functions with named or anonymous argument.
I didn't know the first would work though. I don't use "#&" notation
much, Function is clearer to me.

Bye


  • Prev by Date: ListSphericalDensityPlot[] ??
  • Next by Date: Re: Re: Not Using a Text Editor Interface for Mathematica
  • Previous by thread: Re: Map-like behaviour for functions of more than a single argument?
  • Next by thread: Re: Map-like behaviour for functions of more than a single argument?