auto storage class - infer or RAII?

Andrey Khropov andkhropov_nosp at m_mtu-net.ru
Sun Nov 12 05:28:51 PST 2006


Walter Bright wrote:

> My problem with "var" is the history of the keyword. Back in the olden days,
> there were two main camps of programmers - the Pascal people, and the C
> people. Each camp looked with disdain upon the other as "not getting it". The
> Pascal crowd progressed to Modula 2, Object Pascal, and eventually Delphi.
> The C family progressed to C++, Java, and D. There didn't seem to be much
> voluntary mixing up, people would switch camps only under duress.
> 
> So I have a real (possibly outdated) concern that "var" appearing in D will
> make the language distasteful to the C crowd. The appearance of a language
> matters a lot, it's like the clothes one wears that identifies one
> (consciously or not) as being with a particular group.
> 
> 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.

> 
> ("let" is far worse, as it gives the impression that D is some sort of new
> Basic language.)

Forget about Basic, 'let' is used in ML that pioneered the concept of type
inference!

And there is also 'def' (from define)
(used in Nemerle for this purpose, in many languages indicates function
definition).

But I'd like to see it short (3-4 characters) otherwise typing 'int' would be
simpler :).

-- 
AKhropov



More information about the Digitalmars-d mailing list