__traits conflicts with rationale

Sean Kelly sean at f4.ca
Tue Aug 7 13:14:04 PDT 2007


Walter Bright wrote:
> Deewiant wrote:
>> http://www.digitalmars.com/d/rationale.html
>>
>> "__ keywords should indicate a proprietary language extension, not a 
>> basic part
>> of the language."
>>
>> You said it, not me. ;-)
> 
> I know. Generally, the __traits thing is an experiment.

In chat the other day, I was bemoaning some of the keyword choices for 
the new features in D 2.0.  The functional aspect of each is fantastic, 
but the facade for some doesn't have the sort of elegance that I feel is 
a hallmark of the D language.  Unfortunately, I think you've set a 
rather high bar for new features in D.  What we've got is consistently 
so clean and cohesive that any break from this trend sticks out like a 
sore thumb.

Regarding "__traits" -- my suspicion was that you chose a keyword that 
didn't require renaming the "std.traits" module to something else.  In 
light of the fact that it is an experimental feature, this decision 
makes perfect sense.  But until this post, I had been dreading that we 
would be stuck with the name forever.  I think it would help if an 
additional sentence of explanation were added to the changelog for new 
or experimental features, if for no other reason than to forestall some 
negative reaction to the frilly bits.

Assuming "__traits" is sorted, the only feature needing a facelift is 
const.  Again, functionally excellent, but I just can't get over feeling 
that it's awkward to visually parse and to use in its current form. 
Like "__traits", knowing that the current syntax is not set in stone 
would diminish my resistance to using the new features.


Sean



More information about the Digitalmars-d mailing list