Invariant doesn't apply to declared symbols

Janice Caron caron800 at googlemail.com
Fri Nov 30 13:12:21 PST 2007


On 11/30/07, Walter Bright <newshound1 at digitalmars.com> wrote:
> Jason House wrote:
> > I'd argue that const and invariant should never be a storage class.
>
> But then you'd have to give up:
>         const x = 3;

...unless you added an extra rule to re-introduce it. That's why I
threw in rule (5) in my list of proposed changes. Let

    const x = y;

be syntactic sugar for

    const(typeof(y)) x = y;

without having to make const an attribute. See the full list of 5 on
whatever thread it's on to see how it all might hang together if you
went for it.



More information about the Digitalmars-d mailing list