DMD 1.030 and 2.014 releases

Bill Baxter dnewsgroup at billbaxter.com
Wed May 21 16:58:45 PDT 2008


Sean Kelly wrote:
> == Quote from Walter Bright (newshound1 at digitalmars.com)'s article
>> Bill Baxter wrote:
>>> Walter Bright wrote:
>>>> Bill Baxter wrote:
>>>>> Any chance we'll be getting a backport of the fix to bug 493 in DMD
>>>>> 1.031?   [ http://d.puremagic.com/issues/show_bug.cgi?id=493 ]
>>>> I understand your point, and I have mixed feelings about it. The
>>>> trouble is, it isn't a stable target if it gets language changes, and
>>>> everyone has a different idea on what should be moved from 2.0 to 1.0.
>>> You're worried about existing D1 code that relies on IFTI failing?
>> No, I'm concerned about different D1 compilers that support different
>> languages.
> 
> But again, how does this represent a language change?

I think the issue is that the spec gives one or maybe two specific 
examples of when IFTI works[1].  It says "if blah blah blah, then the 
template parameters will be deduced automatically".  It does not say 
what happens if *not* blah blah blah.

Plus it does say "implicitly, where the /TemplateArgumentList/ is 
deduced from the arguments", and not something like "*some or all* of 
the /TemplateArgumentList/ is deduced".  So I think Walter is right that 
a literal reading of the spec suggests that this a language change.

But my position is that

A) it just makes sense that if you can deduce them all then you should 
also be able to deduce just some.  Why wouldn't you be able to?  I never 
read the spec as saying "this is all that IFTI is intended to do", more 
like "here's one thing IFTI can do".  Actually the D2 spec doesn't 
mention this supposedly new feature[2], so that would argue that even 
Walter didn't see it as a spec change when he added it.

B) this is an important capability for porting D2 algorithms to D1.  The 
std2 project is halted mostly because of lack of this ability.

C) adding it should introduce little or no errors in existing D1 code 
since it used to be an error.  -- ok it is /conceivable/ that some code 
somewhere is using "is(typeof(...))" and counting on it failing when not 
all template parameters are specified, but I think this is pretty 
unlikely to affect much code at all.


[1] http://www.digitalmars.com/d/1.0/template.html under "Function 
Templates"

[2] If it does, I can't find it.  At least D2.0's [1] has the exact same 
text as D1's.

--bb


More information about the Digitalmars-d-announce mailing list