Const sucks

Janice Caron caron800 at googlemail.com
Tue Sep 11 04:09:21 PDT 2007


I always think of "read only" as meaning "a read only VIEW". Examples
abound: e.g. opening a file in read-only mode. Even the read-only attribute
of a file (which you can change).

Still - another keyword you might consider appropriate to the meaning "read
only view" is "in". Now there's a thought;

Oh - and here's something else I'd like to be able to do. Instead of:

 class C
 {
     private int my_n;
     public int n() { return my_n; }

     /* all my private code refers to my_n */
 }

I'd like to be able to do

 class C
 {
     (privately read-write but publicly read-only) int n;

     /* all my private code refers to n */
 }

That would be cool.
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20070911/a3124e14/attachment.html>


More information about the Digitalmars-d mailing list