how to make private class member private
psychoticRabbit
meagain at meagain.com
Tue Mar 13 07:39:04 UTC 2018
On Tuesday, 13 March 2018 at 07:05:48 UTC, rikki cattermole wrote:
> Your thought model is much younger than modules. Modules have
> existed since the mid 70's.
> They work, other designs over the years have proven to have
> faults and problems.
>
> D's design is evolved from already existing ideas to try and
> give the best of both worlds and modules is no different.
>
> The reality is, Java and C++ both are great examples where
> module system was added after many years too late. D had it
> built in from the get go and was designed to benefit from it.
I don't have any objection to the idea that a module can have
privileged access to members of classes within that model. It
sounds sensible enough, if the module is a level of encapsulation
also.
My arguments is that, this was implemented in D, at the cost of
removing the capacity for a class in the same module to protect
it's own members (within the module). That's what I don't like
about it.
My other objection, as stated, is that D uses the same syntax as
C++/C#/Java, but the semantics of that same syntax are completely
different. I also don't like that.
More information about the Digitalmars-d-learn
mailing list