Time to destroy Walter: breaking modules into packages

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Jun 6 04:47:29 PDT 2013


On 6/6/13, Max Samukha <maxsamukha at gmail.com> wrote:
> There is not much to debate. Get your hands dirty with a real
> project having more than two levels of packages and you'll see
> that the first is ultimately better.

I've argued the same thing before. And as a cream on top I'd like
allowing package on virtual methods. That way I can have internal
virtual methods which can be extended in other modules or modules in
subpackages (if the two features are supported). This allows me to
specialize behavior in subclasses, but at the same time disallows the
user from calling such methods (a final protected override comes
close, except it will still be callable in user-code).

Currently the way I work around this is to prepend an underscore to a
public virtual and not document the method. It's very much a
convention thing.

I could instead use some kind of template mixin.. but those are so
full of bugs that I eagerly avoid them.


More information about the Digitalmars-d mailing list