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

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Wed Jun 8 10:30:59 UTC 2022


On Wednesday, 8 June 2022 at 10:20:37 UTC, bauss wrote:
> On Wednesday, 8 June 2022 at 10:00:37 UTC, Ola Fosheim Grøstad 
> wrote:
>>
>> My view is that all of the proposed syntaxes are bad and would 
>> be confusing to people coming to the language.
>>
>
> But so is the current behavior to people that come to the 
> language.
>
> I see people asking every other week about why something isn't 
> "private".

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…

Anything simple is better than @keyword, private(this), private 
class etc. Such syntax screams "amateur project" and I wouldn't 
even consider downloading a language like that. When I first 
tried D it was because the syntax looked clean (way before the 
@madness caught on).





More information about the Digitalmars-d mailing list