Add := digraph to D

Jonathan M Davis jmdavisProg at gmx.com
Thu Jun 21 02:36:40 PDT 2012


On Thursday, June 21, 2012 11:14:40 Lars T. Kyllingstad wrote:
> That said, I was still wrong. :)  I just tried it now, and
> apparently you can write pointless stuff like "auto extern int
> foo;" and DMD will compile it just fine.  (And, unless that is a
> bug, it means D has redefined 'auto' to mean absolutely nothing,
> except to be a marker saying "this is a declaration", allowing
> one to omit both storage class and type.)

I believe that auto has been redefined in C++11 as well. In both, all it really 
means is that the type is inferred.

> auto should probably be removed from the list of storage classes
> in the D spec, then.

The spec isn't _at all_ clear on what on earth a storage class is in D. I 
tried to get clarification on that not too long ago and failed.

http://stackoverflow.com/questions/10150510/what-are-the-storage-classes-in-d
http://www.digitalmars.com/d/archives/digitalmars/D/Definitive_list_of_storage_classes_164063.html
http://forum.dlang.org/post/jmipot$d42$1@digitalmars.com

It seems like it's any attribute which can go on a variable declaration save 
for type qualifiers. So, it's pretty much meaningless.

> > _All_ variables
> > cease to exist when they exit scope.
> 
> Not static ones, but again maybe you took "stop existing" to
> refer to the name rather than the storage.

No, you're right. I forgot about static.

- Jonathan M Davis


More information about the Digitalmars-d mailing list