Invariant doesn't apply to declared symbols

Jason House jason.james.house at gmail.com
Fri Nov 30 14:21:03 PST 2007


Walter Bright 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;

I've been thinking more and I don't really like the whole storage class
thing anyway.  I posted in the "const ideas" thread with my latest
thoughts.

In whatever situation, "const x = 3;" would be syntactically invalid under
any scheme, so bolting it in to be a pure constant seems just fine. 
Personally, I'd never use it, but no language should ever be designed to be
exactly what I'd use and include nothing else :)



More information about the Digitalmars-d mailing list