selective import

Alexandr Druzhinin drug2004 at bk.ru
Thu Dec 5 05:39:09 PST 2013


05.12.2013 20:34, Dicebot пишет:
> On Thursday, 5 December 2013 at 11:17:18 UTC, Alexandr Druzhinin wrote:
>> I don't see difference, but it doesn't mean it doesn't exist. What do
>> you think about it?
>
> It depends on how bar uses foo. You should do public import of symbols
> from foo if they are required to interact with bar public API. If foo is
> only used as part of internal implementation, it should be kept private
> and both modules imported explicitly.
Third module uses both Bar and Foo. So I should either import every 
module individually, or import Bar only but Bar should publicly import 
Foo - that's the question.


More information about the Digitalmars-d-learn mailing list