Re: Re: how to map function with over 1 arguments to list
- To: mathgroup at smc.vnet.net
- Subject: [mg57271] Re: [mg57248] Re: how to map function with over 1 arguments to list
- From: "David Park" <djmp at earthlink.net>
- Date: Mon, 23 May 2005 02:20:39 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
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