const

Sean Kelly sean at invisibleduck.org
Fri Mar 28 16:47:25 PDT 2008


== Quote from Walter Bright (newshound1 at digitalmars.com)'s article
> Sean Kelly wrote:
> > I've suggested "view" in the past, and there must be others.
> "view" doesn't imply that one cannot change it through that view.

It certainly does to me.  But this is obviously a matter of opinion.

> > Alternately,
> > invent a word as you've said or come up with syntax that doesn't require
> > a keyword to indicate this concept.  Truth be told however, my issue with
> > the keywords in 2.0 has more to do with the change in meaning of "const"
> > than with the words themselves.
> const in D pretty much has the same meaning as C++ const as far as being
> a readonly view. The C++ meaning has a lot of momentum behind it.

So why use 'const' to mean ROM-able in D 1.0?  Within the context of D, 'const'
already has an established meaning, and I'd consider that more important.

Please note that the reason I originally brought up const stuff at all was because I
dislike that the meaning of 'const' changed between 1.0 and 2.0, and in such a way
that the 2.0 compiler will silently accept code written for 1.0 but that the meaning
will be different.  I really didn't intend for the conversation to end up being about
the meaning of words.  Frankly, I'd long since given up the const issue as lost
anyway--I really have no idea why I decided to say anything now at all.


Sean



More information about the Digitalmars-d mailing list