[Issue 9065] Please consider adding these std.traits

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 28 01:27:18 PST 2012


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



--- Comment #44 from Manu <turkeyman at gmail.com> 2012-11-28 01:27:11 PST ---
(In reply to comment #43)
> 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.

Andrei was absolutely correct, as far as any user is concerned:

enum E { K = 10 } // named enum
enum   { K = 10 } // anonymous enum
enum     K = 10;  // obvious sugar to save bracket spam

As said previously, I give exactly zero shits how it's implemented internally,
or the history of it.
The way it's documented now and the syntax chosen makes perfect sense, and any
attempt to make K be somehow distinct in any of these cases is a mistake which
will only lead to confusion.

If E is an enum type, then K is an enum value, or an enum constant... (i like
enum value better; 'constant' is verbose is implicit)

Why would any normal user reasonably expect the term 'manifest' (which I still
have no idea what it means) to appear in this context?

-- 
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