The scala idea is interesting, has anyone used it extensively to understand how 
well it works in practice? Is it too fiddly? Do you spend too much time 
thinking about access levels. 

> On Mar 29, 2016, at 5:47 PM, Brent Royal-Gordon via swift-evolution 
> <[email protected]> wrote:
> 
>> If Scala style access modifiers were adopted for Swift then a private(file) 
>> modifier would also be necessary to give the current private functionality.
> 
> I could imagine having these options:
> 
>       public                                                  // visible to 
> all everyone
>       private(scope-name, scope-name, …)      // visible to specified scopes 
> (plus current scope)
>       private                                                 // visible only 
> to current scope
> 
> scope-name could perhaps be:
> 
> * A type name (or Self, which would mimic C++-style private, or perhaps even 
> C++-style protected depending on how we treat inheritance)
> * A module name (or #module for the current module)
> * A file name string (or #file for the current file)
> 
> And then the default would simply be `private(#module)`.
> 
> Alternatively, the parameterized level could be given a different name, like 
> `internal` or `shared`. If that were the case, then `#module` might simply be 
> the default.
> 
> -- 
> Brent Royal-Gordon
> Architechies
> 
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to