const

Jason House jason.james.house at gmail.com
Mon Mar 31 05:03:52 PDT 2008


I still think any keyword change should improve understandability. Given history on this mailing list, I first think of 'read only view'. Maybe rov or read. I like read best, but it'll conflict with libraries. Allowing read as a member function is doable, but I doubt Walter would want the extra complexity.

Roberto Mariottini Wrote:

> Walter Bright wrote:
> > Michel Fortin wrote:
> >> But const in D 1.0 and D 2.0 doesn't mean the same thing does it?
> > 
> > Right.
> 
> OK, finally I understand what the big "const problem" is: the keyword 
> 'const' changed meaning from D 1.x to D2.x, and ...
> 
> [...]
> 
> > The thing about "const" is that the major language that uses it, C++, 
> > uses it most of the time with the meaning "read only view, but others 
> > can write to it." The other thing about "const" is that it gets written 
> > a lot, and (at least in C++) it tends to consume a lot of horizontal 
> > space. Using a longer keyword would be problematic.
> 
> ... and in D2.x it took the same meaning of C++ 'const'.
> 
> The solution is simple: remove 'const' from the keywords.
> Moreover, 'const' is not an English word: is an abbreviation of 
> 'constant'. Another reason for dropping 'const' is that it's used in Pascal.
> 
> [...]
> > We can (and essentially did) debate this forever. The bottom line is, 
> > it's just a word, and at some level it becomes the color of the bicycle 
> > shed problem.
> 
> The "Bicycle Shed Problem" is the most important still open problem in 
> Computer Science.
> Let's try to resolve it here: vote another abbreviation of 'constant'.
> 
> 1) c
> 2) co
> 3) cn
> 4) cs
> 5) ct
> 6) con
> 7) cns
> 8) cnt
> 9) cnn
> 10) cst
> 11) csn
> 12) ctt
> 13) cons
> 14) cnst
> 15) cstn
> 16) cnnt
> 17) csnt
> 19) cnstn
> 20) cstnt
> 21) cntnt
> 22) consta
> 23) cnstnt
> 24) contnt
> 25) costnt
> 26) consnt
> 27) constan
> 28) cnstant
> 29) costant
> 30) contant
> 31) consant
> 32) constnt
> 33) constat
> 34) constant
> 
> You can cast any number of votes.
> My vote is for 1, 9, 22, 23, 29, 33 and 34.
> 
> Ciao
> -- 
> Roberto Mariottini, http://www.mariottini.net/roberto/
> SuperbCalc, a free tape calculator: 
> http://www.mariottini.net/roberto/superbcalc/




More information about the Digitalmars-d mailing list