Real World usage of D, Today (was Re: challenge #2: implement the varargs_reduce metafunction)

John Reimer terminal.node at gmail.com
Thu Jan 25 12:57:38 PST 2007


On Wed, 24 Jan 2007 23:12:21 -0800, Andrei Alexandrescu (See Website For
Email) wrote:

> Bill Baxter wrote:
>> Well there is this issue that &foo where foo is an overloaded will give 
>> you pointer to the first version of foo in the source file.  There's no 
>> way to disambiguate as far as I know.  Particularly frustrating for 
>> property methods
>> 
>>    void prop(float x) { ... }
>>    float prop() { ... }
>> 
>> 
>> &prop just gives you the first one no matter what.
>> 
>> Maybe not what you're talking about with "matching using constants" but 
>> it is related to signature matching (or lack thereof).
> 
> Ouch. This warrants a bug report. It sure has ripples in lots of 
> template code, too.
> 
> Andrei


That's not considered a bug, however.  There have been many complaints
about D's signature lookup "protocol" over the last 2 to 3 years.  Walter
has many times stated that it's done that way on purpose, I think to
avoid compiler complexity. Maybe this example shows yet another reason why
it hurts, but we've had no success convincing him otherwise.  That's just
one example of "silent acception" of the symbol.  I'm actually surprised
that Walter didn't invalidate that bug report.

I guess this is an example of the slow aggregation of evidence against
certain language/implementation mechanisms. Template issues related to
this may further this realization.

-JJR



More information about the Digitalmars-d mailing list