const

Bill Baxter dnewsgroup at billbaxter.com
Mon Mar 31 13:13:53 PDT 2008


Janice Caron wrote:
> On 31/03/2008, Jason House <jason.james.house at gmail.com> wrote:
>> Maybe rov or read.
> 
> Again, "readable" doesn't imply "not writeable". (It is perfectly
> possible for a thing to be both readable and writeable at the same
> time).

But "read only view" does imply not writeable.

> Let's just stick with "in". It's /already implemented/ in one of the
> places where it's needed, and let's face it, keywords don't get much
> shorter!

"In" doesn't imply "not out".  It also doesn't make much sense outside 
the context of a parameter.  In what?  For a regular variable calling it 
'in' sounds like it would be write-only to me.  As in "values can only 
go into the variable, not out."

I like "rov" (or even just "ro" like some other language that's been 
mentioned here, but I suppose the "v" would have to be in there to 
appease Walter.)

And while on the subject of "readonly", am I misreading this or is 
Walter basically the *only* one who thinks this sounds like it means 
"does not change ever".  I think if you did a study asking programmers 
to rank the unchanging-ness of various const words, you'd get a result 
with "readonly" coming out much weaker than "constant".  The fact that 
all the words mean effectively the same thing does not mean that 
everyone perceives the nuances in the same way.  And if an overwhelming 
majority perceive "readonly" to have weaker meaning than "constant" or 
"invariant" it seems reasonable to choose that or some variation of it 
as the word that means the weaker form.

--bb



More information about the Digitalmars-d mailing list