Extending D's support for object-oriented design with private(this)
NotYouAgain
NotYouAgain at gmail.com
Sat Apr 27 13:02:02 UTC 2024
On Saturday, 27 April 2024 at 12:41:55 UTC, Richard (Rikki)
Andrew Cattermole wrote:
> On 27/04/2024 9:18 PM, NotYouAgain wrote:
>> so, it seems, at least 2 problems indentified in this
>> discussion, can now be solved with private(this).
>>
>> 1 - It can (apparently) resolve an issue with synchronized
>> classes (I' don't pretend to understand them)
>
> It does not resolve them.
>
> It enables a programmer who knows that an issue exists to
> prevent it.
> The same programmer who wrote that module.
>
> It could be solved by doing something like this internally and
> automatically. No need for a DIP exposing this capability.
but with private(this), the issue wouldn't exist in the first
place.
Am I correct? (I'm not saying I am, I'm asking the question,
since i don't know what synchronized classes are).
private(this) is for preventing issues from arising in the first
place, not fixing them after they arise.
More information about the dip.ideas
mailing list