Anonymous function syntax

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Sep 23 10:03:13 PDT 2011


On 09/23/11 10:40, pillsy wrote:
> == Quote from Andrei Alexandrescu (SeeWebsiteForEmail at erdani.org)'s
> article
>
>> On 09/22/11 16:08, bearophile wrote:
>
>>> Andrei Alexandrescu:
>
>>>> A function literal should be comparable to another for
>>>> equality.
>
>>> Are you willing to explain me why, and show an use case?
>
>> An important application is optimizing for specific lambdas (e.g.
>> equality). For example, a substring search using equality for
>> characters could use bitwise comparison.
>
> Is there some reason this isn't better handled through templating
> mechanisms? It seems like this would primarily benefit picking
> better optimization strategies at *runtime*, which strikes me as a
> fairly esoteric use case.
>
> Cheers,
> Pillsy

Forgot to mention - the comparison should work statically, i.e. inside a 
static if.

Andrei


More information about the Digitalmars-d mailing list