<div dir="ltr">Hey, Robert!<div><br></div><div>Thanks for your feedback.</div><div><br></div><div>I do believe that it is a common practice, and a good one as well, to have your code broken down into separate extensions, either for improving code readability by reducing the size of the implementation file, as well as creating context for feature development.</div><div><br></div><div>Also, I do agree that one should have separate classes, structs, enums or whatever better fits the purpose, handle code regarding a single responsibility. However, should this responsibility remain within the scope of the type we&#39;re implementing it on, it&#39;s best to have the code split into separate extensions on separate files (so to avoid large and hard to inspect files), and have these extensions access members which, would <b>no longer</b> <b>be visible</b> to the whole module. I do believe, having these members marked as <b>internal</b> creates the conditions for one to <i>scatter</i> and <i>decompose </i>a type since it opens the door for type in the module to lay hands on it&#39;s members. <b>Typeprivate</b> would prevent these members to be accessed from everywhere in the module, while enabling them to be reached from everywhere within their type.</div><div><br></div><div>Also, I believe that having the scope of a member limited by file scope does does fall short in fitting a language design purpose, as file is a compiler related construct which could, in turn, be replaced somewhere in time, thus leaving the “fileprivate” access member orphaned.</div><div><br></div><div>Best,</div><div>Gonçalo</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-11-29 16:13 GMT+00:00 Robert Widmann <span dir="ltr">&lt;<a href="mailto:devteam.codafi@gmail.com" target="_blank">devteam.codafi@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Is that a particularly common case?  I haven’t written code that needs access patterns like this and it strikes me as strange that anything you’re willing to expose to extensions scattered throughout your codebase you’d also prefer not to export throughout a module that you have complete control over.  Sure, it might be “cleaner” to scope your variables to the implementation, but past a certain point it just seems to encourage extreme decomposition and scattering of a single class or structure when you should be separating your implementation into multiple classes and structures.</div><div><div class="h5"><br><div><blockquote type="cite"><div>On Nov 29, 2016, at 11:07 AM, Gonçalo Alvarez Peixoto &lt;<a href="mailto:goncalo.alvarezpeixoto@gmail.com" target="_blank">goncalo.alvarezpeixoto@gmail.<wbr>com</a>&gt; wrote:</div><br class="m_4304599494662500647Apple-interchange-newline"><div><div dir="ltr">Robert,<div><br></div><div>Thanks for your feedback.</div><div><br></div><div>However, I tend to disagree with you. </div><div><br></div><div><span style="font-size:12.800000190734863px"><i>&quot;The proposal, as it stands, does nothing to indicate how this is much different from internal - all examples given would trivially be solved by internal members.&quot;</i></span><br></div><div>This proposal aims at covering all of the cases in which you <b>do not want</b> to expose your properties <b>internally. </b>For instance, you might want to access a member of a view controller from an extension of this view controller on another file, but not make it accessible from other members in the module (which is what <b>internal </b>does).</div><div><br></div><div>Best,</div><div>Gonçalo</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-11-29 15:53 GMT+00:00 Robert Widmann <span dir="ltr">&lt;<a href="mailto:devteam.codafi@gmail.com" target="_blank">devteam.codafi@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>The proposal, as it stands, does nothing to indicate how this is much different from internal - all examples given would trivially be solved by internal members.  I don’t think we need finer-grained access control to address this, I think we need extensions, at least in the same file as their parent declarations, to be able to define variables.</div><br><div><blockquote type="cite"><div><div class="m_4304599494662500647h5"><div>On Nov 29, 2016, at 10:24 AM, Gonçalo Alvarez Peixoto via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_4304599494662500647m_6032781764413388469Apple-interchange-newline"></div></div><div><div><div class="m_4304599494662500647h5"><div dir="ltr">Hello, everyone!<div><br></div><div>I would like to introduce a new proposal to swift evolution, but first I would love to run it by all of you so I get everyone&#39;s feedback and enrich it.</div><div><br></div><div>This proposal consists of introducing a new <b>typeprivate </b>access control level which allows for members to be accessed in all extensions of a given <b>type,</b> whether lying within or in another file.</div><div><br></div><div>You&#39;ll find the proposal draft in:</div><div><a href="https://github.com/goncaloalvarez/swift-evolution/blob/master/proposals/NNNN-introduce-typeprivate-access-control-level.md" target="_blank">https://github.com/goncaloalva<wbr>rez/swift-evolution/blob/maste<wbr>r/proposals/NNNN-introduce-<wbr>typeprivate-access-control-<wbr>level.md</a></div><div><br></div><div>Thanks in advance for taking the time to evaluate the proposal.</div><div><br></div><div>Best regards,</div><div>Gonçalo</div></div></div></div><span>
______________________________<wbr>_________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a><br></span></div></blockquote></div><br></div></blockquote></div><br></div>
</div></blockquote></div><br></div></div></div></blockquote></div><br></div>