On Thursday, 12 September 2013 at 03:31:42 UTC, H. S. Teoh wrote:
On Wed, Sep 11, 2013 at 10:06:11PM -0400, Jonathan M Davis
wrote:
On Thursday, September 12, 2013 03:37:06 deadalnix wrote:
> Int, Function, Scope, Import are all valid identifiers.
All of which violate Phobos' naming conventions for enum
values (they
must start with a lowercase letter), which is why we went with
adding
an _ on the end. And it's pretty much as close as you can get
to the
keyword without actually using the keyword, which is a plus
IMHO
(though from the sounds of it, H.S. Teoh would consider that a
negative due to possible confusion with the keyword).
[...]
Actually, the main issue I have is that some of the enum values
end with
_ while others don't. This is inconsistent. I'd rather have
consistency
than superficial resemblance to the keywords as typed. Either
*all* of
the enum values should end with _, or *none* of them should.
Having a
mixture of both is an eyesore, and leads to people wondering,
should I
add a _ at the end or not?
If people insist that the 'default' keyword absolutely must be
represented as TokenType.default_ (I really don't see why),
then *all*
TokenType values should end with _. But honestly, I find that
really
ugly. Writing something like kwDefault, or tokenTypeDefault,
would be
far better.
Sigh, Andrei was right. Once the bikeshed is up for painting,
even the
rainbow won't suffice. :-P
T
Delphi would use
TokenType ttDefault
MyType mtDefault