'package'

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 21 10:43:29 PDT 2014


On Monday, 21 July 2014 at 17:32:53 UTC, Manu via Digitalmars-d 
wrote:
> I'm having all sorts of visibility problems.
> I have this:
>
>   app/system/...
>   app/system/widgets/...
>
> The 'system'/manager should be able to access all the widgets 
> internals,
> but things outside the system shouldn't be able to touch the 
> internals.
> This is what 'package' is supposed to be for, except 'package' 
> in widgets
> only allows access to other widgets, 'system' level modules 
> have no
> access...
>
> Is there a workaround for this case? I'm not sure what to do.
>
> I guess the trouble is that 'package' specifies sibling modules 
> and below,
> but nothing above... but this isn't always the module structure.
> I'm thinking 'package' needs to know the top level that can 
> access
> internals. Perhaps this would solve my problem elegantly:
>
>   module app.system.widgets.widget;  // <- module is beneath 
> 'widgets'
>
>   package(app.system):
>   ...  internal stuff that 'app.system' (ie, the 'package') and 
> below can
> access ...
>
> Or is there an existing solution that I can't find?

https://github.com/D-Programming-Language/dmd/pull/3651


More information about the Digitalmars-d mailing list