[Issue 2529] 'package' access qualifier should allow access to sub-packages
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Aug 4 05:56:23 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2529
Don <clugdbug at yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |clugdbug at yahoo.com.au
--- Comment #3 from Don <clugdbug at yahoo.com.au> 2010-08-04 05:56:19 PDT ---
IMHO, this bug should be closed as invalid, because the initial suggestion in
the bug report is completely wrong: it would drive you to put low-level stuff
in the root, and derived stuff in the leaves. Implementing that suggestion
would encourage poor design.
The current behaviour of 'package' in D seems nearly identical to the one in
Java. Java has the same problem.
Here is a Java proposal to fix the problem, which was ultimately rejected.
http://jcp.org/en/jsr/detail?id=294
"Today designers are forced to declare elements of the program that are needed
by other subparts of the implementation as public - thereby making them
globally accessible, which is clearly suboptimal.
Alternately, the entire implementation can be placed in a single package. This
resolves the issue above, but is unwieldy, and exposes all internals of all
subparts to each other. "
I also found this link to be helpful:
http://stackoverflow.com/questions/403583/what-is-the-use-of-package-level-protection-in-java
---
I can't really escape the feeling that 'package' is a bit of a flawed concept.
The problems with it don't seem easy to fix.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list