[swift-evolution] SE-0025: Scoped Access Level, next steps

Jose Cheyo Jimenez cheyo at masters3d.com
Sun Mar 27 13:34:39 CDT 2016



> On Mar 27, 2016, at 7:21 AM, Maximilian Hünenberger <m.huenenberger at me.com> wrote:
> 
> I like the idea of protected (against extensions).
> However this raises the question whether extensions are also extensions of scope.
> 
> 
> Can "private(scope)" properties/functions be accessed from extensions?
I think the idea is for private-scope / local to not be seen from extensions in other files. I am not sure how that works for same file extensions.  
> 
> In your case:
> Is "protected" exactly like local? So it doesn't hide properties from extensions within the file?

Yes. just like local. 

> By making "private" scope based it is less private than "protected" which doesn't feel right to me. (Assuming extensions extend scope)
> 
> In my opinion "protected" should protect against other scopes/classes. Leaving "private" file based.

In essence there are two ideas floating around in my head:
1) give the new local / private-scope a unique name like 'secret' or 'protected' and keep everything else the same.  

2) redefine this new local / private-scope as just 'private', 
private-file becomes 'internal' , we find a new name for private-module like 'external' and we keep public as is. 

I'm am now leaning towards number 2. 

Public 
External (default)
Internal
Private





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160327/71dc815f/attachment.html>


More information about the swift-evolution mailing list