PhobosWatch: manifest => enum

Jarrod qwerty at ytre.wq
Wed Jan 2 19:04:39 PST 2008


On Fri, 28 Dec 2007 01:36:30 -0800, Walter Bright wrote:

> Jérôme M. Berger wrote:
>> 	:(
> 
> Yeah, I figure I'll get fricasseed over that one. The most compelling
> argument is that we already have 3 ways to declare a constant, adding a
> fourth gets very difficult to justify. As opposed to a minor extension
> to enums.

I hate to jump in so late to this already very discussed issue, but I'm 
going to have to add my voice to those against it.

I came to D from C/C++. If someone told me that D replaces #define with 
enum, I would have laughed in disbelief and then tried to define a bunch 
of 'static invariant' variables instead. It just seems so counter-
intuitive to use enum.
I should also add that more keywords is hardly a bad thing. Perl uses a 
quite large amount of keywords and nobody minds, because each keyword is 
generally given a meaningful name and a useful purpose. For example in my 
recent perl script I have the following line:
>"print "Couldn't get $url\n" and return undef unless defined $content;"
Six keywords on one line, and you could hardly say it looks confusing or 
ugly. I couldn't say the same thing for using enum to define static 
constants.

Please reconsider manifest, Walter.
:(



More information about the Digitalmars-d mailing list