[swift-evolution] [Review] SE-0159: Fix Private Access Levels

Drew Crawford drew at sealedabstract.com
Sat Mar 25 00:26:06 CDT 2017

On March 24, 2017 at 11:20:59 PM, Jonathan Hull (jhull at gbis.com) wrote:

You were the one who said redundancy was a *goal* of swift, which it is not.
You misunderstand.  I'm arguing that the design of Swift is to have concept pairs – private/fileprivate, class/struct, let/var – in which one element of the pair is a superset of the other.  That is: we could convert a let/var program to use only var, we could convert a private/fileprivate program to use only fileprivate, etc., and yet we stubbornly persist to have all these keywords.

This property has been labeled "redundancy" by people who dislike it.  I'm saying that whatever unkind name we decide to call it, it's a Swiftism, and we embraced it a long time ago.

Perhaps I just do not understand your argument, but it seems to be

In your examples above, Swift is projecting a system image which is much simpler than the underlying concepts... For access controls, the user is being presented with the full complexity of that choice directly.
This seems simply inaccurate to me.  For example, I am the top search result for "swift struct or class" and my explanation is 27 pages.  Admittedly I am an insufferably longwinded writer who can't find the delete key, but for whatever reason Google seems to think my explanation is helpful to people struggling with that topic.

While it is true that access control presents users the "the full complexity of that choice directly", this is because the choice is not actually complex.  One keyword is visible to a file and the other to a scope.  I could not produce 27 pages on that topic.

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

More information about the swift-evolution mailing list