The Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 87
Registered: 5/8/07
Re: new functional operator
Posted: Mar 8, 2012 4:37 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 4 Mrz., 10:37, wrote:
> On Saturday, March 3, 2012 8:52:46 PM UTC+9, roby wrote:
> > Dear Group and Mathematica staff.
> > In the functional programming spirit I am missing a postfix notation
> > forMap[ ].

> How about:
> RightVector[a_,f_]:=Map[f, a]
> RightVector[a_,more__]:=RightVector[Map[{more}[[1]],a],Sequence@@Drop[{more },1]]
> Then:
> {1,2,3}\[RightVector](#^2&)\[RightVector]g
> yields:
> {g[1],g[4],g[9]}
> (it looks nicer in a notebook)



surprisingly easy, surprisingly not yet standard in Mathematica

can even be prettyfied a little bit:


or we can use LeftTee[ ] which in contrast to RightArrow[ ] already
implements the neccesary left-assocciativitiy such that:

LeftTee[a_, f_] := f /@ a

is all we need.

(looks nicer in a notebook)


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.