<div dir="ltr">On Tue, Feb 21, 2017 at 9:34 PM, Robert Widmann <span dir="ltr">&lt;<a href="mailto:devteam.codafi@gmail.com" target="_blank">devteam.codafi@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><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>Let’s use some code to illustrate things.  </div><div><br></div><div><span class=""><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span style="font-variant-ligatures:no-common-ligatures">// FooUtilities.swift</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span style="font-variant-ligatures:no-common-ligatures">//</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span style="font-variant-ligatures:no-common-ligatures">// -module-name=Foo</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span style="font-variant-ligatures:no-common-ligatures">// module Foo {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span style="font-variant-ligatures:no-common-ligatures">// Defines Foo.Utilities</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">module Utilities {</span></div></span><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">internal</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">func</span><span style="font-variant-ligatures:no-common-ligatures"> visibleInThisSubmodule() {}</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">}</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span style="font-variant-ligatures:no-common-ligatures">//}</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span style="font-variant-ligatures:no-common-ligatures">// FooUtilities+MoreUtilities.<wbr>swift</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(186,45,162)"><span style="font-variant-ligatures:no-common-ligatures">extension</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000"> Foo.</span><span style="font-variant-ligatures:no-common-ligatures;color:#703daa">Utilities</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000"> {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">private</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">func</span><span style="font-variant-ligatures:no-common-ligatures"> privateHelper() {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    visibleInThisSubmodule()</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">  }</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">}</span></div></div></div></blockquote><div><br></div><div>Either I&#39;m entirely misunderstanding what you&#39;re trying to illustrate, or this is totally unresponsive to Brent&#39;s question. In either case, I&#39;ll let Brent ask his own question from here.</div><div><br></div><div><br></div><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><div class="h5"><div><blockquote type="cite"><div>On Feb 21, 2017, at 10:31 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="m_-8399339113952707005Apple-interchange-newline"><div><div dir="ltr">On Tue, Feb 21, 2017 at 9:29 PM, Robert Widmann <span dir="ltr">&lt;<a href="mailto:devteam.codafi@gmail.com" target="_blank">devteam.codafi@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><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>Once again, internal is your keyword.  An extension allows you to “open and expand” the module boundary here, which is exactly what you want here - to extend this module across file boundaries without showing your cards to an external consumer of your framework. </div></div></blockquote><div><br></div><div>Sorry, I don&#39;t understand. Does your design support the use case below? I don&#39;t think it does. Are you replying that supporting the use case below is not a goal of your proposal? If so, please just say so.</div><div><br></div><div><br></div><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><div class="m_-8399339113952707005h5"><div><blockquote type="cite"><div>On Feb 21, 2017, at 10:26 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="m_-8399339113952707005m_-6709346236215180382Apple-interchange-newline"><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">On Tue, Feb 21, 2017 at 9:08 PM, Robert Widmann via swift-evolution<span class="m_-8399339113952707005m_-6709346236215180382Apple-converted-space"> </span><span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evoluti<wbr>on@swift.org</a>&gt;</span><span class="m_-8399339113952707005m_-6709346236215180382Apple-converted-space"> </span>wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Sorry, been replying to multiple sub-threads today.<br><br><br>For bar(), because you wish to be able to<br><br>1) Not export it across the outermost module boundary<br>2) But still use it internally<br><br>Internal access is required.  Any higher and you would export (violating 1), any lower and you wouldn’t be able to internally import (violating 2).<br><br>For baz(), because you wish to be able to<br><br>1) Not export it across the outermost module boundary,<br>2) Or even your own internal submodule boundary<br></blockquote><div> </div><div>3) But still use it within the same submodule, across different file boundaries: this is the feature that many people have stated they want to emerge out of a submodule design.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Private or fileprivate suffices depending on the scoping you wish for it to have within the file/interface it’s a part of relative to the other APIs in the submodule.<br><div class="m_-8399339113952707005m_-6709346236215180382HOEnZb"><div class="m_-8399339113952707005m_-6709346236215180382h5"><br>&gt; On Feb 21, 2017, at 10:04 PM, Brent Royal-Gordon &lt;<a href="mailto:brent@architechies.com" target="_blank">brent@architechies.com</a>&gt; wrote:<br>&gt;<br>&gt; I specified two different behaviors for `bar()` and `baz()`. I see now that you describe `internal` as having the behavior I want for `bar()`. Is there a way I can get the behavior I want for `baz()`?<br>&gt;<br>&gt; --<br>&gt; Brent Royal-Gordon<br>&gt; Sent from my iPhone<br>&gt;<br>&gt; On Feb 21, 2017, at 6:51 PM, Robert Widmann &lt;<a href="mailto:devteam.codafi@gmail.com" target="_blank">devteam.codafi@gmail.com</a>&gt; wrote:<br>&gt;<br>&gt;&gt;&gt; What access modifiers do I put on `bar()` and `baz()` so that `MyMod` can access `bar()` but not `baz()`, and code outside `MyMod` can access neither `bar()` nor `baz()`?<br>&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; internal<br><br>______________________________<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" rel="noreferrer" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a></div></div></blockquote></div></div></div></div></blockquote></div><br></div></div></div></blockquote></div><br></div></div>
</div></blockquote></div><br></div></div></div></blockquote></div><br></div></div>