Extended Type Design.

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Fri Mar 16 18:50:25 PDT 2007


Daniel Keep wrote:
> 
> 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;
> 
> Hmm... I think either one of you (Walter and Andrei) got bitten by the
> "you have to put parens around the type or it'll get final'ed, too"
> thing, or one of you got bitten by the "is this going to make it final?
>  Jeeze, I dunno; better put parens in just in case."

No, in this context the parens would be simply optional. Only when const 
occurs at top level it will engulf the symbol too.

Andrei



More information about the Digitalmars-d mailing list