'package'

Manu via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 21 23:22:45 PDT 2014


Awesome!
Here's hoping for swift inclusion! :)


On 22 July 2014 03:43, Dicebot via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

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


More information about the Digitalmars-d mailing list