June 16, 2022
On Thursday, 16 June 2022 at 07:16:56 UTC, Ola Fosheim Grøstad wrote:
> On Thursday, 16 June 2022 at 01:04:22 UTC, forkit wrote:
>> On Thursday, 16 June 2022 at 00:06:14 UTC, forkit wrote:
>>>
>>
>> see .. the world does not come crashing down, simply because you can declare something private ;-)
>>
>>
>> (in Swift)
>>
>> // -----------
>> struct A
>> {
>>   private static var x = 100;
>>   fileprivate static var z = 200;
>> }
>>
>> //print(A.x); //  error: 'x' is inaccessible due to 'private' protection level
>> print(A.z); // ok
>>
>> // -----------
>
> Swift has 5 different access control modes:
>
> - private: as in C++
> - file private: for the source file
> - internal: for a collection of sources files constituting a module
> - open access: allows subclassing and override outside the module
> - public: …
>
> Swift also does some conservative analysis of references, preventing writing to references if there is an alias that would make it a conflict:
>
> https://docs.swift.org/swift-book/LanguageGuide/MemorySafety.html

yes, in essence, the everything is global in a Swift module, much like like D (at least conceptually). Although the module concept is different in Swift (being a bunch of file that make up module - which i like much better than the D concept).

So Swift provides that same convenience as D, of not having to state anything, and just go about writing code, if that's your style.

But it allows people to 'choose' a style -> private (scope private), and fileprivate (private to the file).

I mean, choice is good right?

Well, I like it anyway.

June 16, 2022
On Thursday, 16 June 2022 at 08:51:26 UTC, Olivier Pisano wrote:
>
> Yes, every once in a while we get such discussions when someone finds out that D doesn't work exactly like [insert one's favorite language here] and pretends that is THE cause of the lack of popularity of D.
>

[insert one's favorite language here]

like this you mean:

[some of the most popular and widely used languages in the world]

June 16, 2022
On Thursday, 16 June 2022 at 07:45:52 UTC, Kagamin wrote:
>
> ..
> Also memoization is a use case for varying access between different methods of the same class. Would you address that too?

I got no idea what that is all about.

I just want to make a private variable in my class, private to the class ;-)
June 16, 2022
On Thursday, 16 June 2022 at 08:51:26 UTC, Olivier Pisano wrote:
> If you really want to add a new visibility level to D, you'll have to write a DIP and convince the community that the existing four are not enough.

Exactly. Maybe someone thought that the new attrib would be added just by complaining on the forums ? This topic comes so often that I'm surprised no one has written that DIP yet.

I volonteer but be warned I'll propose to introduce "super private".

June 16, 2022
On Thursday, 16 June 2022 at 09:01:56 UTC, Basile B. wrote:
>
> I volonteer but be warned I'll propose to introduce "super private".

No that is ambiguous because it sounds like it's private to the super class.

It absolutely cannot use the super keyword.
June 16, 2022
On Thursday, 16 June 2022 at 08:51:26 UTC, Olivier Pisano wrote:
>
>
> If you really want to add a new visibility level to D, you'll have to write a DIP and convince the community that the existing four are not enough. Pretending that you'll be leaving for [whatever language better fits your needs] may only indicate that you don't care.

I aware that 'actual' change can only occur with DIP ;-)

Unless of course you're Walter, in which case, you can just wake up one morning and put ImportC into the langauge..... and the whole D community now has to deal with that, like it or not.

Walter will refuse it regardless. Even if he's forced to accept it, cause the community demands it, which compiler person in D do you think is going to have to implement it? Walter of course - and he'll make sure it's high on his agenda, no doubt.

He has also around him, people that seem to think as he does.

That never turns out well.

June 16, 2022
On Thursday, 16 June 2022 at 09:04:25 UTC, bauss wrote:
> On Thursday, 16 June 2022 at 09:01:56 UTC, Basile B. wrote:
>>
>> I volonteer but be warned I'll propose to introduce "super private".
>
> No that is ambiguous because it sounds like it's private to the super class.
>
> It absolutely cannot use the super keyword.

allright, I give up then ;)
June 16, 2022
On Thursday, 16 June 2022 at 08:55:52 UTC, forkit wrote:
> On Thursday, 16 June 2022 at 08:51:26 UTC, Olivier Pisano wrote:
>>
>> Yes, every once in a while we get such discussions when someone finds out that D doesn't work exactly like [insert one's favorite language here] and pretends that is THE cause of the lack of popularity of D.
>>
>
> [insert one's favorite language here]
>
> like this you mean:
>
> [some of the most popular and widely used languages in the world]

Which doesn't mean it would fit in D and play well with other D features.

Especially since everyone has different favorite.


June 16, 2022
On Thursday, 16 June 2022 at 09:54:48 UTC, Olivier Pisano wrote:

>> world]
>
> Which doesn't mean it would fit in D and play well with other D features.

Module-private already doesn't play well with other D features ('invariant()', 'synchronized')

>
> Especially since everyone has different favorite.


June 16, 2022

On Thursday, 16 June 2022 at 09:58:27 UTC, Max Samukha wrote:

>

On Thursday, 16 June 2022 at 09:54:48 UTC, Olivier Pisano wrote:

> >

world]

Which doesn't mean it would fit in D and play well with other D features.

Module-private already doesn't play well with other D features ('invariant()', 'synchronized')

In what way are they affected?