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

forkit forkit at gmail.com
Sun Jun 5 03:28:38 UTC 2022


On Sunday, 5 June 2022 at 01:32:45 UTC, Ali Çehreli wrote:
> On 6/4/22 04:15, forkit wrote:
>
> > You normally come up with ideas to issues that people raise
>
> Has anyone suggested the following syntax yet?
>
> class C {
>   private class:
>     // really private
>
>   private module:
>     // module-level as today
>
>   private:
>     // same as 'private module'
> }
>
> If there are syntax issues, perhaps paranthesis can work:
>
>   private(class):
>
> Ali

See. I knew you could do it ;-)

All it takes is an open mind -> not wanting to be forced into 
thinking the way a language wants you to think.



More information about the Digitalmars-d mailing list