www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - register (!keyword)

reply "Miguel Ferreira Simões" <Kobold netcabo.pt> writes:
Currently, as far as I know, "register" is not a keyword in language D.
My question is the following: should we encourage the use of it in the 
source files? Do you think in the future it will be a keyword?

-- 
Miguel Ferreira Simoes 
Nov 24 2004
next sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Miguel Ferreira Simões wrote:

 Currently, as far as I know, "register" is not a keyword in language D.
 My question is the following: should we encourage the use of it in the 
 source files? Do you think in the future it will be a keyword?

You should just delete any old "register" leftovers from C/C++. Same goes for the "inline" designation of a function or method. Says http://www.digitalmars.com/d/function.html:
 Inline Functions
 There is no inline keyword. The compiler makes the decision
 whether to inline a function or not, analogously to the register
 keyword no longer being relevant to a compiler's decisions on
 enregistering variables. (There is no register keyword either.)

So they will not be keywords (or valid), in any D source code. The D compiler decides whether or not to enregister or inline. You should not depend on it actually doing so... --anders
Nov 24 2004
prev sibling parent Sean Kelly <sean f4.ca> writes:
In article <co1inu$pve$1 digitaldaemon.com>, Miguel Ferreira Simões says...
Currently, as far as I know, "register" is not a keyword in language D.
My question is the following: should we encourage the use of it in the 
source files? Do you think in the future it will be a keyword?

No. The "register" keyword is often ignored in modern C/C++ compilers because the optimizer can do a better job at this sort of optimization than the programmer can. Sean
Nov 24 2004