dmd 1.046 and 2.031 releases

Robert Jacques sandford at jhu.edu
Tue Jul 7 18:16:03 PDT 2009


On Tue, 07 Jul 2009 20:48:50 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> Robert Jacques wrote:
>>>> long g;
>>>> g = e + f;  => d = cast(long) e + cast(long) f;
>>>
>>> Works today.
>>  Wrong. I just tested this and what happens today is:
>> g = cast(long)(e+f);
>> And this is (I think) correct behavior according to the new rules and  
>> not a bug. In the new rules int is special, in this suggestion, it's  
>> not.
>
> I think this is a good idea that would improve things. I think, however,  
> it would be troublesome to implement because expressions are typed  
> bottom-up. The need here is to "teleport" type information from the  
> assignment node to the addition node, which is downwards. And I'm not  
> sure how this would generalize to other operators beyond "=".
>
>
> Andrei

Hmm... why can't multiple expressions be built simultaneously and then the  
best chosen once the assignment/function call/etc is reached? This would  
also have the benifet of paving the way for polysemous values &  
expressions.


More information about the Digitalmars-d-announce mailing list