MathGroup Archive 2005

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

Search the Archive

Re: Re: how to map function with over 1 arguments to list


David,

Strange how one person gets used to one construction and another to another
construction.

Would adding a pair of parentheses make it clearer to people reading the
code?

(f @@ # &) /@ {{1, 1}, {2, 2}}

Or spelling it out in more detail?

data = {{1, 1}, {2, 2}};
Map[Apply[f, #] &, data]

Or

Map[Function[{list}, Apply[f, list]], data]

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

From: David Bailey [mailto:dave at Remove_Thisdbailey.co.uk]
To: mathgroup at smc.vnet.net

David,

In any other context than Mathematica (and presumably APL),
f @@ # & /@

would have a totally different meaning! My brain starts to run out of
stack space when I try to process strings of operators like that.

David Bailey
http://www.dbaileyconsultancy.co.uk





  • Prev by Date: Re: StringReplace
  • Next by Date: undocumented ANOVA error/warning?
  • Previous by thread: Re: Re: how to map function with over 1 arguments to list
  • Next by thread: right to left fonts inside strings