auto -> auto & var

Georg Wrede georg.wrede at nospam.org
Sat Mar 18 06:15:40 PST 2006


james wrote:
> In article <441B161B.4010109 at nospam.org>, Georg Wrede says...
> 
>> Unknown W. Brackets wrote:
>> 
>>> Here's what I hate about var: I use JavaScript a lot (this
>>> happens when you make interactive websites for a living.)  What
>>> do you mean, that's not a reason?
>>> 
>>> Sure it is.  In JavaScript and other scripting languages, this
>>> would be valid:
>>> 
>>> var x;
>>> 
>>> // Okay, let's make it an array! x = new Array(1, 2, 3);
>>> 
>>> // Actually, you know what, I take that back. x = "1,2,3";
>>> 
>>> // Come to think, this might be better... x = {0: 1, 1: 2, 2: 3};
>>> 
>>> 
>>> // No, no, actually it just needs one.  How clueless of me. x =
>>> 1;
>> 
>> Breaking the unfortunate "auto" into two separate words would be
>> very good. But like you say, "var" may not be a good candidate.
>> Especially when a change in the language should strive to _improve_
>> it, and not merely substitute one problem for another.
>> 
>> Ideally a programming language should be readable without having to
>>  think and remember stuff (that has with the language itself to
>> do). All the needed mental gymnastics should pertain to the source
>> code itself and its semantics. Not to those of the language.
>> 
>> <stab> If we wanted to save keywords, we could surely find lots of
>> other places where we could use the same word for different things,
>> without it becoming awkward for the compiler. But so far we haven't
>> done that. It would be just dumb. </stab>
> 
> 
> What is the current status of this issue? What is Walters thinking?

IIRC, he was happy using the auto for both.



More information about the Digitalmars-d mailing list