'package'

Manu via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 21 08:20:43 PDT 2014


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140722/e1388ecf/attachment-0001.html>


More information about the Digitalmars-d mailing list