PhobosWatch: manifest => enum

"Jérôme M. Berger" jeberger at free.fr
Fri Dec 28 12:54:51 PST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Walter Bright wrote:
> Steven Schveighoffer wrote:
>> This is going to confuse the hell out of all newcomers, and I think
>> there are very few people who use D that actually think this is a good
>> idea (myself included).  There are much better ways to solve this
>> problem than destroying the traditional meaning of enum.
> 
> I understand your point, but also consider that adding yet a fourth way
> to declare constants is not going to be illuminating for newcomers, and
> it makes D look like a mishmash.
> 
	Except that you're already "adding a fourth way to declare
constants" so it is already "not illuminating for newcomers" and it
already "makes D look like a mishmash". But using "enum" only
aggravates the situation: newcomers will face something that they
think they know ("enum") but actually don't really.

> Furthermore, it does not destroy the meaning of enum. Already, you can
> do this in C, C++ and D:
> 
>   enum { x = 1, y = 2 }   // x and y are int's
> 
	There is an additional implied meaning here: x and y are related:
they are either alternate choices for some value or flags that may
be or'ed together. No compiler enforces that, but I've never seen it
used to declare wildly unrelated values (and I would consider it a
poor coding practice).

		Jerome
- --
+------------------------- Jerome M. BERGER ---------------------+
|    mailto:jeberger at free.fr      | ICQ:    238062172            |
|    http://jeberger.free.fr/     | Jabber: jeberger at jabber.fr   |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFHdWKbd0kWM4JG3k8RAn8vAKCcYy/hTwQWZ2mstcf2RIzWkni7SACffJzE
qlVXlIS+vohfe1JK96Wj2kI=
=7jNU
-----END PGP SIGNATURE-----



More information about the Digitalmars-d mailing list