Proposal: new variable definition operator

jovo jovo at at.home
Sat Apr 21 09:01:16 PDT 2007


Daniel Keep Wrote:
> 
> The auto storage class simply means that it's a "normal" variable: it's
> not constant, not final, not static and not scope-destroyed.  If it's at
> module-level, it's a global variable at a fixed memory location.  If
> it's in a function, it's allocated on the stack.  If it's in a struct or
> class, it's allocated as part of the containing type.
> 

>From the D docs (Attributes):
"The auto attribute is used when there are no other attributes
and type inference is desired."

OK, it's simple and clear, but difficult to say:
"auto has *nothing* to do with type inference".

> AFAIK, D's auto is the same as C's auto.
> 

Maybe it _was_ initially. But not now.

"Automatic variables are internal to a function; they come into
existence when the function is entered, and disappear when it is
left." (The C Programming Language, Kernighan and Ritchie)

jovo





More information about the Digitalmars-d mailing list