Search All of the Math Forum:

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

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

 Messages: [ Previous | Next ]
 roby.nowak@gmail.com Posts: 87 Registered: 5/8/07
Re: new functional operator
Posted: Mar 8, 2012 4:40 AM

On 4 Mrz., 10:37, noqsiaerosp...@gmail.com 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
> > for Map[ ].

>
>
> 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)

... sorry for flooding the group, but got it even nicer:

RightVector[a_, first_, rest___] := If[rest === Null, first /@ a,
RightVector[first /@ a, rest]]

Robert

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