<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="">I’m really glad to see some discussion about this. I think it is an extremely worth while addition to Swift. Chris L. also thought it was a good idea, in general.<div class=""><br class=""></div><div class="">If I get a chance I’ll make a formal request to consider it. Anyone else interested in offering it up, officially?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Kevin Kachikian</div><div class=""><br class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 18, 2015, at 11:42 AM, Nutchaphon Rewik <<a href="mailto:nRewik@outlook.com" class="">nRewik@outlook.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div id="divtagdefaultwrapper" style="font-family: Avenir-Book; font-style: normal; font-variant: 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; font-size: 12pt; background-color: rgb(255, 255, 255);" class=""><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif;" class=""><span style="font-size: 12pt; white-space: pre-wrap;" class="">I only see the benefits on this.</span><br class=""></div><div id="divtagdefaultwrapper" style="font-size: 12pt; background-color: rgb(255, 255, 255);" class=""><pre style="font-family: Calibri, Arial, Helvetica, sans-serif; white-space: pre-wrap;" class=""><font face="Calibri, Arial, Helvetica, sans-serif" style="font-size: 12pt;" class=""></font></pre><pre class=""><ol style="font-family: Calibri, Arial, Helvetica, sans-serif;" class=""><li class=""><span style="font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif; white-space: pre-wrap;" class="">We don't have to store all states in one file. States can be stored separately. So, we can write code in more composition style.</span><br class=""></li><li class=""><font face="Calibri, Arial, Helvetica, sans-serif" class=""><span style="white-space: pre-wrap;" class="">We can add new states to the existing type. Not just NSObject subclass with associated object.</span></font></li></ol><div class=""><font face="Calibri, Arial, Helvetica, sans-serif" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></font></div><div style="font-family: Calibri, Arial, Helvetica, sans-serif;" class=""><table width="100%" cellspacing="0" style="font-family: Calibri, Arial, Helvetica, sans-serif; white-space: normal; border-collapse: collapse; width: 935px; border: 1px solid rgb(198, 198, 198);" class=""><tbody class=""><tr class=""><td style="width: 932px; border: 1px solid rgb(198, 198, 198);" class=""><font face="Menlo" size="1" color="#BB2CA2" class=""><span style="font-size: 12px;" class="">protocol</span></font><font face="Menlo" size="1" class=""><span style="font-size: 12px;" class=""> </span></font><font face="Menlo" size="1" color="#4F8187" class=""><span style="font-size: 12px;" class="">Incrementer</span></font><font face="Menlo" size="1" class=""><span style="font-size: 12px;" class="">{</span></font><div style="margin: 0px;" class=""><font face="Menlo" size="1" class=""><span style="font-size: 12px;" class=""> <font color="#BB2CA2" class="">func</font> increase()</span></font></div><div style="margin: 0px;" class=""><font face="Menlo" size="1" class=""><span style="font-size: 12px;" class="">}<br class=""></span></font></div><div style="margin: 0px;" class=""><font face="Menlo" size="1" class=""><span style="font-size: 12px;" class=""><br class=""></span></font></div><div style="margin: 0px;" class=""><font face="Menlo" size="1" color="#4F8187" class=""><span style="font-size: 12px;" class=""><font color="#BB2CA2" class="">extension</font><font class=""> </font>Incrementer<font class="">{</font></span></font></div><div style="margin: 0px;" class=""><font face="Menlo" size="1" color="#4F8187" class=""><span style="font-size: 12px;" class=""><font class=""><br class=""></font></span></font></div><div style="margin: 0px;" class=""><font face="Menlo" size="1" class=""><span style="font-size: 12px;" class=""><font color="red" style="color: rgb(0, 132, 0);" class=""> <span class="Apple-converted-space"> </span></font></span></font><font face="Menlo" size="1" color="#008400" class=""><span style="font-size: 12px;" class=""><font color="#BB2CA2" class="">var</font><font class=""> count = </font><font color="#272AD8" class="">1 </font></span></font><span style="color: rgb(0, 132, 0); font-family: Menlo; font-size: 12px;" class="">// allows stored properties</span></div><div style="margin: 0px;" class=""><font face="Menlo" size="1" class=""><span style="font-size: 12px;" class=""> </span></font></div><div style="margin: 0px;" class=""><font face="Menlo" size="1" class=""><span style="font-size: 12px;" class=""> <font color="#BB2CA2" class="">func</font> increase(){<br class=""></span></font></div><div style="margin: 0px;" class=""><font face="Menlo" size="1" class=""><span style="font-size: 12px;" class=""> <font color="#3D1D81" class="">print</font>(count)<br class=""></span></font></div><div style="margin: 0px;" class=""><font face="Menlo" size="1" class=""><span style="font-size: 12px;" class=""> count = count + <font color="#272AD8" class="">1</font></span></font></div><div style="margin: 0px;" class=""><font face="Menlo" size="1" class=""><span style="font-size: 12px;" class=""> }<br class=""></span></font></div><div style="margin: 0px;" class=""><font face="Menlo" size="1" class=""><span style="font-size: 12px;" class=""> </span></font></div><div style="margin: 0px;" class=""><font face="Menlo" size="1" class=""><span style="font-size: 12px;" class="">}<br class=""></span></font></div><div style="margin: 0px;" class=""></div><div style="margin: 0px;" class=""><br class=""></div></td></tr></tbody></table></div></pre><pre style="font-family: Calibri, Arial, Helvetica, sans-serif; white-space: pre-wrap;" class=""><br class=""></pre><pre style="font-family: Calibri, Arial, Helvetica, sans-serif; white-space: pre-wrap;" class="">><i class=""> On Dec 8, 2015, at 10:51 AM, Kevin Kachikian via swift-evolution <<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" id="LPlnk107781" title="https://lists.swift.org/mailman/listinfo/swift-evolution
Cmd+Click or tap to follow the link" class="">swift-evolution at swift.org</a>> wrote:
</i>><i class="">
</i>><i class=""> I’d like to proposal to the Swift community and discuss the advantages and disadvantages of adding modifiable properties to extensions (in addition to the already existing computed properties, instance methods, subscripts, etc.):
</i>><i class="">
</i>><i class=""> extension SomeType {
</i>><i class="">         
</i>><i class="">         var aNewProperty: Int
</i>><i class="">         var anotherVariable: String
</i>><i class="">         var aThirdOne: MyStruct</i></pre></div></div></div></blockquote></div><br class=""></div></div></body></html>