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

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Wed Jun 8 13:14:43 UTC 2022


On Wednesday, 8 June 2022 at 12:49:27 UTC, Max Samukha wrote:
> For example, 'this' as the name for constructors/destructors is 
> an improvement over C++.

I dislike the reuse of terminology for different concepts, so I 
prefer «constructor» like in TypeScript, although I guess the C++ 
solution makes sense because you can conceptualize it as a call 
to function with the same name as the class.

Anyway it is possible to create a parser/grammar without 
reserving so many keywords (or reusing them). I don't think there 
is a good reason for having "@safe" and "@pure", the grammar 
ought to be unambiguous with "safe" and "pure" without making 
them keywords.




More information about the Digitalmars-d mailing list