any news on const/invariant?
Oskar Linde
oskar.lindeREM at OVEgmail.com
Wed Nov 28 15:29:49 PST 2007
Walter Bright wrote:
> Because those alternatives all look terrible. And frankly, how could
> anyone be confused about what:
> const x = 3;
> means? I can't understand throwing that out to improve clarity?
Honestly, I am confused about what that means. If I define an integer
constant x, don't I want a pointer to that constant to be
invariant(int)*? Doesn't that mean that constants should rather be
defined as:
invariant x = 3;
Or am I wrong? What am I missing here?
I am to tired right now to reiterate my full thoughts on the keywords
(and I am sure you are all very thankful for that :) ), but it still
feels like the keywords are reversed:
invariant === constant
const === read only
--
Oskar
More information about the Digitalmars-d
mailing list