Few recent dmd pull requests
H. S. Teoh via Digitalmars-d
digitalmars-d at puremagic.com
Fri Jun 27 15:30:20 PDT 2014
On Fri, Jun 27, 2014 at 03:24:36PM -0700, Jonathan M Davis via Digitalmars-d wrote:
> On Thursday, June 26, 2014 17:45:23 Meta via Digitalmars-d wrote:
> > On Thursday, 26 June 2014 at 17:26:02 UTC, bearophile wrote:
> > > Meta:
> > >> There has been discussion before about doing away with string
> > >> lambdas. Maybe this is a good time to do that.
> > >
> > > If they get deprecated I will have to manually fix a _ton_ of
> > > code :-)
> > >
> > > Bye,
> > > bearophile
> >
> > I guess instead of deprecate, I guess I really mean just "phase
> > out". Undocument these templates and discourage their use, but
> > don't actually deprecate them.
>
> The major problem that still needs to be fixed with non-string lambdas
> is the ability to compare them. Right now, as I understand it, the
> same non-string lambda doesn't even result in the same template
> instantiation. String lambdas don't have that problem.
[...]
String lambda comparison is moot: "a<b" and "a < b" do not compare
equal. But at least, calling find!"a<b" multiple times will reuse the
same instantiation, whereas using lambdas will not. So at the very least
we need to fix lambda comparison so that identical lambdas will compare
equal.
Andrei talked about various schemes of lambda comparison before, and I
think the consensus was that some sort of hash function on the lambda's
AST would be most practical, and easiest to implement. I don't know if
any further progress has been made since then, though.
T
--
Life is unfair. Ask too much from it, and it may decide you don't deserve what you have now either.
More information about the Digitalmars-d
mailing list