Compile time values & implicit conditional mixin, as an alternative to tertiary operator hell and one-compile-time functions.
Paul
paultjeadriaanse at gmail.com
Sun Jan 17 00:28:02 UTC 2021
On Saturday, 16 January 2021 at 16:23:18 UTC, Paul Backus wrote:
> This is true no matter what you do, because `enum` constants
> are immutable. Their value has to be computed in a single
> expression, and once assigned, it can never change.
Wouldn't it make sense to also have a mutable compile time
variable though?
I don't know about implimentation etc, but semantically I find it
strange there isn't.
(Instead of running 'normal' code to retrieve a value from it to
be assigned to an enum constant since it couldnt be made from the
get go)
More information about the Digitalmars-d
mailing list