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

Howard Lovatt howard.lovatt at gmail.com
Tue Mar 29 20:05:47 CDT 2016


Yes, #module would be a nice addition and I like the #file and #modules
scope names since they can't clash with user defined names.

  -- Howard.

On 30 March 2016 at 11:47, Brent Royal-Gordon <brent at architechies.com>
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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160330/d6dc9294/attachment.html>


More information about the swift-evolution mailing list