enum abuse

Meta jared771 at gmail.com
Fri Feb 28 21:39:23 PST 2014


On Friday, 28 February 2014 at 19:09:06 UTC, Steven Schveighoffer
wrote:
> For a *VERY* short time (I think one version perhaps), we had 
> the 'manifest' keyword which was supposed to mean manifest 
> constant.
>
> It was removed, Andrei was a very stanch supporter of enum 
> being the manifest constant keyword.  This comment in an early 
> debate about what became the inout feature is pretty 
> explanatory: 
> https://d.puremagic.com/issues/show_bug.cgi?id=1961#c3
>
> "And enum... you'll have to yank that out from my dead cold 
> hands. Extending
> enum instead of adding yet another way of defining symbolic 
> constants is The
> Right Thing to do. I am sure people would have realized how 
> ridiculous the
> whole "manifest" thing is if we first proposed it. We just 
> can't define one
> more way for each kind of snow there is."
>
> -Steve

Hmm, I didn't know that. Interesting. I think this was a mistake
on Andrei's part, though. The concept of enumerations doesn't
have anything to do with evaluating an expression at compile time
other than how it's implemented in D and C++, so overloading the
keyword to mean "evaluate this expression at compile time" does
not seem like a good choice.


More information about the Digitalmars-d-learn mailing list