On Fri, May 30, 2014 at 07:17:15PM +0200, Philippe Sigaud via 
Digitalmars-d-learn wrote:
> > In D enum can be used to define manifest constants. This means
> > constants known at compile time. In practice for a double there
> > isn't a lot of difference. In general you can't take the address of
> > a manifest constant, unlike immutables.
> 
> Because they do not exist as 'variables' or symbol in the generated
> code. They are directly replaced by their computed value.

One has to admit, though, that the choice of 'enum' as keyword is a bit
unfortunate, since most newbies (and some not-so-newbies) understand it
as "enumeration" rather than "manifest constant". It makes sense in
retrospect, but is quite counterintuitive for first-timers.


T

-- 
I think Debian's doing something wrong, `apt-get install pesticide',
doesn't seem to remove the bugs on my system! -- Mike Dresser
  • enums Russel Winder via Digitalmars-d-learn
    • Re: enums bearophile via Digitalmars-d-learn
      • Re: enums Philippe Sigaud via Digitalmars-d-learn
        • Re: enums H. S. Teoh via Digitalmars-d-learn
          • Re: enums Philippe Sigaud via Digitalmars-d-learn
    • Re: enums monarch_dodra via Digitalmars-d-learn
      • Re: enums Andrej Mitrovic via Digitalmars-d-learn
        • Re: enums Miles Stoudenmire via Digitalmars-d-learn
        • Re: enums bearophile via Digitalmars-d-learn
          • Re: enums Paul D Anderson via Digitalmars-d-learn
            • Re: en... bearophile via Digitalmars-d-learn
            • Re: en... Timon Gehr via Digitalmars-d-learn
            • Re: en... monarch_dodra via Digitalmars-d-learn
              • Re... Chris Nicholson-Sauls via Digitalmars-d-learn

Reply via email to