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

forkit forkit at gmail.com
Thu Jun 9 21:44:51 UTC 2022


On Thursday, 9 June 2022 at 13:15:14 UTC, Ola Fosheim Grøstad 
wrote:
>
> And I guess that also is the situation for D, most D users care 
> more about convenience than strictness...

I think this is true, particulary for 'core'.

I think this is why private is considered as a restrictive move, 
instead of an enhancement ;-)

But whatever....

I'm going to spend some time on Swift now (having never used it 
before).

It looks really interesting - and already has proper access 
modifiers ;-)

It also has what initially attracted me to D too (which was the 
convenience of using arrays with the [..] magic.

This too looks interesting:

// array of any items
let anything: [Any] = [1, "a", 3.14]

https://theswiftdev.com/beginners-guide-to-swift-arrays/


More information about the Digitalmars-d mailing list