Hi Bobby
I agree with your sentiments. The folk who like {1, 2, 3, 4} // f /@ # & // g /@ # & are those who regret the passing of assembly coding by hand, which opened up programming to the great unwashed.
Of course it can be immeasurably improved by the addition of some more characters, to wit:
{1, 2, 3, 4} // (f /@ # & ) // (g /@ # &)
But, what about my favourite?
Map[ (s \[Function] g[ f[ s ] ]), {1, 2, 3, 4} ]
Or, somewhat less attractive IMHO,
(s \[Function] g[ f[ s ] ]) /@ {1, 2, 3, 4}.
I like (s \[Function] g[ f[ s ] ]) because to me it is intuitive, to use your word. I don't have to recall the way Composition[ ] works, I just have to know what g( f( x ) ) means in mathematics, and the \[Function] arrow is at least more suggestive to me of its meaning/effect than such as // or /@ or @@ or @@@, etc. I can at least suspect that \[Function] means "goes to" or "becomes".
Barrie
PS
I've enjoyed this thread, MathGroup!
>>> On 21/03/2012 at 9:46 pm, in message <
2012032110...@smc.vnet.net>,
DrMajorBob <
btr...@austin.rr.com> wrote:
> Here SIX several equivalent expressions from (IMHO) most intuitive or
> readable to least:
>
> Composition[g, f] /@ {1, 2, 3, 4}
>
> {g[f[1]], g[f[2]], g[f[3]], g[f[4]]}
>
> g /@ f /@ {1, 2, 3, 4}
>
> {g[f[1]], g[f[2]], g[f[3]], g[f[4]]}
>
> Apply[Composition, {g, f}] /@ {1, 2, 3, 4}
>
> {g[f[1]], g[f[2]], g[f[3]], g[f[4]]}
>
> g@f@# & /@ {1, 2, 3, 4}
>
> {g[f[1]], g[f[2]], g[f[3]], g[f[4]]}
>
> Compose[g, f@#] & /@ {1, 2, 3, 4}
>
> {g[f[1]], g[f[2]], g[f[3]], g[f[4]]}
>
> {1, 2, 3, 4} // f /@ # & // g /@ # &
>
> {g[f[1]], g[f[2]], g[f[3]], g[f[4]]}
>
> The last is truly awful.
>
> Bobby
>
> On Tue, 20 Mar 2012 02:18:47 -0500, roby <
roby....@gmail.com> wrote:
>
>>> That creates a information fog that makes *all* Mathematica code harder
>>> to understand, and Mathematica much harder to learn than it used to be.
>>
>> {1, 2, 3, 4} /// f///g
>>
>>
>>> {1, 2, 3, 4} // f /@ # & // g /@ # &
>>