Note that allowing nested extensions will require breaking rules for access modifiers on all extensions. This is because, during revisions for SE-0025, the idea of aligning rules for extensions to rules for types was brought up and rejected. Subsequent proposals to do so also failed at various stages.<br><br>The current rule for types is as follows: the visibility of the type is the upper limit for visibility of its members. Members have an implicit access level of internal but may state any other access level, even if higher than the containing type, and the _effective_ access level will be restricted by the containing type. For example: `internal struct S { public var i: Int }` has a member that is _effectively_ internal.<br><br>The current rule for extensions is as follows: although extensions are a scope for the purposes of &quot;new private&quot;, they are not a first-class entity and have no existence in the type system. As such, they cannot be the upper limit for members. Instead, the access modifier for an extension is unique in Swift: it is regarded as a &quot;shorthand&quot; for the default access modifier for contained members and also the maximum permitted access level for those members; for example, inside a &quot;public extension&quot; the members default to public (not internal). Attempts to remove this behavior were fiercely rejected by those who want to use the shorthand to have an extension full of public members without restating &quot;public&quot;.<br><br>If, however, it is a &quot;private extension&quot;, then the default access modifier for members in that extension is &quot;fileprivate&quot;. This is correct *only* if extensions can never be nested. There is no spelling for the maximum possible visibility of a member inside a _nested_ private extension, and it is not permitted to state an explicit access level greater than that of the extension itself. If you want to support nested extensions, then this rule cannot continue. However, previous attempts at harmonizing these rules were not successful.<br><div class="gmail_quote"><div dir="ltr">On Mon, Mar 27, 2017 at 15:59 Vladimir.S via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 27.03.2017 20:00, Ross O&#39;Brien via swift-evolution wrote:<br class="gmail_msg">
&gt; I&#39;m considering this from a different angle.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; When we declare a type, we declare properties and functions which that type<br class="gmail_msg">
&gt; has.<br class="gmail_msg">
&gt; When we extend a type, we add functions to the type. (I&#39;m including<br class="gmail_msg">
&gt; computed properties in this.)<br class="gmail_msg">
&gt; It&#39;s become an idiom of Swift to declare an extension to a type for each<br class="gmail_msg">
&gt; protocol we want it to conform to, for reasons of code organisation and<br class="gmail_msg">
&gt; readability. This may be true even if conformance to the protocol was a<br class="gmail_msg">
&gt; primary intent of creating the type in the first place.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; The intent of the scoped access level is to allow programmers to create<br class="gmail_msg">
&gt; properties and functions which are limited to the scope of their<br class="gmail_msg">
&gt; declaration. A protocol conformance can be written, with the aid of helper<br class="gmail_msg">
&gt; functions, in the confidence that the helper functions are not visible<br class="gmail_msg">
&gt; outside the extension, minimising their impact on other components of the<br class="gmail_msg">
&gt; module.<br class="gmail_msg">
&gt; However, some protocol conformances require the type to have a specific<br class="gmail_msg">
&gt; property, which the extension cannot facilitate. Some protocol conformances<br class="gmail_msg">
&gt; don&#39;t require a property, but it would be really useful to have one, and<br class="gmail_msg">
&gt; again an extension can&#39;t facilitate.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Example: we want to be able to write this, but we can&#39;t:<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; privateprotocolBar<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; {<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   varinteger : Int{ get}<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   funcincrement()<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; }<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; structFoo<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; {<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; }<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; extensionFoo: Bar<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; {<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   varinteger : Int<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   privatevarcounter : Int<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   funcincrement()<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   {<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   counter += 1<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   }<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; }<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; This leads to a workaround: that properties are added to the original type,<br class="gmail_msg">
&gt; and declared as fileprivate. They&#39;re not intended to be visible to any<br class="gmail_msg">
&gt; scope other than the conforming extension - not even, really, to the type&#39;s<br class="gmail_msg">
&gt; original scope.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Continuing the example: we&#39;ve compromised and written this:<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; privateprotocolBar<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; {<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   varinteger : Int{ get}<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   funcincrement()<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; }<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; structFoo<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; {<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   fileprivatevarinteger : Int<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   fileprivatevarcounter : Int<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; }<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; extensionFoo: Bar<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; {<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   funcincrement()<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   {<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   counter += 1<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   }<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; }<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; This is not a fault of fileprivate (though it&#39;s a clunky name), or private.<br class="gmail_msg">
&gt; Renaming these levels does not solve the problem. Removing private, such<br class="gmail_msg">
&gt; that everything becomes fileprivate, does not solve the problem. The<br class="gmail_msg">
&gt; problem is in the extension system.<br class="gmail_msg">
&gt; (At this point I realise I&#39;m focusing on one problem as if it&#39;s the only one.)<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Supposing we approached extensions differently. I think around SE-0025 we<br class="gmail_msg">
&gt; were considering a &#39;nested&#39; access level.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Supposing we created a &#39;conformance region&#39; inside a type declaration - a<br class="gmail_msg">
&gt; scope nested within the type declaration scope - and that this conformance<br class="gmail_msg">
&gt; region had its own access level. It&#39;s inside the type declaration, not<br class="gmail_msg">
&gt; separate from it like an extension, so we can declare properties inside it.<br class="gmail_msg">
&gt; But literally the only properties and functions declared inside the region<br class="gmail_msg">
&gt; but visible anywhere outside of it, would be properties and functions<br class="gmail_msg">
&gt; declared in the named protocol being conformed to.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; So, visually it might look like this:<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; privateprotocolBar<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; {<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   varinteger : Int{ get}<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   funcincrement()<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; }<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; structFoo<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; {<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   conformance Bar // or conformance Foo : Bar, but since the region is<br class="gmail_msg">
&gt; inside Foo that&#39;s redundant<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   {<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   varinteger : Int // visible because Foo : Bar, at Bar&#39;s access level<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   varcounter : Int = 0// only visible inside the conformance scope, because<br class="gmail_msg">
&gt; not declared in Bar<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   funcincrement() // visible because Foo : Bar, at Bar&#39;s access level<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   {<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   counter += 1<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   }<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;   }<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; }<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; I&#39;ve introduced a new keyword, conformance, though it may be clear enough<br class="gmail_msg">
&gt; to keep using extension inside a scope for this. Foo still conforms to Bar,<br class="gmail_msg">
&gt; in the same file. We&#39;ve removed &#39;extension Foo :&#39; and moved a &#39;}&#39; for this,<br class="gmail_msg">
&gt; but that&#39;s not a breaking change as this is an addition. Readability is<br class="gmail_msg">
&gt; compromised to the extent that this conformance is indented one level.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; I&#39;ve not long had the idea. It&#39;s a different approach and may be worth a<br class="gmail_msg">
&gt; discussion thread of its own for - or someone might point out some<br class="gmail_msg">
&gt; glaringly obvious flaw in it. If it&#39;s useful, I don&#39;t know the full<br class="gmail_msg">
&gt; implications this would have, such as how much this would reduce the use<br class="gmail_msg">
&gt; of fileprivate (e.g. to none, to the minimal levels expected in SE-0025, or<br class="gmail_msg">
&gt; no effect at all). It&#39;s just intended to remove a problem<br class="gmail_msg">
&gt; which fileprivate is applied as a bad workaround for.<br class="gmail_msg">
<br class="gmail_msg">
IMO It seems like really great suggestion - I&#39;d like to discuss it in<br class="gmail_msg">
separate thread, so please start it if you are interested in this.<br class="gmail_msg">
<br class="gmail_msg">
Currently I think the proposal should allow extensions(not new keyword)<br class="gmail_msg">
inside type declaration, and such extensions should be allowed to to have<br class="gmail_msg">
stored properties and theirs &#39;scoped&#39; members should be inaccessible<br class="gmail_msg">
outside such extension declaration, but such extensions should be allowed<br class="gmail_msg">
to access &#39;scoped&#39; members of class (because such extension is defined in<br class="gmail_msg">
the same scope)<br class="gmail_msg">
<br class="gmail_msg">
I.e.<br class="gmail_msg">
<br class="gmail_msg">
class MyClass {<br class="gmail_msg">
   scoped var foo = 10<br class="gmail_msg">
<br class="gmail_msg">
   extension ProtoA {<br class="gmail_msg">
     scoped var bar = 20 // visible only in this extension(scope)<br class="gmail_msg">
     var baz = 30 // will be accessible as &#39;normal&#39; property of MyClass<br class="gmail_msg">
     func barFunc() { print(bar); print(foo); } // can access foo<br class="gmail_msg">
   }<br class="gmail_msg">
<br class="gmail_msg">
   extension ProtoB {<br class="gmail_msg">
     scoped var bar = 40 // visible only in this extension(scope)<br class="gmail_msg">
     //var baz = 50 // can&#39;t be re-definied here<br class="gmail_msg">
     func anotherFunc() { print(baz); print(foo); } // can access baz<br class="gmail_msg">
   }<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
I see such benefits of this:<br class="gmail_msg">
* We leave current model of extensions &quot;as is&quot;, no changes for extensions<br class="gmail_msg">
declared outside of the type.<br class="gmail_msg">
* IMO we need stored properties in extensions at least in the same file<br class="gmail_msg">
with type declaration(as was shown by discussion in the list) - and the<br class="gmail_msg">
proposed solution gives them to us<br class="gmail_msg">
* IMO this solution is better than just allow stored properties in<br class="gmail_msg">
extensions in the same file:<br class="gmail_msg">
   * in the latter case extension has no access to &#39;scoped&#39; members of type<br class="gmail_msg">
but this can be very useful to implement protocol conformance with help of<br class="gmail_msg">
internal(scoped) details, that should not be exposed to whole file level.<br class="gmail_msg">
   * with proposed solution it is clear that any memeber declared in<br class="gmail_msg">
extension block is a native part of type. We see all members in the same<br class="gmail_msg">
type declaration.<br class="gmail_msg">
   * proposed solution has a simple mental model - &quot;all that is defined<br class="gmail_msg">
inside type declaration is naturally a part of that type, &#39;scoped&#39; access<br class="gmail_msg">
&#39;uses&#39; same rules as usually&quot;.<br class="gmail_msg">
<br class="gmail_msg">
Vladimir.<br class="gmail_msg">
<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Ross<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; On Mon, Mar 27, 2017 at 4:26 PM, Rien via swift-evolution<br class="gmail_msg">
&gt; &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a> &lt;mailto:<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt;&gt; wrote:<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;     &gt; On 27 Mar 2017, at 16:46, Steven Knodl via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a> &lt;mailto:<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt;&gt; wrote:<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; Late to the party here<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; * What is your evaluation of the proposal?<br class="gmail_msg">
&gt;     &gt; I’m -1 on this.  The proposal is not a difficult read, but may have been simply more simply named “Remove Scoped Access Level/Revert SE-0025” as that is what is being proposed. “Fix” seems to me to be a unfortunately worded judgmental proposal title.<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; * Is the problem being addressed significant enough to warrant a change?<br class="gmail_msg">
&gt;     &gt; No.  I consider myself to be a fairly “new/n00b” Obj-C/Swift developer. Although SE-0025 was a change that required source changes when implemented, the reasoning was not difficult to understand and changes were simple to make once identified.   Here they are from SE-0025<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;       • public: symbol visible outside the current module<br class="gmail_msg">
&gt;     &gt;       • internal: symbol visible within the current module<br class="gmail_msg">
&gt;     &gt;       • fileprivate: symbol visible within the current file<br class="gmail_msg">
&gt;     &gt;       • private: symbol visible within the current declaration<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; Moving forward these changes are not difficult to comprehend.  I tend to make _everything_ “private” up front so I don’t have any API leakage.  Then dial back to “fileprivate” as needed.  It’s not difficult for me I guess.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;     Right. I do that myself more than I would like to admit.<br class="gmail_msg">
&gt;     But when we only loosen up/tighten down during coding then access<br class="gmail_msg">
&gt;     levels are almost useless.<br class="gmail_msg">
&gt;     The point of access level control is in the design, not in the coding.<br class="gmail_msg">
&gt;     If we made a design (including access levels) and then have to dial<br class="gmail_msg">
&gt;     back, that should be a warning that something is wrong.<br class="gmail_msg">
&gt;     To me, this is an argument in favour of the proposal.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;     Rien.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;     &gt;   As such, I don’t believe that this change was “Actively Harmful”,<br class="gmail_msg">
&gt;     especially for new developers who have a clean slate or simply are<br class="gmail_msg">
&gt;     leaving everything unmarked (internal) anyhow until they move up to<br class="gmail_msg">
&gt;     more advanced topics.  Unraveling a generic or functional code someone<br class="gmail_msg">
&gt;     else wrote uses way more cognitive power.<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; I’d like to address the suggestion that the migration for SE-0159<br class="gmail_msg">
&gt;     could “simply” be a search and replace without loss of functionality.<br class="gmail_msg">
&gt;     This doesn’t make sense if you consider the entire code lifecycle.<br class="gmail_msg">
&gt;     Sure the code gets migrated and compiles.  This is fine if they code<br class="gmail_msg">
&gt;     _never_ has to be read again.  But as we know, code is written once and<br class="gmail_msg">
&gt;     _read many times_ as it will need to be maintained.  The distinction<br class="gmail_msg">
&gt;     between private and fileprivate contains information, and although it<br class="gmail_msg">
&gt;     may work correctly now, some information meant to help maintain that<br class="gmail_msg">
&gt;     code has been lost if these keywords are merged and the functionality<br class="gmail_msg">
&gt;     of scoped access is removed.  So yes if you don’t maintain the code<br class="gmail_msg">
&gt;     where this migration takes place, this would be ok. But Swift strives<br class="gmail_msg">
&gt;     for readability.  Moving classes to separate files to address these<br class="gmail_msg">
&gt;     issues, creates a multitude of Bunny classes where again for<br class="gmail_msg">
&gt;     readability some classes belong together in the same file for ease of<br class="gmail_msg">
&gt;     comprehension (again, code is written once , read many times)<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; * Does this proposal fit well with the feel and direction of Swift?<br class="gmail_msg">
&gt;     &gt; The spirit of the proposal to simplify access levels is well taken.<br class="gmail_msg">
&gt;     This proposal however simplifies at the expense of lost functionality<br class="gmail_msg">
&gt;     (Scoped Access levels) with no replacement.  The threads talk a about<br class="gmail_msg">
&gt;     submodules and other solutions that could fill this gap that are not on<br class="gmail_msg">
&gt;     the roadmap, planned or possible which makes them  non-admissible in<br class="gmail_msg">
&gt;     considering this proposal.<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; * If you have used other languages, libraries, or package managers<br class="gmail_msg">
&gt;     with a similar feature, how do you feel that this proposal compares to<br class="gmail_msg">
&gt;     those?<br class="gmail_msg">
&gt;     &gt; I am more familiar with scoped access so perhaps that feels more<br class="gmail_msg">
&gt;     natural to me.  But with the current implementation Swift users can<br class="gmail_msg">
&gt;     choose whether they use File Based or Scope Based tools, so although<br class="gmail_msg">
&gt;     not ideal to either side, acceptable until a suitable replacement could<br class="gmail_msg">
&gt;     be forged.<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; * How much effort did you put into your review? A glance, a quick<br class="gmail_msg">
&gt;     reading, or an in-depth study?<br class="gmail_msg">
&gt;     &gt; Re-read SE-0025/proposal/most of this very long thread<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; From: &lt;<a href="mailto:swift-evolution-bounces@swift.org" class="gmail_msg" target="_blank">swift-evolution-bounces@swift.org</a><br class="gmail_msg">
&gt;     &lt;mailto:<a href="mailto:swift-evolution-bounces@swift.org" class="gmail_msg" target="_blank">swift-evolution-bounces@swift.org</a>&gt;&gt; on behalf of Tino Heth via<br class="gmail_msg">
&gt;     swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
&gt;     &lt;mailto:<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt;&gt;<br class="gmail_msg">
&gt;     &gt; Reply-To: Tino Heth &lt;<a href="mailto:2th@gmx.de" class="gmail_msg" target="_blank">2th@gmx.de</a> &lt;mailto:<a href="mailto:2th@gmx.de" class="gmail_msg" target="_blank">2th@gmx.de</a>&gt;&gt;<br class="gmail_msg">
&gt;     &gt; Date: Monday, March 27, 2017 at 6:48 AM<br class="gmail_msg">
&gt;     &gt; To: Zach Waldowski &lt;<a href="mailto:zach@waldowski.me" class="gmail_msg" target="_blank">zach@waldowski.me</a> &lt;mailto:<a href="mailto:zach@waldowski.me" class="gmail_msg" target="_blank">zach@waldowski.me</a>&gt;&gt;<br class="gmail_msg">
&gt;     &gt; Cc: &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a> &lt;mailto:<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt;&gt;<br class="gmail_msg">
&gt;     &gt; Subject: Re: [swift-evolution] [Review] SE-0159: Fix Private Access<br class="gmail_msg">
&gt;     Levels<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;&gt; I am now absolutely thrilled to create a filter to Mark As Read<br class="gmail_msg">
&gt;     anything else arising from this thread. Good luck.<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; That might be a good idea — after more than 200 messages, and a quite<br class="gmail_msg">
&gt;     circular discussion with an unhealthy amount of ignorance for the<br class="gmail_msg">
&gt;     opposing side ;-).<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; To fight the latter, I just tried to take the position that &quot;new<br class="gmail_msg">
&gt;     private&quot; is really important, and this imho leads to interesting<br class="gmail_msg">
&gt;     consequences...<br class="gmail_msg">
&gt;     &gt; This access modifier really doesn&#39;t solve a problem, like &quot;let&quot; does<br class="gmail_msg">
&gt;     (unless the problem you want to solve is having a language with private<br class="gmail_msg">
&gt;     access).<br class="gmail_msg">
&gt;     &gt; Have a look at this:<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; public struct SeperateConcerns {<br class="gmail_msg">
&gt;     &gt;        private var foo: Int = 0<br class="gmail_msg">
&gt;     &gt;        public mutating func updateFoo(_ value: Int) {<br class="gmail_msg">
&gt;     &gt;               print(&quot;The only allowed way to change foo was invoked&quot;)<br class="gmail_msg">
&gt;     &gt;               foo = value<br class="gmail_msg">
&gt;     &gt;        }<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;        private var bar: Int = 0<br class="gmail_msg">
&gt;     &gt;        public mutating func updateBar(_ value: Int) {<br class="gmail_msg">
&gt;     &gt;               print(&quot;The only allowed way to change bar was invoked&quot;)<br class="gmail_msg">
&gt;     &gt;               bar = value<br class="gmail_msg">
&gt;     &gt;        }<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;        private var foobar: Int = 0<br class="gmail_msg">
&gt;     &gt;        public mutating func updateFoobar(_ value: Int) {<br class="gmail_msg">
&gt;     &gt;               print(&quot;The only allowed way to change foobar was invoked&quot;)<br class="gmail_msg">
&gt;     &gt;               foobar = value<br class="gmail_msg">
&gt;     &gt;        }<br class="gmail_msg">
&gt;     &gt; }<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt;<br class="gmail_msg">
&gt;     &gt; You can protect foo from being changed by code in other files, and<br class="gmail_msg">
&gt;     from extensions in the same file — and if the latter is a concern,<br class="gmail_msg">
&gt;     there should also be a way to limit access to foo to specific function<br class="gmail_msg">
&gt;     in scope.<br class="gmail_msg">
&gt;     &gt; Afaik, somebody proposed &quot;partial&quot; type declarations, but without<br class="gmail_msg">
&gt;     them, the meaning of private is rather arbitrary, and the feature is<br class="gmail_msg">
&gt;     only useful for a tiny special case.<br class="gmail_msg">
&gt;     &gt; If we had partial types, the situation would be different, and if<br class="gmail_msg">
&gt;     would be possible to declare extensions inside a partial declaration of<br class="gmail_msg">
&gt;     another type, we could even remove fileprivate without an replacement<br class="gmail_msg">
&gt;     (I guess I should write a separate mail for this thought…)<br class="gmail_msg">
&gt;     &gt; _______________________________________________ swift-evolution<br class="gmail_msg">
&gt;     mailing list <a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
&gt;     &lt;mailto:<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt;<br class="gmail_msg">
&gt;     <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
&gt;     &lt;<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a>&gt;<br class="gmail_msg">
&gt;     &gt; _______________________________________________<br class="gmail_msg">
&gt;     &gt; swift-evolution mailing list<br class="gmail_msg">
&gt;     &gt; <a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a> &lt;mailto:<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt;<br class="gmail_msg">
&gt;     &gt; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
&gt;     &lt;<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a>&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;     _______________________________________________<br class="gmail_msg">
&gt;     swift-evolution mailing list<br class="gmail_msg">
&gt;     <a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a> &lt;mailto:<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt;<br class="gmail_msg">
&gt;     <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
&gt;     &lt;<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a>&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; _______________________________________________<br class="gmail_msg">
&gt; swift-evolution mailing list<br class="gmail_msg">
&gt; <a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
&gt;<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div>