if(;){} opinion
Walter Bright
newshound at digitalmars.com
Tue Feb 28 11:32:00 PST 2006
"Derek Parnell" <derek at psych.ward> wrote in message
news:op.s5olyeuu6b8z09 at ginger.vic.bigpond.net.au...
> Language Bigot! <G>
I plead guilty as charged.
> Seriously though ... who cares if its a C thingy! This is NOT C.
It is a C derived language, and is meant to be an upgrade path for C users.
Hence, gratuitous incompatibility is not a good idea. To diverge a
particular feature from C, one needs a better reason than just liking a
different spelling.
> But you already know that. Just because C does 'X' is it good enough to
> justify keeping 'X'? You've already changed lots of other things to
> achieve a better, consistent, language - so why stop at this wart.
>
> 'auto', as a word, is too ambiguous to because it is an adjective that can
> apply to many things. Ok, so C applys it to automatic stack allocation and
> so does D, but D also applies it to automatic type-casting too. Why do you
> want your language to be ridiculed for this wart when it is so easy to
> change it. If you are too frightened of it being a Pascal-looking language
> (and 'var' will not do that, BTW), then pick some other more meaningful
> word.
It isn't ambigous since it doesn't really imply type inference - all it does
is enable the parser to disambiguate an expression from a declaration:
a = 3; // declaration of 'a' with implicit typing? Or assign to
'a'?
auto a = 3; // ahh, now I know it's a declaration
static a = 3; // that's a declaration with implicit typing as well
More information about the Digitalmars-d
mailing list