const

Sean Kelly sean at invisibleduck.org
Thu Mar 27 15:31:53 PDT 2008


== Quote from Walter Bright (newshound1 at digitalmars.com)'s article
> Sean Kelly wrote:
> > My only remaining issue with
> > const is simply the choice of keywords for each meaning, and specifically,
> > that the meaning of "const" not only changed from 1.0 to 2.0, but actually
> > weakened.
> Every time we tried to address that, we wound up with a system that
> didn't work.

I'm not sure I understand.  What I meant was that I didn't agree with the choice
of keywords for const behavior in D 2.0--I have no major issue with the
functionality itself.  In particular, I don't like that "const" in D 1.0 means "will
never change" but in D 2.0 "const" means "read-only view" while an entirely
new keyword was chosen for "will never change."  Thus the meaning of "const"
is different from D 1.0 to D 2.0, and not only is it different, but the meaning
is weaker.  This means that 1.0 code will compile just fine in 2.0 but can't rely
on the same guarantees as 1.0 code can, which complicates maintenance if the
code is intended to be cross-compatible.  I'm sure this won't bother me so much
once D 1.0 is a distant memory, but in the interim it's somewhat painful.  That's
all :-)


Sean



More information about the Digitalmars-d mailing list