Const sucks
Bruno Medeiros
brunodomedeiros+spam at com.gmail
Tue Sep 11 02:55:44 PDT 2007
Bruno Medeiros wrote:
> Derek Parnell wrote:
>>
>>> o const and invariant now mean "fully const" and "fully invariant",
>>> where fully means "head and tail combined":
>>
>> Remind me again what the difference between 'const' and 'invariant' is.
>>
>
> 'invariant' = constant
> 'const' = read-only
>
> It's simple I think.
>
I must withdraw somewhat my comment that "it's simple", since
"read-only" is indeed a somewhat subjective term. If you think read-only
as in permissions, you get the intended meaning. But if you think
read-only as in memory (ROM), as Bill mentioned, you get the same
meaning as constant. Still, I think the "read-only as in permissions"
meaning for "read-only" is becoming more prevalent as it is more...
meaningful.
--
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
More information about the Digitalmars-d
mailing list