My design need friends

Namespace rswhite4 at googlemail.com
Sat Oct 5 15:02:34 PDT 2013


On Saturday, 5 October 2013 at 21:57:58 UTC, Namespace wrote:
> On Saturday, 5 October 2013 at 21:46:19 UTC, Adam D. Ruppe 
> wrote:
>> It isn't really a fix, but in these situations what I've been 
>> doing in my code is just writing:
>>
>> // don't use this
>> /* private */ final public void foo() {}
>>
>> final makes sure it doesn't get overridden wrongly, and then 
>> the comments make my intention a little more clear.
>
> Yeah, or I let the render method uncommented, so that nobody 
> can see it in the resulting DDoc. :D
> But this is no real solution. Maybe we should convince Walter 
> for something like 'friend'?
> I know that we have something similar with classes in the same 
> module, but that is ugly and unuseable in my situation.

Something that would expand the package modifier, so that it 
belongs to the main package and not to the subpackage, would also 
fulfill the purpose. Something like 'internal'.


More information about the Digitalmars-d-learn mailing list