const

Michel Fortin michel.fortin at michelf.com
Fri Mar 28 05:30:09 PDT 2008


On 2008-03-27 23:06:21 -0400, Walter Bright <newshound1 at digitalmars.com> said:

> Jason House wrote:
>> Back when everyone was trying to understand the new const designs, we all
>> called const "readonly".  Every time someone asks today, we always describe
>> it as readonly. Why not use that term if it makes sense to everyone?!
> 
> const, readonly, invariant, and immutable all mean exactly the same thing.

But const in D 1.0 and D 2.0 doesn't mean the same thing does it? I 
think using readonly for what is const in D 2.0 and const for what is 
invariant makes more sense... although just like you I don't like much 
the name "readonly" for that meaning: it looks too much like a synonym.

Ever thought of "shut", "guarded", "shielded", "occluded", or anything 
else conceptualizing some kind of barrier instead of redefining the 
meaning of const and overloading the invariant keyword with a second 
meaning? Or maybe words more like "watched", "witnessed", "espied" -- 
or maybe just "espy", I like that one -- meaning you can only look at 
the thing. All these words have no constancy connotation and I think 
they'd be much better for grasping the D concept of constancy.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Digitalmars-d mailing list