Extended Type Design.

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Fri Mar 16 17:42:21 PDT 2007


Bill Baxter wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> Sean Kelly wrote:
>>> For what it's worth, I like: 'final', 'view', and 'const' the best. 
>>> They're all short and meaningful, given the intent for each.
>>
>> The problem with 'view' is that it's a noun, while final and const are 
>> adjectives. It's very awkward to use 'view':
>>
>> view int * p = &x; // huh?
>>
>> Andrei
> 
> And 'view' is also probably a very popular name for a variable thanks to 
> things like the "Model-View-Controller" paradigm.
> 
> http://www.google.com/codesearch?q=view&hl=en&btnG=Search+Code

However, viewonly is a possibility that's particularly expressive. As 
much as I'm wary of collapsed words, this is the contender I like the 
most. It's a bit long though, and given that it's also the most heavily 
used, it would lead to long lines.

But, as Walter put it very wisely: addressing immutability is a big 
problem, and syntax is only a fraction of it.


Andrei



More information about the Digitalmars-d mailing list