Using closure in function scope to make "real" private class members

forkit forkit at gmail.com
Sun Jun 5 00:30:14 UTC 2022


On Saturday, 4 June 2022 at 23:11:24 UTC, Ali Çehreli wrote:
>
> I man not resisting this idea but your presentation of it. You 
> present it as if D is broken. I asked for your arguments for 
> favoring per-class encapsulation vs. per-module encapsulation. 
> I haven't seen those arguments yet but I suspect you favor 
> class because other languages do so.

Again (how many time do I have to say this??), my argument is not 
favouring one or the other. It's favouring the 'option' to have 
both.


> - Why do you favor 'class' over module?

Again, I don't. How many times do I have to say this??


>
> (me) In the end though, encapsulation of a class, in D, is 
> broken
>
> (you) That is wrong.

Again, you pick only part of my argument so that it suits your 
agenda.

Here is what I actually wrote:

"In the end though, encapsulation of a class, in D, is broken, 
and cannot be statically verified by the compiler, unless you put 
that class in it's own file (which is what you're expected to do 
anyway, based on the reponses this idea always provoke)."

It's pointless for me to discuss an issue with people who are 
clearly ideologically opposed to it.

So I won't ;-)





More information about the Digitalmars-d mailing list