More Intuitive Syntax for Manifest (enum) Constants
Kapendev
alexandroskapretsos at gmail.com
Fri Nov 21 19:46:51 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
> macro N = 42;
> ```
>
> . Especially for new developers.
>
> This makes it more obvious that D's manifest constants is
> instantly inlined by the compiler opposite to how
>
> `static immutable N = 42;`
>
> is treated.
>
> What do you think?
I would say `macro` is also a bit weird, but I get the idea.
More information about the Digitalmars-d
mailing list