enum and const or immutable ‘variable’ whose value is known at compile time
H. S. Teoh
hsteoh at quickfur.ath.cx
Thu Sep 17 22:18:42 UTC 2020
On Thu, Sep 17, 2020 at 06:06:56PM -0400, Steven Schveighoffer via Digitalmars-d-learn wrote:
> On 9/17/20 9:13 AM, Simen Kjærås wrote:
> > To be clear: I don't mind 'enum' being used this way, but if I were
> > to do things over again, I would have used 'alias'.
> fun fact: for a (very) brief time, D had a `manifest` keyword that did
> exactly what enum does in this instance (not even sure it made it into
> a release).
> enum is a head scratcher of a name, for sure. But it works out just
> fine once you get used to it. I think of it as "compile time". To be
> honest, for what it does, enum is a very poor name. But because it's
> consistent, it works.
In my mind, I just substitute 'enum' with 'manifest constant' and
everything makes sense. ;-)
What are you when you run out of Monet? Baroque.
More information about the Digitalmars-d-learn