What is the difference between enum and shared immutable?
kozzi11 at gmail.com
Fri Oct 30 08:24:35 UTC 2020
On Thu, Oct 29, 2020 at 4:13 PM H. S. Teoh via Digitalmars-d-learn <
digitalmars-d-learn at puremagic.com> wrote:
> But why can't that be treated differently from explicitly writing @safe
> on a declaration? I mean, yeah, it's easier to implement the compiler
> that way, but ease of implementation shouldn't count against proper
> language design!
> Doubt is a self-fulfilling prophecy.
But what about this:
some_ type some_var;
immutable int x = 1;
There are many ways to define it and last time when I was looking at how
this is implemented in D frontend it was implemented as a bitmask variable
and you have no context from where it comes.
So only way would be to disallow this within lexer which I do not see as a
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Digitalmars-d-learn