Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Fwd: new functional operator... paM is Map spelled backwards

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125749] Fwd: new functional operator... paM is Map spelled backwards
  • From: Ralph Dratman <ralph.dratman at gmail.com>
  • Date: Sat, 31 Mar 2012 03:43:40 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <CAO-JnY3XtUcS5RUvjnP5q7SrNs9_yWxAyquJFpC-jDhiPwXALw@mail.gmail.com>

Roby,

Is the code below similar to what you were looking for?

Ralph

(* - - - - begin code - - - - - - - - *)

(*Clean slate*)
Clear[a,b,d];

(*Define this Backwards-Map function...*)
paM[f_] := Map[f, #] &

(*And then...*)
{a, b, 5., d, 7} // paM[Sqrt]

(*... and also...*)
Range[6] // paM[#^2 &] // paM[Sqrt]

(*And even...*)
(Range[7] // N // paM@Log // paM@Sqrt // paM[#^2 &] //
    paM[Exp] // paM[(# + 1.3) &]) // paM@(# - 1.3 &)

(* - - - - end code - - - - - - - - *)


On Sat, Mar 3, 2012 at 6:52 AM, roby <roby.nowak at gmail.com> wrote:
> Dear Group and Mathematica staff.
>
> In the functional programming spirit I am missing a postfix notation
> for Map[ ].
>
> Du to its clarity I often prefer the sequentiall postfix style
> processing of expressions and data:
> e.g.
>
> data//F1//F2//F3
>
>
> but what if our data is a List and the functions we want to perform on
> don't have the Listable Attribute ?.
> the clumsy solution now is:
>
> data//F1/@#&//F2/@#&//F3/@#&
>
>
>
> therefor I suggest a new functional operator, which e.g. could look
> like this: ///
> such that my favorit expression would appear in this nice and clear
> form:
>
> data///F1///F2///F3
>
>
> In other words the new /// operator should temporarily activate the
> Listable Atrribute for the affected function
>
>
> any comments welcome
>
> Robert
>



  • Prev by Date: Re: Integers that are the sum of 2 nonzero squares in exactly 2 ways
  • Next by Date: Re: Integers that are the sum of 2 nonzero squares in
  • Previous by thread: How do I stop Mathematica changing the format of fractions in Input cells?