www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Isn't __traits part of the language?

reply simendsjo <simen.endsjo pandavre.com> writes:
Rationale (http://digitalmars.com/d/2.0/rationale.html) says:
"""Why not use operator names like __add__ and __div__ instead of opAdd, 
opDiv, etc.?

__ keywords should indicate a proprietary language extension, not a 
basic part of the language. """


But traits is explained under the language spec, 
http://digitalmars.com/d/2.0/traits.html.


Can I expect traits to exist for all compiler implementations, or just dmd?
Aug 06 2010
parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Fri, 06 Aug 2010 08:42:40 -0400, simendsjo <simen.endsjo pandavre.com>  
wrote:

 Rationale (http://digitalmars.com/d/2.0/rationale.html) says:
 """Why not use operator names like __add__ and __div__ instead of opAdd,  
 opDiv, etc.?

 __ keywords should indicate a proprietary language extension, not a  
 basic part of the language. """


 But traits is explained under the language spec,  
 http://digitalmars.com/d/2.0/traits.html.


 Can I expect traits to exist for all compiler implementations, or just  
 dmd?
__traits was an experiment, one that is highly successful, and will likely be a permanent part of the language. It has been suggested that we choose a keyword to replace __traits, meta was one such suggestion that I like. AFAIK, Walter hasn't really commented on it. -Steve
Aug 06 2010