November 28, 2012 [Issue 9065] Please consider adding these std.traits | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manu | http://d.puremagic.com/issues/show_bug.cgi?id=9065 --- Comment #50 from Manu <turkeyman@gmail.com> 2012-11-28 07:17:41 PST --- Can I just add, we've derailed my actual bug thread here >_< This is an extremely important issue for me, which has been lost in the meaning of enum and whether 'manifest constant' is a stupid name or not. Any word on isStatic!(), good/bad one to have (I don't know how to do it manually)? These traits are of critical importance to me to help a bunch of non-D programmers feel that the language is awesome and intuitive; ie, 'can understand it when they read the code', and assure it is maintainable going forward. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 28, 2012 [Issue 9065] Please consider adding these std.traits | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manu | http://d.puremagic.com/issues/show_bug.cgi?id=9065 --- Comment #51 from Jonathan M Davis <jmdavisProg@gmx.com> 2012-11-28 08:14:54 PST --- > An enumerated type must be integral (it must be countable!) This is not true at all in D. An enum can be any type which can be compared and can be use to directly initialize a variable at compile time. On top of that including built-in types like strings, TDPL specifically talks about declaring enums which are structs - and that's enums with a list of values, not manifest constants. It's incredibly valuable to be able to have enumerated lists of user-defined tpes rather than just integral values. I have no problem whatsoever calling enums which are manifest constants manifest constants rather than enums, but at the same time, the only differences between them and normal enums are the fact that they don't have a separate enum type and there's only one of them. Practically speaking, there's really no other difference. Neither have addresses. They're just values that get copy-pasted when used. So, while I have no problem with the term manifest constant, I don't think that it would cause any real problem to refer to them as anonymous enums instead. I do kind of wish that we'd gone with the keyword manifest over enum to better separate the two concepts, because manifest constants are actually enumerated, but from a pratical point of view, it's really a non-issue IMHO. If anything, normal enums are simply an enumeration of manifest constants. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation