[swift-evolution] [Review] SE-0159: Fix Private Access Levels
david.ronnqvist at gmail.com
Tue Mar 21 11:19:41 CDT 2017
> What is your evaluation of the proposal?
I’m positive towards this proposal in isolation. It’s a step in the right direction. But I also feel that it doesn’t fully address the larger issue around access control.
> Is the problem being addressed significant enough to warrant a change to Swift?
The larger problem of access control definitely is. I can agree that the changes of SE-0025 were confusing and could be seen as harmful. If there’s a larger overhaul of access control coming in the future, then I’m not certain that the fileprivate/private problem is significant enough to warrant a change. But if there might be some time before there is a chance to revisit access control, then this might be significant enough to do now.
> Does this proposal fit well with the feel and direction of Swift?
> If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
Objective-C effectively has a file based private access by not really having access control 😉 and commonly putting “private” declarations in a category in the .m file.
Languages like Java has access control that is more targeted towards subclassing, where files doesn’t matter.
Languages like Haskell has access control based on files or modules, largely because of free functions.
Swift isn’t exactly like either of these. It has proper enforceable access control, it has protocols and extensions, it prefers properties and member functions over free functions.
I can’t think of any other language that has both a private and a file private scope. And if Swift were to have only one (again), then file private feels right for Swift, mainly for its use in same-file extensions.
> How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
Read the proposal and participated in one of the the discussions leading up to it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution