On Sunday, 12 June 2022 at 23:29:29 UTC, forkit wrote:
I don't get it.
How does this enable one module to access the private parts of
another module?
It doesn't. But what you were describing in your post is
package-level access. By keeping it the cross-module access in a
subpackage, package is "private" to that subpackage.
Isn't 'private' *always* private to the module?
Yes, which is why it doesn't allow cross-module access.
The idea I had, was to be able to spread a 'module' over more
than one file - for the purpose of encapsulating this and that
in different physical files, while *still* protecting the
'private is private to the module' concept.
You can't spread modules across multiple files.
But if D has a one-to-one mapping between a module and a file,
and if private is always private to the one module, then this
could never work.
Not with private. But what I described is the same effect.