Auto syntax revisited
Bruno Medeiros
daiphoenixNO at SPAMlycos.com
Fri Feb 24 13:44:43 PST 2006
Fredrik Olsson wrote:
> After some discussion on #d I though why not put my thoughts into more
> permanent writing.
>
> Keyword auto is used for two reasons; implicit type and making sure the
> object is destroyed when going out of scope. I suggest a new keyword for
> the latter: local.
>
Regardless of semantic changes (as a semantic change in auto-RAII might
make it work without keyword), I wish for:
auto for auto-RAII
var for auto-type
Why these names? Auto-RAII implies an action in run-time, whereas
auto-type is a compile-time only action, with no run-time effects. The
name 'auto' sounds more action-like than 'var', so it fits better being
assigned to auto-RAII.
Also, 'var' is shorter than 'auto', with only three letters, which is
also nice, since auto-type is mainly a syntactic sugar feature, so with
'var' it is one less character to type.
I wonder what Walter's plans for this are. It's been a while since this
ambiguity was introduced and news on this have come.
--
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