On Friday, 18 May 2018 at 12:26:14 UTC, Gheorghe Gabriel wrote:

Good idea. Or: private(this)
Because using "this" it is easier tu put this code in a mixin for multiple classes.
Example:

string var = "private(this) var;";

class A {
    mixin(var);
}

class B {
    mixin(var);
}

As clean and uncontroversial as this proposal might be, it unfortunately doesn't resolve the biggest issue. If you try to write Java code in D, you're still going to be using private, and you're still going to be caught by surprise. And this is another step in the direction of C++ (we need to think of beginning programmers every so often) so there are costs. It's possible that since I rarely use classes I'm not seeing the large benefits.

Reply via email to