D const design rationale

Robert Fraser fraserofthenight at gmail.com
Wed Jun 27 00:18:58 PDT 2007


I don't like "view"... it's too verby and doesn't really imply "you can't touch this" to me. readonly gets my vote, but then again, Walter was able to put const/final/invariant into D without adding a new keyword. On the other hand, he _did_ add ref when a more descriptive one (inout) was already in use... but that's a different issue.

Sean Kelly Wrote:

> Walter Bright wrote:
> > 
> >> or 'readonlyview' considered as an alternative for 'const'? I kind of 
> >> like the sound of 'readonly', and it doesn't make you think of C++ 
> >> 'const'... but maybe that's bad.
> > 
> > readonlyview is too long.
> 
> And why not just 'view' again?  It's short and seems to imply what's 
> being done.
> 
> 
> Sean




More information about the Digitalmars-d mailing list