Does the function Map (/@) is equivalent to Apply to first level (@@@) ?
he way that I see this head functions are that both are equivalent. Please, comment if they have a fundamental difference.
Does the function Map (/@) is equivalent to Apply to first level (@@@) ?
he way that I see this head functions are that both are equivalent. Please, comment if they have a fundamental difference.
f /@ g[h[1], h[2], h[3]]andf @@@ g[h[1], h[2], h[3]]to see the difference :) Remember,Mapwraps functions around stuff, whileApplyreplaces the heads of stuff. – Marius Ladegård Meyer Oct 02 '16 at 10:16f @@@ {{1,2},{x,y}}andf /@ {{1,2}, {x,y}}. Is the result the same or different? Remember that it's not necessary to definefto do this (in fact you shouldn't define it to really see what's happening). – Szabolcs Oct 02 '16 at 10:21f /@ listmaps a functionfonto each element oflist, solistis a set of arguments on whichfwill be evaluated.f @@@ listreplaces theHeadof each level-1 element inlist. – corey979 Oct 02 '16 at 11:42f@@@lstas being a shorthand forf @@ # & /@ lst. That is, we may think of Apply at level one as being equivalent to mapping Apply to each (level one) element of lst. Perhaps this is what you mean?f @@ # & /@ {{1, 2}, {x, y}} == f @@@ {{1, 2}, {x, y}}– user1066 Oct 02 '16 at 17:46