Future of string lambda functions/string predicate functions

Jakob Ovrum jakobovrum at gmail.com
Tue Aug 6 03:05:53 PDT 2013


On Tuesday, 6 August 2013 at 09:51:07 UTC, bearophile wrote:
> In this page:
> http://dlang.org/phobos/std_algorithm.html
>
> There is written:
> bool isSorted(alias less = "a < b", Range)(Range r);
>
> If you remove string lambdas, how is that signature?

bool isSorted(alias less = (a, b) => a < b, Range)(Range r);

> My opinion is that lambdas are more clean, and I usually prefer 
> them, but in certain situations I prefer string lambdas.

I think those few situations should forego string lambdas in 
favour of reduced cognitive load and increased consistency.


More information about the Digitalmars-d mailing list