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

Tejas notrealemail at gmail.com
Fri Jun 10 02:15:54 UTC 2022


On Thursday, 9 June 2022 at 21:44:51 UTC, forkit wrote:
> 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/

We also have those:

https://dlang.org/library/std/variant/variant_array.html


More information about the Digitalmars-d mailing list