<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 23 Mar 2017, at 21:10, Vladimir.S via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; 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; float: none; display: inline !important;" class="">On 23.03.2017 21:21, Matthew Johnson via swift-evolution wrote:</span><br style="font-family: Helvetica; font-size: 12px; 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=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; 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=""><br class=""><blockquote type="cite" class="">On Mar 23, 2017, at 1:12 PM, Charles Srstka via swift-evolution<br class="">&lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class="">MOTIVATION:<br class=""><br class="">In current Swift, a pattern has emerged among some developers, in<br class="">order to logically group parts of a class or struct’s declaration,<br class="">particularly around protocols:<br class=""></blockquote></blockquote><span style="font-family: Helvetica; font-size: 12px; 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; float: none; display: inline !important;" class="">&gt;&gt; ...</span><br style="font-family: Helvetica; font-size: 12px; 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=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; 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=""><blockquote type="cite" class=""><br class="">What do you think?<br class=""></blockquote><br class="">If we wanted to allow code like this to be written we wouldn’t need a<br class="">new keyword to do it. &nbsp;You are proposing two things here:<br class=""><br class="">1) Allow stored properties in same-module extensions. &nbsp;This has been<br class="">discussed in the past and is a possibility, but I suspect it is not in<br class="">scope for consideration during Swift 4.<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; 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=""><span style="font-family: Helvetica; font-size: 12px; 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; float: none; display: inline !important;" class="">Are we really expect to have stored properties in same-module extensions?</span><br style="font-family: Helvetica; font-size: 12px; 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=""><span style="font-family: Helvetica; font-size: 12px; 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; float: none; display: inline !important;" class="">As I remember, there a lot of questions were raised during discussions so for some reason *I* had a feeling that we should not expect this happens in near feature. Probably I missed something.</span></div></blockquote><br class=""></div><div>I can see why some people might want to do stored properties in extensions to structure things, but personally I quite like the lack of flexibility as it encourages the initial type declaration to focus on what a type <b class="">contains</b>, while extensions focus on what it <b class="">does</b>. I've really taken to that style, as I now almost never declare methods or computed properties in an initial type declaration, unless it's a very simple one; instead doing all my methods and protocol conformances in their own extensions.</div><div><br class=""></div><div>i.e- I quite like that by the time you've finished your type declaration you have finalised what its size will be, and nothing else can change that, spreading it out feels like it could make that more confusing. It also IMO helps to encourage you to keep a type's contents fairly simple, as you can see in one place if you've made it very complicated.</div><div><br class=""></div><div>I suppose there's an argument for having the freedom to do it however you want, but I don't think spreading out across a module is a good idea; unless we're assuming that module in this context applies like in other proposals, where fileprivate is a "module" with only one file.</div><div><br class=""></div><div>I dunno, I just think that as a pattern the current requirement to keep stored properties within a type declaration enforces some good practices. I found it a bit jarring at first too, but after adapting to the type + extensions style I find I actually really like doing things that way.</div></body></html>