<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Mhm, -1 for this reason. &nbsp;If there were richer preconditions (say, a refinement typing scheme) here rather than C0-style contracts it'd be worth the extra syntax.<br><br>~Robert Widmann</div><div><br>2016/01/14 23:36、Javier Soto via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; のメッセージ:<br><br></div><blockquote type="cite"><div>Is this something that in your opinion is worth extra, special syntax? Those examples could be implement easily like:<br><br>didSet {<br>  precondition(score &lt;= 100)<br>}<br><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 14, 2016 at 8:32 PM Suminda Dharmasena &lt;<a href="mailto:sirinath1978m@gmail.com">sirinath1978m@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">E.g.&nbsp;</div><div class="gmail_extra"><br></div><div class="gmail_extra"><ol style="border:0px;font-size:14px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;line-height:1.6em;list-style:none;color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;background-image:initial;background-repeat:initial"><li style="border-width:0px 0px 0px 18px;border-left-style:solid;border-left-color:transparent;margin:0px;outline:0px;padding:0px 10px 0px 0px;vertical-align:baseline;white-space:pre-wrap;list-style-type:none;background:transparent"><code style="border:0px;font-size:0.85em;margin:0px;outline:0px;padding:0px;vertical-align:baseline;font-family:Menlo,monospace;word-wrap:break-word;background:transparent"><span style="border:0px;font-size:11.9px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(170,51,145);background:transparent">var @where("<span style="font-size:11.9px;line-height:22.4px;border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(63,110,116);background:transparent">myVariable</span><span style="color:rgb(0,0,0);font-size:11.9px;line-height:22.4px"> </span>&lt;= 100 &amp;&amp; <span style="font-size:11.9px;line-height:22.4px;border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(63,110,116);background:transparent">myVariable</span> &gt;= 0")</span> <span style="border:0px;font-size:11.9px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(63,110,116);background:transparent">myVariable</span> = <span style="border:0px;font-size:11.9px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(28,0,207);background-image:initial;background-color:transparent;background-repeat:initial">42</span></code></li></ol><div><br></div><div><div><font color="#aa3391" face="Menlo, monospace"><span style="font-size:11.9px;line-height:22.4px;white-space:pre-wrap"><br></span></font></div><div><ol style="border:0px;font-size:14px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;line-height:1.6em;list-style:none;font-family:Helvetica,Arial,sans-serif;text-indent:0px;background-image:initial;background-repeat:initial"><li style="color:rgb(0,0,0);border-width:0px 0px 0px 18px;border-left-style:solid;border-left-color:transparent;margin:0px;outline:0px;padding:0px 10px 0px 0px;vertical-align:baseline;white-space:pre-wrap;list-style-type:none;background-image:initial;background-color:transparent;background-repeat:initial"><code style="border:0px;font-size:0.85em;margin:0px;outline:0px;padding:0px;vertical-align:baseline;font-family:Menlo,monospace;word-wrap:break-word;background:transparent"><span style="border:0px;font-size:11.9px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(170,51,145);background:transparent">@where("<span style="font-size:11.9px;line-height:22.4px;border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(63,110,116);background:transparent">myVariable</span><span style="font-size:11.9px;line-height:22.4px;color:rgb(0,0,0)"> </span>&lt;= 80 &amp;&amp; <span style="font-size:11.9px;line-height:22.4px;border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(63,110,116);background:transparent">myVariable</span><span style="font-size:11.9px;line-height:22.4px;color:rgb(0,0,0)"> </span><span style="font-size:11.9px;line-height:22.4px">&gt;= 50</span>")</span></code></li><li style="color:rgb(0,0,0);border-width:0px 0px 0px 18px;border-left-style:solid;border-left-color:transparent;margin:0px;outline:0px;padding:0px 10px 0px 0px;vertical-align:baseline;white-space:pre-wrap;list-style-type:none;background-image:initial;background-color:transparent;background-repeat:initial"><code style="border:0px;font-size:0.85em;margin:0px;outline:0px;padding:0px;vertical-align:baseline;font-family:Menlo,monospace;word-wrap:break-word;background:transparent">{</code></li><li style="border-width:0px 0px 0px 18px;border-left-style:solid;border-left-color:transparent;margin:0px;outline:0px;padding:0px 10px 0px 0px;vertical-align:baseline;white-space:pre-wrap;list-style-type:none;background-image:initial;background-color:transparent;background-repeat:initial"><code style="border:0px;font-size:0.85em;margin:0px;outline:0px;padding:0px;vertical-align:baseline;font-family:Menlo,monospace;word-wrap:break-word;background-image:initial;background-color:transparent;background-repeat:initial"><font color="#000000">    </font><font color="#aa3391">...</font></code></li><li style="color:rgb(0,0,0);border-width:0px 0px 0px 18px;border-left-style:solid;border-left-color:transparent;margin:0px;outline:0px;padding:0px 10px 0px 0px;vertical-align:baseline;white-space:pre-wrap;list-style-type:none;background-image:initial;background-color:transparent;background-repeat:initial"><code style="border:0px;font-size:0.85em;margin:0px;outline:0px;padding:0px;vertical-align:baseline;font-family:Menlo,monospace;word-wrap:break-word;background:transparent">}</code></li></ol></div><div><font color="#aa3391" face="Menlo, monospace"><span style="font-size:11.9px;line-height:22.4px;white-space:pre-wrap"><br></span></font></div><div><font color="#aa3391" face="Menlo, monospace"><span style="font-size:11.9px;line-height:22.4px;white-space:pre-wrap"><br></span></font></div><ol style="border:0px;font-size:14px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;line-height:1.6em;list-style:none;font-family:Helvetica,Arial,sans-serif;text-indent:0px;background-image:initial;background-repeat:initial"><li style="color:rgb(0,0,0);border-width:0px 0px 0px 18px;border-left-style:solid;border-left-color:transparent;margin:0px;outline:0px;padding:0px 10px 0px 0px;vertical-align:baseline;white-space:pre-wrap;list-style-type:none;background-image:initial;background-color:transparent;background-repeat:initial"><code style="border:0px;font-size:0.85em;margin:0px;outline:0px;padding:0px;vertical-align:baseline;font-family:Menlo,monospace;word-wrap:break-word;background:transparent"><span style="border:0px;font-size:11.9px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(170,51,145);background:transparent">@where("score &lt;= 100 &amp;&amp; <span style="font-size:11.9px;line-height:22.4px">score &gt;= 0</span>")</span></code></li><li style="color:rgb(0,0,0);border-width:0px 0px 0px 18px;border-left-style:solid;border-left-color:transparent;margin:0px;outline:0px;padding:0px 10px 0px 0px;vertical-align:baseline;white-space:pre-wrap;list-style-type:none;background-image:initial;background-color:transparent;background-repeat:initial"><code style="border:0px;font-size:0.85em;margin:0px;outline:0px;padding:0px;vertical-align:baseline;font-family:Menlo,monospace;word-wrap:break-word;background:transparent"><span style="border:0px;font-size:11.9px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(170,51,145);background:transparent">for</span> <span style="border:0px;font-size:11.9px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(63,110,116);background:transparent">score</span> <span style="border:0px;font-size:11.9px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(170,51,145);background:transparent">in</span> <span style="border:0px;font-size:11.9px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(63,110,116);background:transparent">individualScores</span> {</code></li><li style="border-width:0px 0px 0px 18px;border-left-style:solid;border-left-color:transparent;margin:0px;outline:0px;padding:0px 10px 0px 0px;vertical-align:baseline;white-space:pre-wrap;list-style-type:none;background-image:initial;background-color:transparent;background-repeat:initial"><code style="border:0px;font-size:0.85em;margin:0px;outline:0px;padding:0px;vertical-align:baseline;font-family:Menlo,monospace;word-wrap:break-word;background-image:initial;background-color:transparent;background-repeat:initial"><font color="#000000">    </font><font color="#aa3391">...</font></code></li><li style="color:rgb(0,0,0);border-width:0px 0px 0px 18px;border-left-style:solid;border-left-color:transparent;margin:0px;outline:0px;padding:0px 10px 0px 0px;vertical-align:baseline;white-space:pre-wrap;list-style-type:none;background-image:initial;background-color:transparent;background-repeat:initial"><code style="border:0px;font-size:0.85em;margin:0px;outline:0px;padding:0px;vertical-align:baseline;font-family:Menlo,monospace;word-wrap:break-word;background:transparent">}</code></li></ol></div></div></div>
</blockquote></div><div dir="ltr">-- <br></div>Javier Soto
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=NX5pLVYXK-2FsoGvk-2BsN3ORSjM6f2-2BhaPL1hRr1LvA764V9eYyKBoWQME-2B8iqXnNkSIVGUKHfXgM7c2ANRABw0biSbc-2FbGNFZvJwZAkXqiU3yd6eme3a0qqkUHOEuwwNgF2cENfgKySVDzyFRK2Mf5rCbE7uFuJpMt9FVuFy6GH3CPDn51gbYALaTErz3T5Ik4eL92xb9v8gtpwlDiZdBxPdDhsZBR1G1fckWtalKjozk-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;">
</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></body></html>