PhobosWatch: manifest => enum
John Reimer
terminal.node at gmail.com
Sat Dec 29 09:41:27 PST 2007
On Sat, 29 Dec 2007 02:00:26 -0800, Walter Bright wrote:
> BLS wrote:
>> Why not keeping enum as it was and use manfifest as enhanced enum ?
>> Seems to be a clean solution.
>
> Because, then there's a fourth way to declare constants. 3 seems to be
> enough.
I think the distinction comes down to adding another keyword, not a
fourth way (which, as others mention, is happening nonetheless). I know
you try very hard to avoid adding more keywords to D. It's always been
that way and will always be that way.
So I guess the contention is (and will always be)
* whether it's worth the clarity that yet-another-keyword offers (YAK,
for short :) )
* whether more overloading of type semantics makes sense (how much longer
can D handle this)
The manifest constant is really quite different from the other semantics
of constant; and I think that it deserves to be set apart from the rest
as a completely different entity (afterall this used to be achieved by
something like #define's in C/C++). But then, I'm not sure if you have
set goals on how many keywords you're allowed to add per year. If you
have some sort of limit, I can see how you necessarily must show
restraint. :)
My question is: at what point do D keywords reach critical mass (in terms
of keyword hijacking for new functionality)? This seems to happen
repeatedly as D struggles to avoid keyword additions... at what /appears/
to be the expense of the programmer.
This new manifest enum could work and eventually people might just get
used to it... but it's so strange, so foreign, and so seemingly
inconsistant that I think your betting heavily on the good-graces of your
d community (who likely will forgive you and move on). But I do wonder if
this is the case for all those users that are still deciding whether to
adopt D or not. D 2.0 is an indicator of what is to come... so decisions
made here are going to speak volumes about the future.
I don't know how newcomers would react or what confusion it would cause
novices, so I won't use that as argument against it. But it's a gamble
and a seemingly very risky gamble. Some would say high-risk gambles
don't make sense, especially when the payback is nominal.
-JJR
More information about the Digitalmars-d
mailing list