[Issue 9065] Please consider adding these std.traits

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 28 00:36:30 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9065



--- Comment #43 from Don <clugdbug at yahoo.com.au> 2012-11-28 00:36:26 PST ---
(In reply to comment #42)
> (In reply to comment #26)
> > (In reply to comment #24)
> > > What the compiler calls stuff internally has no bearing on
> > > what users of the language will call things.
> > 
> > It's not an internal thing, that declaration is not an enum declaration,
> > period. enum is used as a keyword for more than one thing, which is bad, but
> > it's too late to change it now. 
> > 
> > We shouldn't name things in Phobos based on what people might think is right or
> > looks right, but based on what the things really are.
> > 
> > It's a shame we don't have a 'manifest' keyword of some sort, it would help
> > avoid confusion. I guess 'enum' was used to cut back on having too many
> > keywords in the language.
> > 
> > Anyway it's documented behavior, see "manifest constants" here (it's at the
> > bottom): http://dlang.org/enum.html
> 
> As far as I was concerned, these are anonymous enum members in the case where
> there's only one member and the { } were omitted. I understood it in this way
> by reading the specification here: http://dlang.org/enum.html. It actual made
> some sense to me.
> 
> The use of "manifest constant" terminology elsewhere will likely cause a lot of
> confusion. Why not term it as an "anonymous enum constant", or "enum manifest
> constant" if that suits the usage better. Term it anything so long as "enum" is
> in there so as to avoid the inevitable confusion elsewhere.

The history of this was:

In D1, const XXX = YYY; declared a manifest constant. You couldn't take the
address of it. With the change to const in D2, this no longer worked. I argued
that we needed a way of doing manifest constants. Walter started implementing
it as 'manifest'. Andrei argued for it to reuse 'enum' to reduce the number of
keywords. Almost everybody was angry about overloading 'enum' and there was a
huge fight, but Andrei won in the end. Yes it causes confusion.

They are not enums, there is nothing enumerated about them. It's just an
overloaded keyword.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list