More Intuitive Syntax for Manifest (enum) Constants

Paul Backus snarwin at gmail.com
Fri Nov 21 21:02:24 UTC 2025


On Friday, 21 November 2025 at 11:20:08 UTC, Per Nordlöw wrote:
> As D already has the keyword `macro` reserved, it just struck 
> me that I personally think
>
> ```d
> macro N = 42;
> ```
>
> is more intuitive and recognizable than
>
> ```d
> enum N = 42;
> ```
>
> . Especially for new developers.

I don't think `macro` is any more intuitive than `enum` here. 
Most "new developers" don't know C or C++, and will not have any 
reason to associate the word "macro" with the concept of "a 
compile-time constant."


More information about the Digitalmars-d mailing list