Unicode operators
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Mon Oct 27 05:42:25 PDT 2008
Bent Rasmussen wrote:
> "Robert Fraser" <fraserofthenight at gmail.com> skrev i meddelelsen
> news:ge3mit$i33$1 at digitalmars.com...
>> So what's the difference? That is to say, what would
>> tolower(trim(str)) translate to?
>
> It would translate to something like
>
> val x = str |> trim |> tolower;
>
> So it looks like a pipeline. And to construct such a function, you'd
> define it as
>
> val f = trim >> tolower;
> val x = str |> f;
>
> This is from memory, I don't program in F#.
BTW, incidentally std.functional defines both operators in prefix form:
auto x = pipe!(trim, tolower)(str);
or
auto x = compose!(tolower, trim)(str);
Andrei
More information about the Digitalmars-d
mailing list