Future of string lambda functions/string predicate functions

Peter Alexander peter.alexander.au at gmail.com
Wed Aug 7 02:41:48 PDT 2013


On Wednesday, 7 August 2013 at 09:12:41 UTC, monarch_dodra wrote:
> Since the end coder is not a D guru, he'll have no idea which 
> functions do support string lambdas, and which don't, which 
> will leave him in an eternal guessing game of "well, looks like 
> *that* doesn't compile"...

String lambdas won't be documented anywhere, so any newcomer to D 
hopefully won't even know they exist, so this problem won't 
happen.


> So, if we *do* choose that string lambdas should leave, then I 
> believe they should clearly be marked as "deprecated". We can 
> leave them in forever, but the end user *must* be told that 
> string lambdas are *not* the way it is meant to be used anymore.

Deprecating them (eventually) breaks existing code, which is 
unacceptable IMO.


> So, my vote is that string lambdas should stay. Supporting them 
> is easy: Just an extra alias at the top of the function. 
> Getting rid of them buys us nothing.

It simplifies the standard library, and makes it easier to write 
higher-order functions and ranges.


More information about the Digitalmars-d mailing list