Module visibility feature?

Jeremy DeHaan dehaan.jeremiah at gmail.com
Mon Jul 22 15:13:19 PDT 2013


On Monday, 22 July 2013 at 01:33:02 UTC, Martin Nowak wrote:
> On 07/17/2013 01:33 PM, Jeremy DeHaan wrote:
>> So I was reading this:
>> http://wiki.dlang.org/Access_specifiers_and_visibility
>>
>>
>>
>> After I went through it, I had an idea for a feature that I 
>> hope would
>> be both intuitive and not too difficult to implement.
>>
> There is
> http://wiki.dlang.org/DIP22 and
> https://github.com/D-Programming-Language/dmd/pull/739.
> I think that the visibility vs. accessibility distinction 
> inherited from C++ is not a good fit for D's module system. For 
> C++ headers are the mean to hide implementation but that is not 
> a good solution for D modules. There are not many reasons to 
> make private symbols visible and I suggested a consistent rule 
> to handle overloads with mixed protection.

To some degree, these do cover the same kind of thing, but I'm 
not talking about module members, I'm talking about the module 
itself. I feel like there should be ways to stop an entire module 
from even being imported as this clearly says that what ever is 
in the module is an implementation, and you shouldn't even know 
that that module exists. Being able to import a module that only 
contains things that aren't accessible sounds like an odd thing 
to me.


More information about the Digitalmars-d mailing list