Re: What is @@@?
- To: mathgroup at smc.vnet.net
- Subject: [mg87194] Re: What is @@@?
- From: Szabolcs Horvát <szhorvat at gmail.com>
- Date: Fri, 4 Apr 2008 02:54:51 -0500 (EST)
- Organization: University of Bergen
- References: <ft2au1$ph5$1@smc.vnet.net>
Kevin J. McCann wrote:
> I have seen several references to the command @@@ in this newsgroup, but
> a query of the online Documentation Center just refers me to Apply (@@).
> What does it do and where can I read about it?
>
Hi Kevin,
@@@ is "apply at level 1". f @@@ expr is equivalent to
Apply[f, expr, {1}]. This is under "more information" on the
doc page of Apply[].
It is easy to remember the sytax: each of @, @@, and @@@ act at a deeper
level:
In[1]:= f@{{1, 2}, {3, 4}}
Out[1]= f[{{1, 2}, {3, 4}}]
In[2]:= f @@ {{1, 2}, {3, 4}}
Out[2]= f[{1, 2}, {3, 4}]
In[3]:= f @@@ {{1, 2}, {3, 4}}
Out[3]= {f[1, 2], f[3, 4]}
But there is no @@@@, it only goes until @@@.
Szabolcs