const

Christopher Wright dhasenan at gmail.com
Thu Apr 3 04:21:11 PDT 2008


Walter Bright wrote:
> Don Clugston wrote:
>> Ditto. Come on, even non-programmers know what "read only access" means.
>> I find it hard to believe there would be many people who'd have 
>> trouble grasping the idea that "read only" means "look but don't 
>> touch". Are there any languages where 'readonly' is used for putting 
>> values into ROM?
> 
> Yes, there are C extensions to do just that. Secondly, there is often 
> hardware memory protection available, which has a "read only" bit. That 
> means the data cannot be changed. Files marked "read only" cannot be 
> written to by anyone. Read only has a long history of meaning immutable 
> by anything, not just the viewer.

$ ls -l something
-rw-r--r-- 1 gareis gareis 42 2008-02-27 18:14 something

That file is readonly, unless you're me. And I'm free to change that.

I don't find it compelling that some C extensions use readonly to put 
stuff in ROM, since C# is much more popular than probably all those C 
extensions combined and uses readonly to mean "cannot reassign outside a 
constructor".



More information about the Digitalmars-d mailing list