www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - suggestion / request - package access

reply Ant <Ant_member pathlink.com> writes:
what if we could specify a list of packages that could access the scope?

module myLib1.a;

class A
{
   package(mylib1, mylib2):
   this(void* ugglyCtorData){}
   public:
   this(){}
   void that(){}
   package(mylib1, mylib2) void theOther(){}
}

Ant
Nov 12 2004
parent "Walter" <newshound digitalmars.com> writes:
"Ant" <Ant_member pathlink.com> wrote in message
news:cn39i7$1ibq$1 digitaldaemon.com...
 what if we could specify a list of packages that could access the scope?

 module myLib1.a;

 class A
 {
    package(mylib1, mylib2):
    this(void* ugglyCtorData){}
    public:
    this(){}
    void that(){}
    package(mylib1, mylib2) void theOther(){}
 }

That's starting to look like the C++ 'friend' access morass <g>. All you really need to do is group the packages as sub-packages under an enclosing one. If that still won't cover it, I suggest that the protection specifier really should be 'protected' or 'public' anyway.
Nov 12 2004