Future of string lambda functions/string predicate functions

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Aug 14 10:17:56 PDT 2013


On 8/14/13 10:15 AM, Dmitry Olshansky wrote:
> 14-Aug-2013 20:37, H. S. Teoh пишет:
>> On Wed, Aug 14, 2013 at 09:26:20AM -0700, Andrei Alexandrescu wrote:
> [snip]
>> It just occurred to me, that perhaps what we really need here is an
>> even more abbreviated form of lambda literals, like this:
>>
>>     sort!(a < b)(range);
>>
>> where 'a' and 'b' are undefined identifiers in the current scope, and
>> the compiler would know to bind them to lambda parameters. Defined
>> identifiers would, naturally, bind to whatever they refer to:
>>
>
> Make that
> sort!( _ < _)(range)
>
> and you have some Scala :)

Really? How does Scala figure that _ < _ refers to two arguments and not 
one?

Andrei



More information about the Digitalmars-d mailing list