auto storage class - infer or RAII?

Ary Manzana ary at esperanto.org.ar
Sun Nov 12 06:14:02 PST 2006


Chris Miller escribió:
> On Sun, 12 Nov 2006 08:28:51 -0500, Andrey Khropov 
> <andkhropov_nosp at m_mtu-net.ru> wrote:
> 
>> Walter Bright wrote:
>>
>>> And that's why I've avoided using "var".
>>
>> Well, 'var' is used in C# 3.0 for this purpose (which is obviously a 
>> C-family
>> language and a popular one)
>>  And it's also used in JavaScript and  Scala
>> (which have mostly C-family look and feel)
>> So I think this isn't a serious concern.
>>
>> And as you can see from this and other threads most people here are 
>> happy with
>> it except those who seldom use it for variable naming.
>>
> 
> I don't like "var" because it reminds me of a cheap script like 
> JavaScript, but I'm not that against it.

So change "var" into "infer", as others sugested, if the only concern is 
the name of the keyword. :-)

infer x = 2;
infer y = new Foo();

I believe it's the most clear syntax:
- "auto" -> automatic what?
- "var" -> I know it's a variable, so...?
- "infer" -> Ah! It's infering the type...



More information about the Digitalmars-d mailing list