<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Title content=""><meta name=Keywords content=""><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Arial;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Courier New";
        panose-1:2 7 3 9 2 2 5 2 4 4;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:2 11 6 9 3 8 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.apple-tab-span
        {mso-style-name:apple-tab-span;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1384058918;
        mso-list-template-ids:-2095692902;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style></head><body bgcolor=white lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>Late to the party here <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>* What is your evaluation of the proposal?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>I&#8217;m -1 on this.  The proposal is not a difficult read, but may have been simply more simply named &#8220;Remove Scoped Access Level/Revert SE-0025&#8221; as that is what is being proposed. &#8220;Fix&#8221; seems to me to be a unfortunately worded judgmental proposal title.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>* Is the problem being addressed significant enough to warrant a change?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>No.  I consider myself to be a fairly &#8220;new/n00b&#8221; 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<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p>&nbsp;</o:p></span></p><ul style='margin-top:0in' type=disc><li class=MsoNormal style='mso-list:l0 level1 lfo1'><span style='font-size:11.0pt;font-family:Calibri'>public: symbol visible outside the current module<o:p></o:p></span></li><li class=MsoNormal style='mso-list:l0 level1 lfo1'><span style='font-size:11.0pt;font-family:Calibri'>internal: symbol visible within the current module<o:p></o:p></span></li><li class=MsoNormal style='mso-list:l0 level1 lfo1'><span style='font-size:11.0pt;font-family:Calibri'>fileprivate: symbol visible within the current file<o:p></o:p></span></li><li class=MsoNormal style='mso-list:l0 level1 lfo1'><span style='font-size:11.0pt;font-family:Calibri'>private: symbol visible within the current declaration<o:p></o:p></span></li></ul><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>Moving forward these changes are not difficult to comprehend.  I tend to make _<i>everything</i>_ &#8220;private&#8221; up front so I don&#8217;t have any API leakage.  Then dial back to &#8220;fileprivate&#8221; as needed.  It&#8217;s not difficult for me I guess.   As such, I don&#8217;t believe that this change was &#8220;Actively Harmful&#8221;,  especially for new developers who have a clean slate or simply are leaving everything unmarked (internal) anyhow until they move up to more advanced topics.  Unraveling a generic or functional code someone else wrote uses way more cognitive power. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>I&#8217;d like to address the suggestion that the migration for SE-0159 could &#8220;simply&#8221; be a search and replace without loss of functionality.  This doesn&#8217;t make sense if you consider the entire code lifecycle.  Sure the code gets migrated and compiles.  This is fine if they code _<i>never</i>_ has to be read again.  But as we know, code is written once and _<i>read many times</i>_ as it will need to be maintained.  The distinction between private and fileprivate contains information, and although it may work correctly now, some information meant to help maintain that code has been lost if these keywords are merged and the functionality of scoped access is removed.  So yes if you don&#8217;t maintain the code where this migration takes place, this would be ok. But Swift strives for readability.  Moving classes to separate files to address these issues, creates a multitude of Bunny classes where again for readability some classes belong together in the same file for ease of comprehension (again, code is written once , read many times)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>* Does this proposal fit well with the feel and direction of Swift?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>The spirit of the proposal to simplify access levels is well taken.  This proposal however simplifies at the expense of lost functionality (Scoped Access levels) with no replacement.  The threads talk a about submodules and other solutions that could fill this gap that are not on the roadmap, planned or possible which makes them  non-admissible in considering this proposal.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>* If you have used other languages, libraries, or package managers with a similar feature, how do you feel that this proposal compares to those?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>I am more familiar with scoped access so perhaps that feels more natural to me.  But with the current implementation Swift users can choose whether they use File Based or Scope Based tools, so although not ideal to either side, acceptable until a suitable replacement could be forged.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'>Re-read SE-0025/proposal/most of this very long thread<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:Calibri'><o:p>&nbsp;</o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-family:Calibri;color:black'>From: </span></b><span style='font-family:Calibri;color:black'>&lt;swift-evolution-bounces@swift.org&gt; on behalf of Tino Heth via swift-evolution &lt;swift-evolution@swift.org&gt;<br><b>Reply-To: </b>Tino Heth &lt;2th@gmx.de&gt;<br><b>Date: </b>Monday, March 27, 2017 at 6:48 AM<br><b>To: </b>Zach Waldowski &lt;zach@waldowski.me&gt;<br><b>Cc: </b>&lt;swift-evolution@swift.org&gt;<br><b>Subject: </b>Re: [swift-evolution] [Review] SE-0159: Fix Private Access Levels<o:p></o:p></span></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal><br><br><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><div><p class=MsoNormal><span style='font-size:9.0pt;font-family:Arial'>I am now absolutely thrilled to create a filter to Mark As Read anything else arising from this thread. Good luck.<o:p></o:p></span></p></div></div></blockquote></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>That might be a good idea &#8212; after more than 200 messages, and a quite circular discussion with an unhealthy amount of ignorance for the opposing side ;-).<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>To fight the latter, I just tried to take the position that &quot;new private&quot; is really important, and this imho leads to interesting consequences...<o:p></o:p></p></div><div><p class=MsoNormal>This access modifier really doesn't <i>solve</i> a problem, like &quot;let&quot; does (unless the problem you want to solve is having a language with private access).<o:p></o:p></p></div><div><p class=MsoNormal>Have a look at this:<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><div><p class=MsoNormal><span style='font-size:8.5pt;font-family:Menlo;color:#BA2DA2'>public</span><span style='font-size:8.5pt;font-family:Menlo'> <span style='color:#BA2DA2'>struct</span> SeperateConcerns {<o:p></o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo'>       </span></span><span style='font-size:8.5pt;font-family:Menlo;color:#BA2DA2'>private</span><span style='font-size:8.5pt;font-family:Menlo'> <span style='color:#BA2DA2'>var</span> foo: <span style='color:#703DAA'>Int</span> = <span style='color:#272AD8'>0</span><o:p></o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo'>       </span></span><span style='font-size:8.5pt;font-family:Menlo;color:#BA2DA2'>public</span><span style='font-size:8.5pt;font-family:Menlo'> <span style='color:#BA2DA2'>mutating</span> <span style='color:#BA2DA2'>func</span> updateFoo(<span style='color:#BA2DA2'>_</span> value: <span style='color:#703DAA'>Int</span>) {<o:p></o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo;color:black'>              </span></span><span style='font-size:8.5pt;font-family:Menlo;color:#3E1E81'>print</span><span style='font-size:8.5pt;font-family:Menlo;color:black'>(</span><span style='font-size:8.5pt;font-family:Menlo;color:#D12F1B'>&quot;The only allowed way to change foo was invoked&quot;</span><span style='font-size:8.5pt;font-family:Menlo;color:black'>)</span><span style='font-size:8.5pt;font-family:Menlo;color:#D12F1B'><o:p></o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo'>              </span></span><span style='font-size:8.5pt;font-family:Menlo;color:#4F8187'>foo</span><span style='font-size:8.5pt;font-family:Menlo'> = value<o:p></o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo'>       </span></span><span style='font-size:8.5pt;font-family:Menlo'>}<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:8.5pt;font-family:Menlo'><o:p>&nbsp;</o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo'>       </span></span><span style='font-size:8.5pt;font-family:Menlo;color:#BA2DA2'>private</span><span style='font-size:8.5pt;font-family:Menlo'> <span style='color:#BA2DA2'>var</span> bar: <span style='color:#703DAA'>Int</span> = <span style='color:#272AD8'>0</span><o:p></o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo'>       </span></span><span style='font-size:8.5pt;font-family:Menlo;color:#BA2DA2'>public</span><span style='font-size:8.5pt;font-family:Menlo'> <span style='color:#BA2DA2'>mutating</span> <span style='color:#BA2DA2'>func</span> updateBar(<span style='color:#BA2DA2'>_</span> value: <span style='color:#703DAA'>Int</span>) {<o:p></o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo;color:black'>              </span></span><span style='font-size:8.5pt;font-family:Menlo;color:#3E1E81'>print</span><span style='font-size:8.5pt;font-family:Menlo;color:black'>(</span><span style='font-size:8.5pt;font-family:Menlo;color:#D12F1B'>&quot;The only allowed way to change bar was invoked&quot;</span><span style='font-size:8.5pt;font-family:Menlo;color:black'>)</span><span style='font-size:8.5pt;font-family:Menlo;color:#D12F1B'><o:p></o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo'>              </span></span><span style='font-size:8.5pt;font-family:Menlo;color:#4F8187'>bar</span><span style='font-size:8.5pt;font-family:Menlo'> = value<o:p></o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo'>       </span></span><span style='font-size:8.5pt;font-family:Menlo'>}<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:8.5pt;font-family:Menlo'><o:p>&nbsp;</o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo'>       </span></span><span style='font-size:8.5pt;font-family:Menlo;color:#BA2DA2'>private</span><span style='font-size:8.5pt;font-family:Menlo'> <span style='color:#BA2DA2'>var</span> foobar: <span style='color:#703DAA'>Int</span> = <span style='color:#272AD8'>0</span><o:p></o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo'>       </span></span><span style='font-size:8.5pt;font-family:Menlo;color:#BA2DA2'>public</span><span style='font-size:8.5pt;font-family:Menlo'> <span style='color:#BA2DA2'>mutating</span> <span style='color:#BA2DA2'>func</span> updateFoobar(<span style='color:#BA2DA2'>_</span> value: <span style='color:#703DAA'>Int</span>) {<o:p></o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo;color:black'>              </span></span><span style='font-size:8.5pt;font-family:Menlo;color:#3E1E81'>print</span><span style='font-size:8.5pt;font-family:Menlo;color:black'>(</span><span style='font-size:8.5pt;font-family:Menlo;color:#D12F1B'>&quot;The only allowed way to change foobar was invoked&quot;</span><span style='font-size:8.5pt;font-family:Menlo;color:black'>)</span><span style='font-size:8.5pt;font-family:Menlo;color:#D12F1B'><o:p></o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo'>              </span></span><span style='font-size:8.5pt;font-family:Menlo;color:#4F8187'>foobar</span><span style='font-size:8.5pt;font-family:Menlo'> = value<o:p></o:p></span></p></div><div><p class=MsoNormal><span class=apple-tab-span><span style='font-size:8.5pt;font-family:Menlo'>       </span></span><span style='font-size:8.5pt;font-family:Menlo'>}<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:8.5pt;font-family:Menlo'>}<o:p></o:p></span></p></div></div><div><p class=MsoNormal><span style='font-size:8.5pt;font-family:Menlo'><br><br><o:p></o:p></span></p></div><div><p class=MsoNormal>You can protect foo from being changed by code in other files, and from extensions in the same file &#8212; and if the latter is a concern, there should also be a way to limit access to foo to specific function in scope.<o:p></o:p></p></div><div><p class=MsoNormal>Afaik, somebody proposed &quot;partial&quot; type declarations, but without them, the meaning of private is rather arbitrary, and the feature is only useful for a tiny special case.<o:p></o:p></p></div><div><p class=MsoNormal>If we had partial types, the situation would be different, and if would be possible to declare extensions inside a partial declaration of another type, we could even remove fileprivate without an replacement (I guess I should write a separate mail for this thought&#8230;)<o:p></o:p></p></div><p class=MsoNormal>_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution <o:p></o:p></p></div></body></html>