Extended Type Design.

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Sat Mar 17 09:37:52 PDT 2007


Derek Parnell wrote:
> On Fri, 16 Mar 2007 15:54:26 -0700, Walter Bright wrote:
> 
>> Derek Parnell wrote:
>>> Given ...
>>>
>>>    int[int**][]*[char[]][3][17][3,17]* x;
>>>
>>> and I want to make the 'x' immutable and the 'char[]' immutable, how does
>>> one write the declaration? Where does one place the 'final'/'const'/'super
>>> const' and where do the parenthesis go?
>> final int[int**][]*[ const(char[]) ][3][17][3,17]* x;
> 
> Are you serious???? 
> 
> I want 'x' to be immutable so I need to use 'final' and place it the
> furtherest away from what is is qualifying.
> 
> I want 'char[]' to be immutable so I must use 'const' and place it next to
> what it is qualifying plus use parenthesis around its target too.
> 
> Why do you think that this is intuitive, consistent, and easy to read?

Because you didn't suggest a better design. :o)

Andrei



More information about the Digitalmars-d mailing list