should protected imply package?
Max Samukha
spambox at d-coding.com
Fri Sep 25 04:55:52 PDT 2009
Don wrote:
> Andrei Alexandrescu wrote:
>> In Java, "protected"-level protection implies package-level protection
>> (see e.g.
>> http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html).
>> Should we copy that behavior in D, or take advantage of the package
>> keyword and require it as in "package protected"?
>>
>>
>> Andrei
>
> Java might be a good source of inspiration.
>
> Sorting out what 'package' should mean is one of the big remaining
> issues in D. The current 'package' is a broken implementation of a
> broken concept. As in one of the bugzilla bugs "package does not work at
> all". But even if it did work as advertised, it would still suck.
>
> Can we announce it as deprecated until we work out what to do with it?
> We should discourage everyone from using it right now, it's completely
> broken.
What about deprecating "package" and employing "protected" to mean
"accessible from the package, its sub-packages and, if it is a class member,
from subclasses in other packages"? The model would be almost equivalent to
Java's except we don't need Java's "package-private" (no modifier) because
of D's "public by default, private is accessible from anywhere inside the
module".
More information about the Digitalmars-d
mailing list