MathGroup Archive 2012

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

Search the Archive

Distinquishing #'s in nested pure functions


Is there a way to distinguish the #'s in nested pure functions?

As a simple example:

f[x_, y_] := x - y

Select[{1, 2, 3}, (f[#, #] & /@ {-1, -2, -3}) == {3, 4, 5} &]

I want the 1st # to correspond with the outer & (the equal)
and the 2nd # with the inner & (the map)
The answer in this example should by {2}
(of course, the statement as written above does not do the job)

Can Mathematica distinguish these #'s?

Thanks in advance,
Dave Snead

  • Prev by Date: Re: About linear programming
  • Next by Date: Integration bug? Integrate[Sin[2 t]^2 Cos[Cos[t - p]], {t, 0, 2 Pi}]
  • Previous by thread: NonlinearModelFit and Complex Data
  • Next by thread: Re: Distinquishing #'s in nested pure functions