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

Max Samukha maxsamukha at gmail.com
Wed Jun 8 08:23:31 UTC 2022


On Wednesday, 8 June 2022 at 06:56:50 UTC, Walter Bright wrote:
>
> The unit of encapsulation in D is the module, not the class.

Why is it less of an abomination? Class is the unit of 
encapsulation by the very definition of OOP. D just forces you 
into the class-per-module paradigm, basically redefining modules 
as classes. That is just as abominable, given friends are rare in 
"properly" designed OOP code.


More information about the Digitalmars-d mailing list