So much thanks to Szabolcs in improving sequence.. for complete explanation. I am so glad to read all explanation which fundamentally remove the problem. But in number 4 of its explanation pointed to Apply in {1} level: As we show with @@@. But I have a problem with this function. As Szabolcs pointed, this function acts as:
list = {{x1,y1}, {x2,y2}, ..., {xn,yn}},
f@@@list= {f[x1,y1], f[x2,y2], ..., f[xn,yn]}
But for example we want to use Last for a list as:
m = {{1, 2, I}, {0, 0, 0}, {I, I, 3}, {2, 6, I}, {0, 0, 0}, {0, 0, 0}, {1, 6, 4}, {0, 0, 0}, {1, 4, 5}}
Last@m
{1, 4, 5}
Apply[Last, {m}]= Last@@{m}
{1, 4, 5}
Last /@ m
{I, 0, 3, I, 0, 0, 4, 0, 5}
But Apply[Last, {m}, {1}] or Last@@@{m} doesn't have any result. I predicted that I should have Last@@@ {m}={Last{1, 2, I},Last{0,0,0},....} which is the result of Last/@ m.
Also I can't understand what is the exact differnce between Last@m and Last@@{m}. I have confused with these syntax.
@@@supplies a sequence to the function being applied, withnslots wherenis the length of the sublists you're mapping over.Lasttakes a list as an argument, so you needLast/@m, for understanding, the way to make@@@work is to doLast[List@##]&@@@m, but that's just tearing the list apart and putting it back together. – N.J.Evans Aug 06 '15 at 15:10@@@andf/@{{x1,y1},{x2,y2}}, which gives{f[{x1,y1}],f[{x2,y2}]}– N.J.Evans Aug 06 '15 at 15:13ApplyorMap. I should have mentioned in my answer thatMaptends to be quite a bit faster thanApply. I still useApplya lot in the exact same way I described, but for the times when performance is important, you should know thatApplytends not to be as fast asMap. – Szabolcs Aug 07 '15 at 08:56MapThread[f,{a,b}]===f@@@Transpose[{a,b}]whenaandbare lists of equal length. I mentally think ofMapThreadaszipWithfrom Haskell. – Reb.Cabin Aug 07 '15 at 12:34