if(;){} opinion

Bruno Medeiros daiphoenixNO at SPAMlycos.com
Tue Feb 28 05:39:47 PST 2006


Walter Bright wrote:
> "Charles" <noone at nowhere.com> wrote in message 
> news:du002j$2pcm$1 at digitaldaemon.com...
>> I think its short for 'auto' deduction ?
>>
>> 'var' gets my vote
> 
> 'auto' goes way back to C and means "allocate on the stack". This also 
> implicitly means "destruct at end of scope." In order for type inference to 
> work, there has to be a keyword in front of the declaration to let the 
> parser know it's a declaration rather than an assignment. Thus, 'auto' now 
> means "allocate on the stack" and if the type is missing it also means 
> "infer the type." Types can be inferred with other storage classes:
> 
>     static x = 3;        // x is int
> 
> This follows the 'auto' proposal for C++ as far as I know.
> 
Now this is something I've been meaning to comment on but haven't yet. 
This is damn AWFUL. No autotype declaration should work without the the 
autotype keyword! And I don't care if if deviates from the C++ or not, 
it's just plain bad. *angry face*

> 'var' would be a digression into pascalishness (ugh <g>). 
> 
It wouldn't be, because they do different things. And even if it were, 
what would be the problem?? What matters in a feature/design is how good 
it is, not if it is similar to other languages or not.



-- 
Bruno Medeiros - CS/E student
"Certain aspects of D are a pathway to many abilities some consider to 
be... unnatural."



More information about the Digitalmars-d mailing list