<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="">On Apr 9, 2017, at 7:04 PM, Jose Cheyo Jimenez via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><div><blockquote type="cite" class=""><div class=""><div 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; -webkit-text-stroke-width: 0px;" class=""><br class="">On Apr 8, 2017, at 5:19 AM, Neil via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class=""></div><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-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><div class=""><span class="">I agreed with Charlie, but I think there’s another option.<span class="Apple-converted-space">&nbsp;</span></span><br class=""><span class=""></span><br class=""><span class="">The access control problems that both SE-0159 and SE-0169 are attempting to address can be resolved not by changing the definition of the existing access modifiers, but refocussing the use of extensions.<span class="Apple-converted-space">&nbsp;</span></span><br class=""><span class=""></span><br class=""><span class="">One such way would be to introduce a `partial` modifier. It would be similar to C#’s partial modifier. The proposed partial modifier would be purely additive and it would go a long way to mitigate the access control issues inherent in extension-oriented design.<span class="Apple-converted-space">&nbsp;</span></span><br class=""><span class=""></span><br class=""><span class="">The key characteristics of partial-oriented design would be:</span><br class=""><span class=""></span><br class=""><span class="">- Partials would allow the splitting of implementations into multiple logical units without the same-file restriction.</span><br class=""></div></blockquote><div 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; -webkit-text-stroke-width: 0px; direction: inherit;" class=""><br class=""></div><div 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; -webkit-text-stroke-width: 0px; direction: inherit;" class="">I really like the idea of partial but it would need to be restricted to the same file. This would allow partial to just be a compile time feature which just zips up a type together. &nbsp;Another great feature would be that it could allow stored properties because it is only a compile time feature. Partial could be used to communicate to the user that this type has additional members and properties declared somewhere else in the file.&nbsp;</div><div 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; -webkit-text-stroke-width: 0px; direction: inherit;" class=""><br class=""></div><div 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; -webkit-text-stroke-width: 0px; direction: inherit;" class="">+1 for file scope partial.&nbsp;</div></div></blockquote><div><br class=""></div>Partials from a C# sense only really shine when they are cross-file, same module. Then, preprocessing rules can turn something like a language description, XML-based language or extended HTML markup into property definitions and template rendering code. A type is partially user code, partially generated code.</div><div><br class=""></div><div>Other languages may support this via the preprocessor-generated code being a super type or subtype of the user code type, but then you necessarily aren’t a peer - either a super type preprocessor class can’t see the user methods to hook in things like actions and actions, or the user class can’t access properties and methods declared by the preprocessor. In both cases, the root type usually winds up being declared abstract.</div><div><br class=""></div><div>I don’t know what a same-file partial would be, other than an extension which also contributes to storage requirements of the type.</div><div><br class=""></div><div>-DW</div></body></html>