<html><head><style>
body {
        font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
        padding:1em;
        margin:auto;
        background:#fefefe;
}
h1, h2, h3, h4, h5, h6 {
        font-weight: bold;
}
h1 {
        color: #000000;
        font-size: 28pt;
}
h2 {
        border-bottom: 1px solid #CCCCCC;
        color: #000000;
        font-size: 24px;
}
h3 {
        font-size: 18px;
}
h4 {
        font-size: 16px;
}
h5 {
        font-size: 14px;
}
h6 {
        color: #777777;
        background-color: inherit;
        font-size: 14px;
}
hr {
        height: 0.2em;
        border: 0;
        color: #CCCCCC;
        background-color: #CCCCCC;
display: inherit;
}
p, blockquote, ul, ol, dl, li, table, pre {
        margin: 15px 0;
}
a, a:visited {
        color: #4183C4;
        background-color: inherit;
        text-decoration: none;
}
#message {
        border-radius: 6px;
        border: 1px solid #ccc;
        display:block;
        width:100%;
        height:60px;
        margin:6px 0px;
}
button, #ws {
        font-size: 12 pt;
        padding: 4px 6px;
        border-radius: 5px;
        border: 1px solid #bbb;
        background-color: #eee;
}
code, pre, #ws, #message {
        font-family: Monaco;
        font-size: 10pt;
        border-radius: 3px;
        background-color: #F8F8F8;
        color: inherit;
}
code {
        border: 1px solid #EAEAEA;
        margin: 0 2px;
        padding: 0 5px;
}
pre {
        border: 1px solid #CCCCCC;
        overflow: auto;
        padding: 4px 8px;
}
pre > code {
        border: 0;
        margin: 0;
        padding: 0;
}
#ws { background-color: #f8f8f8; }
.bloop_markdown table {
border-collapse: collapse;
font-family: Helvetica, arial, freesans, clean, sans-serif;
color: rgb(51, 51, 51);
font-size: 15px; line-height: 25px;
padding: 0; }
.bloop_markdown table tr {
border-top: 1px solid #cccccc;
background-color: white;
margin: 0;
padding: 0; }
.bloop_markdown table tr:nth-child(2n) {
background-color: #f8f8f8; }
.bloop_markdown table tr th {
font-weight: bold;
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }
.bloop_markdown table tr td {
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }
.bloop_markdown table tr th :first-child, table tr td :first-child {
margin-top: 0; }
.bloop_markdown table tr th :last-child, table tr td :last-child {
margin-bottom: 0; }
.bloop_markdown blockquote{
border-left: 4px solid #dddddd;
padding: 0 15px;
color: #777777; }
blockquote > :first-child {
margin-top: 0; }
blockquote > :last-child {
margin-bottom: 0; }
code, pre, #ws, #message {
word-break: normal;
word-wrap: normal;
}
hr {
display: inherit;
}
.bloop_markdown :first-child {
-webkit-margin-before: 0;
}
code, pre, #ws, #message {
font-family: Menlo, Consolas, Liberation Mono, Courier, monospace;
}
.send { color:#77bb77; }
.server { color:#7799bb; }
.error { color:#AA0000; }</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="bloop_markdown"><p>Just an extra comment I’d want to add:</p>
<ul>
<li>Swift isn’t a language that should have only a single concept how you solve a problem.</li>
<li>You can still use closed enums for namespaces, but it feels not right. There is no other (better) solution yet, so we’re indeed using enums at the moment.</li>
<li>In Swift 3 we don’t have c for loops anymore, so how do we iterate backwards now? There are <strong>different</strong> solutions, and no one is arguing that we should only have one for that.</li>
<li>We have API design guidelines, but no one would force you to even read it, and your code design is up to you.</li>
<li>A <strong><code>group</code></strong> introduces a new purely additive scoped syntax for organizing code.</li>
</ul>
<p></p></div><div class="bloop_original_html"><style>body{font-family:Helvetica,Arial;font-size:13px}</style><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div> <br> <div id="bloop_sign_1467221431070419200" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">-- <br>Adrian Zubarev<br>Sent with Airmail</div></div> <br><p class="airmail_on">Am 29. Juni 2016 um 19:28:24, Adrian Zubarev (<a href="mailto:adrian.zubarev@devandartist.com">adrian.zubarev@devandartist.com</a>) schrieb:</p> <blockquote type="cite" class="clean_bq"><span><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div></div><div>
<title></title>
<div class="bloop_markdown">
<p>Thats not true, this isn’t another extension. First of all a
<code>group</code> is typeless and can be used for sugaring your
code design. <code>Access labels</code> are optional but can be
used in two ways: 1) Namespaces or 2) as a bottleneck label
(<code>scrollView.content.size</code>).</p>
<p>If you’re using a labeled <code>group</code> you’re forced to
use the label to access its typed members.</p>
<p><code>group</code> is for organizing, reducing attributes and
access modifier boiler plate without the need for creating a real
new type.</p>
<p>An <code>extension</code> cannot organize something by access
modifier without an actual type.</p>
<pre><code class="swift">public struct A {
public group {
// all public
func member1() {}
func member2() {}
func member3() {}
}
public group labelName {
func member4() {}
func member5() {}
func member6() {}
}
}
let a = A()
a.member1()
a.labelName.member4()
</code></pre></div>
<div class="bloop_original_html">
<div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">
<br></div>
<br>
<div id="bloop_sign_1467220710306690048" class="bloop_sign">
<div style="font-family:helvetica,arial;font-size:13px">
-- <br>
Adrian Zubarev<br>
Sent with Airmail</div>
</div>
<br>
<p class="airmail_on">Am 29. Juni 2016 um 19:07:17, David Hart
(<a href="mailto:david@hartbit.com">david@hartbit.com</a>)
schrieb:</p>
<blockquote type="cite" class="clean_bq">
<div dir="auto">
<div>
<div><span>I still have difficulties seeing an appeal in the
proposal as it seems to be created new syntax to describe something
that extensions can already do. Why use two concepts when one is
enough?</span></div>
<div><span><br>
On 29 Jun 2016, at 17:43, Adrian Zubarev via swift-evolution
<<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>>
wrote:<br>
<br></span></div>
<blockquote type="cite">
<div>
<div class="bloop_markdown">
<p><span>This is one of the posts I was referring to, thanks for
providing the link. I enhanced the idea to solve more problems with
a single mechanism.</span></p>
</div>
<div class="bloop_original_html">
<div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">
<span><br></span></div>
<span><br></span>
<div id="bloop_sign_1467214829887786752" class="bloop_sign">
<div style="font-family:helvetica,arial;font-size:13px">
<span>-- <br>
Adrian Zubarev<br>
Sent with Airmail</span></div>
</div>
<span><br></span>
<p class="airmail_on"><span>Am 29. Juni 2016 um 17:39:05, Charlie
Monroe (<a href="mailto:charlie@charliemonroe.net">charlie@charliemonroe.net</a>)
schrieb:</span></p>
<blockquote type="cite" class="clean_bq">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div><span><span>A similar proposal can be found
here:</span></span>
<div class=""><span><br class=""></span></div>
<div class=""><span><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160613/020968.html" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160613/020968.html</a></span></div>
<div class=""><span><br class=""></span></div>
<div class=""><span>It uses a bit different syntax, but the gist of
it seems the same to me...</span></div>
<div class=""><span><br class=""></span></div>
<div class=""><span><br class=""></span>
<div>
<blockquote type="cite" class="">
<div class=""><span>On Jun 29, 2016, at 3:49 PM, Adrian Zubarev 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="">
<div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
<span>Dear Swift community, as most of you may know we’ve been
discussing the future of extintials and diverse design ideas. The
result for Swift 3 is a proposal which makes the first step by
replacing<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">procotol<A, B></code><span class="Apple-converted-space"> </span>with a new shorthand
syntax<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">A & B</code>.</span></p>
<p style="margin: 15px 0px;" class="">The reason I’m posting this
proposal so early is to get some feedback about this idea in
general. If the feedback is positive, I also would like some of you
to consider the removal of the access modifier from extensions. By
that I don’t mean to remove it completely. My honest opinion is
that extensions should have exactly the same access control like
classes, enums and structs.<span class="Apple-converted-space"> </span></p>
<p style="margin: 15px 0px;" class="">One take the access control
from protocols and mix it with the access control of classes (etc.)
and the result is the access control for extensions. I just can’t
agree with the fact of laziness of typing out access modifier on
extension members some of you might have.<span class="Apple-converted-space"> </span></p>
<ul style="margin: 15px 0px;" class="">
<li style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
The current access control on extensions disallow us to use access
modifier when we involve protocol conformances.<span class="Apple-converted-space"> </span></p>
</li>
<li style="margin: 15px 0px;" class="">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
Default implementations have three ways of declaring public
visibility:</p>
<pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code class="swift" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;">extension SomeProtocol {
public func someMember() {}
}
public extension SomeProtocol {
func someMember() {}
}
public extension SomeProtocol {
public func someMember() {}
}
</code></pre>
<p style="margin: 15px 0px;" class="">If it was the access control
mechanism for classes (etc.) there would be only a single correct
way to achieve this:</p>
<pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code class="swift" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;">public class SomeClass {
public func someMember() {}
}
</code></pre></li>
</ul>
<p style="margin: 15px 0px;" class="">Feel free to join the
conversation about removing the current behavior from extensions
for Swift 3. Here is the<span class="Apple-converted-space"> </span><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160627/022511.html" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none; -webkit-margin-before: 0px;" class="">>>link<<</a><span class="Apple-converted-space"> </span>to the last post. (I still
have to rewrite a few things to reflect my thoughts from the
conversation.)</p>
<hr style="height: 0.2em; border: 0px; color: rgb(204, 204, 204); background-color: rgb(204, 204, 204); display: inherit;" class="">
<p style="margin: 15px 0px;" class="">I’d like to introduce a new
scoped but typeless mechanism to Swift (which might be added after
Swift 3 drops). I gave it a clean name<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">group</code><span class="Apple-converted-space"> </span>to showcase what it will be
used for. You can read my formatted draft<span class="Apple-converted-space"> </span><a href="https://gist.github.com/DevAndArtist/c74f706febf93452999881335f6ca1f9" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">>>here<<</a>.</p>
<p style="margin: 15px 0px;" class="">These were the basic ideas I
had. I’ve already seen a few threads where some people were asking
for a way organizing variables into groups by an access modifier.
So here it is, but a<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">group</code><span class="Apple-converted-space"> </span>can solve other problems too.
We could finally stop abusing enums and also create<span class="Apple-converted-space"> </span><em class="">access
labels</em><span class="Apple-converted-space"> </span>for a
clear and swifty code design.</p>
<p style="margin: 15px 0px;" class="">The idea of groups is based
on the access control of protocols. It would be great if this
mechanism could have its own scope, which then could be used almost
anywhere.</p>
<hr style="height: 0.2em; border: 0px; color: rgb(204, 204, 204); background-color: rgb(204, 204, 204); display: inherit;" class="">
<h2 id="detaileddesign" style="font-weight: bold; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204); font-size: 24px;" class="">Detailed design</h2>
<ul style="margin: 15px 0px;" class="">
<li style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
A<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">group</code><span class="Apple-converted-space"> </span>is typeless, and should be
used for organization purposes.</p>
<ol style="margin: 15px 0px;" class="">
<li style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
Organizing members by an<span class="Apple-converted-space"> </span><em style="-webkit-margin-before: 0px;" class="">access modifier</em>.</p>
</li>
<li style="margin: 15px 0px;" class="">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
Providing an<span class="Apple-converted-space"> </span><em style="-webkit-margin-before: 0px;" class="">access
label</em><span class="Apple-converted-space"> </span>to type
members (CamelCase).</p>
</li>
<li style="margin: 15px 0px;" class="">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
Providing<span class="Apple-converted-space"> </span><em style="-webkit-margin-before: 0px;" class="">namespacing</em><span class="Apple-converted-space"> </span>for API design
(UpperCamelCase).</p>
<pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code class="swift" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;">public group Reference {
/* implicitly public */ class String { ... }
/* implicitly public */ class Char { ... }
}
</code></pre>
<p style="margin: 15px 0px;" class="">Possible usage:</p>
<pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code class="swift" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;">let instance = Reference.String()
</code></pre></li>
</ol>
</li>
<li style="margin: 15px 0px;" class="">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
A<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">group</code><span class="Apple-converted-space"> </span>can be used inside any scope
or at file level.</p>
</li>
<li style="margin: 15px 0px;" class="">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
A<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">group</code><span class="Apple-converted-space"> </span>has one or no label at
all:</p>
<ul style="margin: 15px 0px;" class="">
<li style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
A<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">group</code><span class="Apple-converted-space"> </span>without a label has always an
explicit<span class="Apple-converted-space"> </span><em class="">access modifier</em>:</p>
<pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code class="swift" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;">public struct A {
public group {
var a: Int { return self._a }
var aTimesTen: Int { return self.a * 10 }
}
internal group {
var _a: Int = 10
var _b: Int = 42
}
}
</code></pre></li>
<li style="margin: 15px 0px;" class="">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
A<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">group</code><span class="Apple-converted-space"> </span>with a label has
an<span class="Apple-converted-space"> </span><em class="">optional</em><span class="Apple-converted-space"> </span>access modifier:</p>
<ol style="margin: 15px 0px;" class="">
<li style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
Labeled groups without an access modifier are
automatically<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">internal</code>.</li>
<li style="margin: 15px 0px;" class="">Group members have the same
access modifier as the group itself (like access modifier on
protocols).</li>
<li style="margin: 15px 0px;" class="">Nested groups inherit the
access modifier from its root<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">group</code>.</li>
<li style="margin: 15px 0px;" class="">Labeled groups cannot be
stored in any manner.</li>
</ol>
<pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code class="swift" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;">public class UIScrollView : ... {
public group {
/* implicitly public */ group content {
/* implicitly public */ var offset: CGPoint
/* implicitly public */ var size: CGSize
/* implicitly public */ var inset: UIEdgeInsets
}
/* implicitly public */ var someCoolPublicInteger: Int
}
...
}
</code></pre>
<p style="margin: 15px 0px;" class="">Possible usage:</p>
<pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code class="diff" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;">- scrollViewInstance.contentOffset
+ scrollViewInstance.content.offset
</code></pre></li>
</ul>
</li>
<li style="margin: 15px 0px;" class="">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
It should be possible to create multiple groups with the
same/different access modfier and the same acess label:</p>
<pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code class="swift" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;">public struct B {
public group labelName {
var someVarName: Int
}
public group labelName {
var someOtherVarName: String
}
internal group labelName {
var _internalVarName: Double
}
}
</code></pre></li>
<li style="margin: 15px 0px;" class="">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
It should be possible to extend existing labeled groups.</p>
<pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code class="swift" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;">public struct C {
public group labelName {
var someVarName: Int
}
}
public extension C {
public group labelName {
var computedProperty: Int { ... }
}
}
</code></pre></li>
<li style="margin: 15px 0px;" class="">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">
Attributes aplied to a<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">group</code><span class="Apple-converted-space"> </span>will automatically be aplied
to all members.</p>
<pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code class="swift" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;">public class D {
public static group {
// public static var
var something: Int = 42
// public static func
func foo() { ... }
}
}
</code></pre></li>
</ul>
<h3 id="grammar" style="font-weight: bold; font-size: 18px;" class="">Grammar</h3>
<p style="margin: 15px 0px;" class=""><em style="-webkit-margin-before: 0px;" class="">declaration</em><span class="Apple-converted-space"> </span>→<span class="Apple-converted-space"> </span><em class="">group-declaration</em></p>
<p style="margin: 15px 0px;" class=""><em style="-webkit-margin-before: 0px;" class="">group-declaration</em><span class="Apple-converted-space"> </span>→<span class="Apple-converted-space"> </span><em class="">attributes</em><sub class="">opt</sub><span class="Apple-converted-space"> </span><em class="">access-level-modifier</em><span class="Apple-converted-space"> </span><strong class="">group</strong><span class="Apple-converted-space"> </span><em class="">group-body</em></p>
<p style="margin: 15px 0px;" class=""><em style="-webkit-margin-before: 0px;" class="">group-declaration</em><span class="Apple-converted-space"> </span>→<span class="Apple-converted-space"> </span><em class="">attributes</em><sub class="">opt</sub><span class="Apple-converted-space"> </span><em class="">access-level-modifier</em><sub class="">opt</sub><span class="Apple-converted-space"> </span><strong class="">group</strong><span class="Apple-converted-space"> </span><em class="">group-name</em><span class="Apple-converted-space"> </span><em class="">group-body</em></p>
<p style="margin: 15px 0px;" class=""><em style="-webkit-margin-before: 0px;" class="">group-name</em><span class="Apple-converted-space"> </span>→<span class="Apple-converted-space"> </span><em class="">identifier</em></p>
<p style="margin: 15px 0px;" class=""><em style="-webkit-margin-before: 0px;" class="">group-body</em><span class="Apple-converted-space"> </span>→<span class="Apple-converted-space"> </span><strong class="">{</strong><span class="Apple-converted-space"> </span><em class="">declarations</em><span class="Apple-converted-space"> </span><strong class="">}</strong></p>
<div style="margin: 15px 0px;" class=""><br class="webkit-block-placeholder"></div>
</div>
<div class="bloop_original_html" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);">
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""><br class=""></div>
<br class="">
<div id="bloop_sign_1467206407803821056" class="bloop_sign">
<div style="font-family: helvetica, arial; font-size: 13px;" class="">-- <br class="">
Adrian Zubarev<br class="">
Sent with Airmail</div>
</div>
</div>
<div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);">
<div style="margin: 15px 0px; -webkit-margin-before: 0px;" class=""><br class="webkit-block-placeholder"></div>
</div>
<span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class="">
<span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class="">
<a href="mailto:swift-evolution@swift.org" style="color: rgb(65, 131, 196); background-color: rgb(254, 254, 254); text-decoration: none; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="color: rgb(65, 131, 196); background-color: rgb(254, 254, 254); text-decoration: none; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class=""></div>
</blockquote>
</div>
<br class=""></div>
</div>
</div>
</blockquote>
</div>
<div class="bloop_markdown"></div>
</div>
</blockquote>
<blockquote type="cite">
<div>
<span>_______________________________________________</span><br>
<span>swift-evolution mailing list</span><br>
<span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br>
<span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
<div class="bloop_markdown"></div>
</div></div></span></blockquote></div><div class="bloop_markdown"><p></p></div></body></html>