Perhaps we need to defer const for a while (3.0?)
Russell Lewis
webmaster at villagersonline.com
Wed Jan 2 10:46:56 PST 2008
Originally, Walter argued that we didn't need const in D because it was
confusing and didn't solve the optimization problems that it was
intended to solve.
But then people made very good arguments about why we need const. So
Walter brought const into the language, but with better semantics (than
C++). Problem was, it was confusing to many people, and it didn't solve
all the problems that it was intended to solve.
Sound familiar?
Now we've gone through additional iterations (how many so far?) and we
still don't have it working quite right. IMHO, this is the time to
recognize the *empirical* fact that as yet neither do we understand the
full requirements of what const should be trying to do nor do we have an
easily-understandable way to implement it. I don't think that this is a
problem with the current design; it is a problem with our theoretical
grasp of the space.
Walter, I'm not attacking you, truly. I hold you in the highest regard,
and you have worked very hard for a very long time on const, and on D in
general. But const isn't working. My guess is that we need the PhD's
to write more papers on the theory of const before us mere mortals will
be able to use it in our practical languages. A formal, mathematical
model for const, as it applies to imperative languages, with an
exhaustive examination of the various use cases (assignment, reference,
duplication, etc.) would be nice.
Maybe it's time to stop spinning our wheels here and start making
progress on other things.
More information about the Digitalmars-d
mailing list