question/suggestion about protection attributes

Zarathustra adam.chrapkowski at gmail.com
Tue Dec 22 12:57:12 PST 2009


Why protection attributes aren't divided into two groups?
I mean:
module : package, private
class: protected, public

Then will be possible to set:
package protected - accessible for subclasses inside package
package public       - accessible in package (simply package)

private protected   - accessible for subclasses inside module
private public         - accessible in module (simply private)

A great idea is change private to class only, instead module and improve package (or other keyword) to:
package - module scope (private at now)
package(package_name) - some package visibility ex:

module a.b.c;

module a.d;

package (a) int var; - var is accessible for any module inside 'a' package.

What do you thing about it?



More information about the Digitalmars-d mailing list