<html><head></head><body><br> <br><div class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">-- <br>Adrian Zubarev<br>Sent with Airmail</div></div> <p class="gmail_quote" style="color:#000;">Am 30. Juni 2016 um 12:13:10, Adrian Zubarev (<a href="mailto:adrian.zubarev@devandartist.com">adrian.zubarev@devandartist.com</a>) schrieb:</p> <blockquote type="cite" class="gmail_quote"><span><div><div></div><div>
<title></title>
We *could* remove the group keyword, but there is a problem with
that. It becomes really strange when you'll try nesting labeled
groups.
<div><br></div>
<div>```seift</div>
<div>public {</div>
<div> labelName {</div>
<div><br></div>
<div> func member() {}</div>
<div> }</div>
<div>}</div>
<div>```</div>
<div><br></div>
<div>It is an interesting suggestion to use extensions that way,
but how would you nest and create diffrent label pathes with
extensions? </div>
<div><br></div>
<div>We also cannot nest extensions (yet) and when it comes to
conformances the access modier is not allowed on extensions. That
is one of my points to remove this behavior from extensions and
have equal access contol on extensions like on classes etc.!<br>
<br>
<div class="bloop_sign">
<div style="font-family:helvetica,arial;font-size:13px">
-- <br>
Adrian Zubarev<br>
Sent with Airmail</div>
</div>
<p class="gmail_quote" style="color:#000;">Am 30. Juni 2016 um
12:04:59, Haravikk (<a href="mailto:swift-evolution@haravikk.me">swift-evolution@haravikk.me</a>)
schrieb:</p>
<blockquote type="cite" class="gmail_quote"><span></span>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span></span>
<div><span></span></div>
<div><span><br class=""></span>
<div><span></span>
<blockquote type="cite" class=""><span></span>
<div class=""><span>On 29 Jun 2016, at 22:41, David Sweeris via
swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</span></div>
<span><br class="Apple-interchange-newline"></span>
<div class=""><span></span>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span>Speaking of C++, is the “group” keyword even
necessary? To borrow your own example from earlier, it seems like
we could just as easily say this:</span>
<div class=""><span></span>
<div style="margin: 0px; line-height: normal;" class="">
<span></span>
<div style="font-family: Menlo; color: rgb(187, 44, 162); margin: 0px; line-height: normal;" class=""><span><span style="font-variant-ligatures: no-common-ligatures;" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">struct</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> A
{</span></span></div>
<div style="font-family: Menlo; color: rgb(187, 44, 162); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> { </span><span style="color: rgb(0, 132, 0);" class="">// all public</span></div>
<div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> member1() {}</span></div>
<div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> member2() {}</span></div>
<div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> member3() {}</span></div>
<div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="color: rgb(187, 44, 162);" class="">
</span>}</div>
<div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="color: rgb(187, 44, 162); font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="color: rgb(187, 44, 162); font-variant-ligatures: no-common-ligatures;" class="">public</span><span style="color: rgb(187, 44, 162); font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">labelName</span> {<span style="color: rgb(0, 132, 0);" class="">// all public, accessible under
`foo.lableName`</span></div>
<div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> member4() {}</span></div>
<div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> member5() {}</span></div>
<div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> member6() {}</span></div>
<div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> }</span></div>
<div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div>
<div class="">(which is not C++’s syntax, I know… the comment just
got me thinking about it is all)</div>
<div class=""><br class=""></div>
<div class="">- Dave Sweeris</div>
</div>
</div>
</div>
</div>
</blockquote>
<br class=""></div>
<div>This form is interesting, but personally when it comes to
grouping I've become a huge fan of using focused extensions,
meaning my type declarations are usually nothing but the bare
minimum definition for stored properties and required constructors,
everything else goes into the most relevant extension.</div>
<div><br class=""></div>
<div>As such it seems to me like this feature request could be
handled by two features; named extensions, and access modifiers on
extensions, so I could do something like so:</div>
<div><br class=""></div>
<div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre"></span>public struct A { … }</font></div>
<div><font face="Monaco" class=""><br class=""></font></div>
<div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre"></span>// My awesome labelName
implementation</font></div>
<div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre"></span>public extension A.labelName
{</font></div>
<div></div>
<div></div>
<div><span class="Apple-tab-span" style="font-family: Monaco; white-space: pre;"></span><span style="font-family: Monaco;" class="">func member4() { … }</span></div>
<font face="Monaco" class=""><span class="Apple-tab-span" style="white-space: pre;"></span>func member5() { … }</font>
<div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space: pre;"></span>func member6() { … }</font></div>
<div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre"></span>}</font></div>
<div><br class=""></div>
<div>Here the public modifier changes the default for functions
without a modifier of their own, purely for convenience (as they
can still be overridden if I need a private method to implement
them) and the label lets me organise them under the parent type.
Multiple such extensions could be specified for the same label,
with their own default access and/or type constraints.</div>
<div><br class=""></div>
<div>So yeah, grouping is handy, but I think that extensions
already provide a good way to achieve this, and it would make more
sense to focus any additions onto them.</div>
</div>
</div>
</blockquote>
</div>
</div></div></span></blockquote></body></html>