Is D 0.163 D 1.0?

Don Clugston dac at nospam.com.au
Tue Jul 25 01:31:53 PDT 2006


renox wrote:
> Andrei Khropov wrote:
>> And what about double meaning of 'auto'?
>>
>> It's a longstanding issue and changes could break lots of code, but I 
>> think it's
>> a terrible design inconsistency.
>>
>> And it also currently means that we cannot use type inference with 
>> auto classes
>> (which is also inconsistensy by itself)
>>
>> ------------------------------------------------
>> import std.stdio;
>>
>> auto class X
>> {
>> public:
>>     int _i;
>>         this(int i1)
>>     {
>>         _i = i1;
>>     }
>>         int i()
>>     {
>>         return _i;
>>     }
>>         ~this()
>>     {
>>       writefln("destructor i=",_i);     }
>> }
>>
>> void main()
>> {
>>     auto X x1 = new X(1);
>>         //auto auto x2 = new X(2); // auto1.d(28): redundant storage 
>> class 'auto'
>>         // auto x3 = new X(3); // auto1.d(30): variable auto1.main.x3 
>> reference to
>> auto class must be auto
>>         writefln("x1.i=",x1.i);
>>     //writefln("x2.i=",x2.i);
>>     //writefln("x3.i=",x3.i);
>> }
>> ---------------------------------------------------
>>
>> Some discussion was here: 
>> http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/38443
>>
>> (I personally vote for 'var' for type inference)
> 
> You have my vote too.

Nooooooooo!!!!
Am I the only person who has hundreds of local variables called 'var'?
(mostly variants in Win32 code).

A quick google search for 'var cpp' showed a million hits, a fair chunk 
of them are local variables in C++ code. It's a very popular variable name.



More information about the Digitalmars-d mailing list