On Thursday, 17 May 2018 at 02:32:07 UTC, KingJoffrey wrote:
I propose an idea, for discussion (robust discussion even better ;-)


Add an new attribute to class, named 'sealed'.

If class level protection is added, please do not call it sealed.
People from c++ might be suprised by 'private' already. We do not have to confuse those c#ies too.

Module level protection is enough to hide implementation details though. So while i do understand why you want this in D, i don't think it is worth it to complicate the language for something you can work around easily by putting the classes in their own modules. I'm also not convinced think that your 'sealed' would be used much, because accessing private state in the module is actually extremly useful (e.g. unittests).

That beeing said, if you are convinced it would be a good addition, please write a DIP. Even if it will not be accepted it will at least force a decision. And we can point to the reasons it got accepted/rejected in the future.

Reply via email to