MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: new functional operator


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[ ].

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)



  • Prev by Date: Re: How add a menu item with a menu key using an init.m
  • Next by Date: Command Completion
  • Previous by thread: new functional operator
  • Next by thread: Re: new functional operator