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

Jordan Rose jordan_rose at apple.com
Wed Mar 30 19:09:37 CDT 2016


> On Mar 30, 2016, at 16:30, Brent Royal-Gordon <brent at architechies.com> wrote:
> 
> While working that out, I also came up with a new suggestion for keywording if we keep just these four levels and don't generalize `fileprivate` into an "internal, with limitations" mechanism:
> 
> * public
> * moduleinternal
> * internal
> * private
> 
> This version saddles only the module access level, which rarely needs to be typed explicitly, with an awkward compound keyword. The file access level (which I suspect is more often necessary than many in this thread believe) gets a single, simple keyword. Additionally, by having only one gobbledygook access level, when you *do* see the gobbledygook keyword you don't have to try to parse it.
> 
> This does have the disadvantage of not matching C#'s meaning of `internal`; we could do something else, like `shared`/`moduleshared`, instead. But I'm not sure how valuable that correspondence is.

I maintain that anyone with a coding convention of "always write an access modifier" will be very upset with this.

Jordan


More information about the swift-evolution mailing list