Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: new functional operator
Replies: 27   Last Post: Jun 3, 2012 5:05 AM

 Messages: [ Previous | Next ]
 DrMajorBob Posts: 1,448 Registered: 11/3/08
Re: new functional operator
Posted: Mar 21, 2012 6:48 AM

Here SIX several equivalent expressions from (IMHO) most intuitive or

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.nowak@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 /@ # &
>
> sorry but I absolutly can't agree with your opinion in this case, the
> former expression is more or less fogless and would be much easier to
> understand.
> The latter expression bears a lot of clutter.
>
> Robert
>
>
>

--
DrMajorBob@yahoo.com

Date Subject Author
3/3/12 roby.nowak@gmail.com
3/4/12 Noqsi
3/8/12 roby.nowak@gmail.com
3/8/12 roby.nowak@gmail.com
3/8/12 roby.nowak@gmail.com
3/9/12 roby.nowak@gmail.com
3/10/12 Murray Eisenberg
3/22/12 Bill Rowe
3/10/12 Barrie Stokes
3/10/12 Barrie Stokes
3/13/12 roby.nowak@gmail.com
3/8/12 branton.campbell
3/10/12 Bill Rowe
3/14/12 roby.nowak@gmail.com
3/18/12 Noqsi
3/20/12 roby.nowak@gmail.com
3/21/12 Noqsi
3/21/12 DrMajorBob
3/22/12 roby.nowak@gmail.com
3/22/12 Barrie Stokes
3/23/12 roby.nowak@gmail.com
3/24/12 DrMajorBob
3/25/12 Ray Koopman
3/26/12 Barrie Stokes
3/28/12 roby.nowak@gmail.com
6/3/12 Rui
6/3/12 Rui