April 30
On Saturday, 27 April 2024 at 05:44:15 UTC, NotYouAgain wrote:
> On Saturday, 27 April 2024 at 01:41:54 UTC, Jonathan M Davis wrote:
>>..
>> ...
>> - Jonathan M Davis
>
> As usual, the only solution you can provide to the problems that I've very clear outline, are put the class in it's own module.

Yes, that's the solution. It works right now. Adding a feature to the language requires justifying its cost, and I haven't seen anything in this thread that does, *especially* since the user always has the option of creating a module for every class if they so wish.

April 30
On Tuesday, 30 April 2024 at 00:01:00 UTC, NotYouAgain wrote:
> The source of all this, can be trace back to the D designer who decided to change the "right and obvious" meaning of private.
>
> That was a mistake. It's not that the module private is wrong, that certainly has a place, but changing the meaning of private, was a mistake that D has to live with.

It's not "wrong". It's just a different philosophy, like with transitive const.
You can claim something is "logical const" but still modify internal state, or you enforce that something that is claimed const can really not be modified whatsoever.
Neither of the two is "wrong", it's just different and you can not easily translate between the two.
With private you can claim something is not accessed by other stuff within the same file (by declaring it "private to the class"), but this is only "logical private", because effectively if you have access to a file, you can access everything in that file, no matter how "private" it is.
But if something is in a different file, you can enforce that someone cannot access (aka modify) what is in there. Maybe simply by making the file readonly, but there are also stronger protection measures possible.

As I said in the other thread: A black-box test (for example something that tests the encapsulation of an object) shall not have the possibility to modify the object under test. So it cannot be in the same file. If you implement it in the same file and claim privacy, you are lying to yourself. It is simply not true.

In both cases (const and private) C++ allows the programmer to lie to himself (which is convenient, I confess) and D enforce correct behaviour (which is inconvenient at times).
I prefer the D philosophy.

I have nothing against private(this), it's convenient, you are right.
But I hate it if someone insist to call the other philosophy "wrong". That is what provoces so much resistence in these threads. Your chances to get the feature you want so much will become much higher, if you refreign from insulting others.
April 30
I've refrained so far from deleting any posts in this thread that still had on-topic content. However, I've had to delete several now, and I've had enough complaints about the tenor of this thread that I can declare it's been disruptive, so let's shut it down here.

Given Atila's comment, the idea doesn't have a chance of approval anyway. If anyone wants to submit a DIP for it, feel free. But if you do it, you're pretty much tilting at windmills.

I welcome anyone who wants to discuss the idea civilly to start a new thread.
1 2 3 4 5 6 7 8 9 10
Next ›   Last »