Phobos PR: `call` vs. `bindTo`

Nick Treleaven via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 7 04:46:56 PDT 2014


On 05/08/2014 23:10, Meta wrote:
> On Tuesday, 5 August 2014 at 19:31:08 UTC, H. S. Teoh via Digitalmars-d
> wrote:
>> There are currently two Phobos PR's that implement essentially the same
>> functionality, but in slightly different ways:
>
> I don't think either is particularly useful. This is something that's
> either part of the language, or doesn't exist.

I think it should be part of the language (UFCS for lambda functions):

some.long.ufcs.chain.(x => x + x/2).writeln;

This can be useful in real code to avoid breaking a UFCS chain and 
having to introduce a temporary variable, which is more ugly.


More information about the Digitalmars-d mailing list