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

Piotr Duda duda.piotr at gmail.com
Wed Jun 8 11:14:47 UTC 2022


On Wednesday, 8 June 2022 at 13:11 forkit via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Wednesday, 8 June 2022 at 11:02:45 UTC, Ola Fosheim Grøstad
> wrote:
> > On Wednesday, 8 June 2022 at 10:30:59 UTC, Ola Fosheim Grøstad
> > wrote:
> >> They would also ask what "private class" means. If you are
> >> gonna do it, do at least propose a proper keyword for it:
> >> local, hidden, internal…
> >
> > Btw, the original OOP syntax from Simula is **HIDDEN** and
> > **PROTECTED**. So there is some precedent for this.
>
> I wouldn't object to 'hidden int x'.
>
> This would solve the problem of 'private (this)' and 'private
> this()' being too close syntactically.

Or copy delphi and use 'strict private' (and 'strict protected').



More information about the Digitalmars-d mailing list