Extended Type Design.
Sean Kelly
sean at f4.ca
Fri Mar 16 16:19:14 PDT 2007
Andrei Alexandrescu (See Website For Email) wrote:
> Benji Smith wrote:
>> Andrei Alexandrescu (See Website For Email) wrote:
>>> We've shoved keywords like "readonly" and "view" for a while, and
>>> they just added more confusion than cleared, at a high cost. If (as I
>>> suspect) super const appears relatively infrequently, it might be
>>> fine to just encode it as the mildly verbose "super const". In fact,
>>> it's shorter than "keepyourgrubbyhandsoff". :o)
>>
>> Really? I'd think super const would be used all the time. Anywhere a
>> class has some invariant field, it'll probably be expressed as super
>> const (if I'm understanding correctly that super const is the
>> equivalent of #define constants in C++ or static final constants in
>> Java).
>
> No. super const deals with pointers and transitivity. Final deals with
> non-rebindable symbols. I'd be hard pressed to think of many examples
> where class members are transitively immutable.
Well this explains a lot. I'd misunderstood as well.
Sean
More information about the Digitalmars-d
mailing list