IDEA: Use Unix-style chmod values for const and invariant

Kenny TM~ kennytm at gmail..com
Thu Nov 29 10:41:49 PST 2007


Russell Lewis wrote:
> Ok, I was pondering, trying to figure out some sort of syntax which 
> would allow us to communicate "const" and "invariant" in a way that's 
> easy to learn & remember.  Maybe we could learn from UNIX file 
> permissions, where you can see both the owner's permissions to the file, 
> and "other's" permissions.  In that case, we have these comparisons:
> 
> const:        rw-r--r--
> invariant:    r--r--r--
> 
> Which leads me to this concept for alternative keywords:
> 
> const:        const_wr
> invariant:    const_rr
> 
> Sure, the first time that a C++ programmer sees this, he won't know 
> exactly what it means, but it is (IMHO) easy to learn & remember.

But it's hard to read IMHO.


-- 
-- Kenny.



More information about the Digitalmars-d mailing list