Fix #2529: explicit protection package #3651
Dicebot via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Wed Aug 20 06:05:53 PDT 2014
On Wednesday, 20 August 2014 at 09:26:37 UTC, Kagamin wrote:
> On Wednesday, 20 August 2014 at 07:47:36 UTC, ketmar via
> Digitalmars-d-announce wrote:
>> but it requires to dump all 'subpackages' into one flat
>> directory and
>> with ugly names.
>
> Huh? If std.datetime and std.regex are subpackages of `std`
> package, it usually means, they should reside in `std`
> directory, no? And how explicit package protection can change
> that?
Your proposal makes such module layout illegal:
std.package1.module1
std.package1.module2
std.package1.subpackage.module1
std.package1.subpackage.module2
(can't have symbols in subpackage that are also available to
package1 but not whole std / public, must have
`subpackage_module1` instead, `package_1_subpackage_module1` if
it must be available for whole std)
It severely limits expressive power of package system for code
organization and encourages flat hierarchies with minimal
nesting. It also looks ugly - anyone seeing module name with
package name mangled in it will feel that there is something
wrong with the language if it needs to resort to such hacks.
More information about the Digitalmars-d-announce
mailing list