Better lambdas!!!!!!!!!!
Prudence via Digitalmars-d
digitalmars-d at puremagic.com
Thu Sep 10 10:55:05 PDT 2015
How bout this:
void myfunc(double delegate(int i, int z, float f)) {....}
myfunc((int i, int z, float f) { return i*z*f; } }
vs
myfunc({ return i*z*f; }) // Names of parameters are inferred
from signature.
by specifying the parameter names in the signature, we don't have
to specify them in the lamba creation. This doesn't replace the
original way, just adds the ability to infer the names if they
are not specified.
Of course, this hides the names outside the lambda, but a warning
could be issued(no different than if one does it explicitly.
More information about the Digitalmars-d
mailing list