www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Typedef keyword

reply "Maxim Fomin" <maxim maxim-fomin.ru> writes:
Typedef keyword is still listed in
lexical page (http://dlang.org/lex.html),
but is non-compilable neither as a keyword,
nor as a regular identifier.

Is it usable in some situations? If not, is there
a plan of future usage?
Aug 20 2012
parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Monday, August 20, 2012 11:52:35 Maxim Fomin wrote:
 Typedef keyword is still listed in
 lexical page (http://dlang.org/lex.html),
 but is non-compilable neither as a keyword,
 nor as a regular identifier.
 
 Is it usable in some situations? If not, is there
 a plan of future usage?

It used to be used, but now it's deprecated. I think that it still works with -d, though that won't last. In either case, I believe that it will be a keyword for the forseeable future, even if it's not legal to use it. It's easier to make something no longer a keyword than it is to make a non-keyword a keyword. It may or may not be used for something in the future, and it may end up no longer being a keyword at some point, but for now, it still is. Other keywords are or will be in a similar boat (e.g. delete). And macro has been a keyword for ages but isn't used for anything. The fact that a word is a keyword doesn't mean that it's actually used for anything or that it ever will be. It just means that it's reserved so that it _can_ have special meaning and thus isn't a valid identifier. - Jonathan M Davis
Aug 20 2012