<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 Jan 15, 2016, at 1:56 PM, Haravikk &lt;<a href="mailto:swift-evolution@haravikk.com" class="">swift-evolution@haravikk.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">This is pretty interesting; while the actual compile-time type-checking could be complex and take some time to implement, it seems to me that the actual notation could be implemented in advance and simply perform runtime assertions until the real type-checking is ready? In cases where the type-checker can’t be certain of a value’s safety, a run-time assertion might make sense anyway, so this short-term behaviour could actually be left in, with the caveat being that your restriction could still fail at run-time (which is what I think most people would want when the compile-time check isn’t enough).</div><div class=""><br class=""></div></div></div></blockquote><div><br class=""></div><div>That’s an interesting approach! I like it :)</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I’d be particularly interested in getting the notation available sooner if it's concise enough to make it worth using in place of current if statements. For example, it’d be nice if there were some shorthand for integers, as these seem like they’d be a particularly common use-case, for example:</div><div class=""><br class=""></div><div class="">var @where(“0 &lt;= myVariable &lt;= 100”) myVariable = 42</div><div class="">var @where(“0 &lt;= $1 &lt;= 100) myVariable = 42</div><div class=""><br class=""></div><div class="">Though personally I’d prefer something even more concise like:</div><div class=""><br class=""></div><div class="">var myVariable(0…100) = 42</div><div class="">var myVariable:Int(0…100) = 42</div><div class=""><br class=""></div></div></div></blockquote><div><br class=""></div><div>I don’t like the @where syntax too much either (but I don’t have the time right now to come up with a better, well-thought-out and practical syntax myself).</div><div>Here are just some quick thoughts:</div><div><br class=""></div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">// Annotating the type</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> value: Int&lt;</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">...</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">100</span><span style="font-variant-ligatures: no-common-ligatures" class="">&gt; = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">42</span><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #008400" class="">// Generics?</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> value: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">...</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">100</span><span style="font-variant-ligatures: no-common-ligatures" class="">) = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">42</span><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #008400" class="">// Initializer?</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> value: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures" class="">{</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">...</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">100</span><span style="font-variant-ligatures: no-common-ligatures" class="">} = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">42</span><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #008400" class="">// Scope?</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> value: {</span><span style="font-variant-ligatures: no-common-ligatures" class="">value:&nbsp;<span style="color: rgb(112, 61, 170);" class="">Int</span>&nbsp;| </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">...</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">100</span><span style="font-variant-ligatures: no-common-ligatures" class="">} = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">42</span><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #008400" class="">// LiquidHaskell</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> value: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">where</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp;Type&nbsp;== </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">...</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">100</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">42</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp;</span><span style="font-variant-ligatures: no-common-ligatures" class="">// `where` already is a keyword that acts very similar (but at runtime)</span></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">// Annotating the variable (the inferred type)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> value&lt;</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">...</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">100</span><span style="font-variant-ligatures: no-common-ligatures" class="">&gt; = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">42</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> value(</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">...</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">100</span><span style="font-variant-ligatures: no-common-ligatures" class="">) = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">42</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> value{</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">...</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">100</span><span style="font-variant-ligatures: no-common-ligatures" class="">} = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">42</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> value{</span><span style="font-variant-ligatures: no-common-ligatures" class="">value:&nbsp;<span style="color: rgb(112, 61, 170);" class="">Int</span>&nbsp;| </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">...</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">100</span><span style="font-variant-ligatures: no-common-ligatures" class="">} = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">42</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">let</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;value&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">where</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;Type ==&nbsp;</span><span style="color: rgb(39, 42, 216); font-variant-ligatures: no-common-ligatures;" class="">1</span><span style="font-variant-ligatures: no-common-ligatures;" class="">...</span><span style="color: rgb(39, 42, 216); font-variant-ligatures: no-common-ligatures;" class="">100</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;=&nbsp;</span><span style="color: rgb(39, 42, 216); font-variant-ligatures: no-common-ligatures;" class="">42</span></div></div><div><br class=""></div><div>Even though it is more verbose, I like the last approach best. I think the common use-case is to predefine some very common ones (e.g. RGBA) in typealiases like so:</div><div><br class=""></div><div><div style="margin: 0px; line-height: normal;" class=""><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">typealias</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class="">&nbsp;RGBAValue =&nbsp;</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">Int</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">where</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class="">&nbsp;Type ==&nbsp;</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);" class="">0</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class="">...</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);" class="">255</span></div></div><div><br class=""></div><div>This makes it much nicer (IMO) to declare (e.g.) functions. `UIColor` for example could gain an initializer taking values from 0 to 255:</div><div><br class=""></div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">init</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(red: </span><span style="font-variant-ligatures: no-common-ligatures" class="">RGBAValue</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, green: </span><span style="font-variant-ligatures: no-common-ligatures" class="">RGBAValue</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, blue: </span><span style="font-variant-ligatures: no-common-ligatures" class="">RGBAValue</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, alpha: </span><span style="font-variant-ligatures: no-common-ligatures" class="">RGBAValue</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Leaving the @where clause for more complex (i.e- non-numeric) cases. A really powerful alternative would be to allow us some mechanism to define how to handle restrictions in our classes and structs; these would be compiled first so that they can be executed by the type checker (which may limit what they can do) but could allow us full control of how they work. So, for example, an integer definition might look like:</div><div class=""><br class=""></div><div class="">struct Int… {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>...</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>restriction(range:Range&lt;Int&gt;) -&gt; Bool { return range.contains(self) }</div><div class="">}</div><div class="">var myVariable(0…100) = 42</div><div class=""><br class=""></div><div class="">At run-time this would be equivalent to:</div><div class=""><br class=""></div><div class="">var myVariable = 42</div><div class="">assert(myVariable.restriction(0…100), “Value of myVariable is out of bounds [0…100]”)</div><div class=""><br class=""></div><div class="">With the idea being that in future the type-checker would call the restriction check, find 42 to be in range and omit the assertion entirely.</div><div class=""><br class=""></div><div class="">Just some thoughts, but the main thing for me is that this is something that I’d like to use a lot if implemented, so the more concise it can be, the better.</div><div class=""><br class=""></div></div></div></blockquote><div>Exactly :) If the type is precise enough the compiler can actually write (infer) a lot of your code)</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">- Haravikk</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 15 Jan 2016, at 12:27, Dennis Weissmann 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=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 15, 2016, at 6:53 AM, Dave 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="">This is the same thing as Refinement Types, right?</span><div class="" 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;"><a href="https://en.wikipedia.org/wiki/Refinement_(computing)#Refinement_types" class="">https://en.wikipedia.org/wiki/Refinement_(computing)#Refinement_types</a></div><div class="" 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;"><a href="http://goto.ucsd.edu/~rjhala/liquid/haskell/blog/blog/2013/01/01/refinement-types-101.lhs/" class="">http://goto.ucsd.edu/~rjhala/liquid/haskell/blog/blog/2013/01/01/refinement-types-101.lhs/</a></div><div class="" 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;"><br class=""></div></div></blockquote><div class=""><br class=""></div><div class=""><div class="">Yes, it seems they are. There is a pretty nice and easy to understand explanation [here](<a href="https://github.com/tomprimozic/type-systems/tree/master/refined_types" class="">https://github.com/tomprimozic/type-systems/tree/master/refined_types</a>):</div><div class=""><br class=""></div><div class=""><div class=""><em style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px;" class="">Refined types</em><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class="">&nbsp;or&nbsp;</span><em style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px;" class="">contracts</em><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class="">&nbsp;are a restricted form of dependent types that combine base datatypes with logical predicates; for example, the type of natural numbers could be written&nbsp;</span><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; color: rgb(51, 51, 51);" class="">x : int if x ≥ 0</code><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class="">&nbsp;(the notation most commonly used in academic literature is&nbsp;</span><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; color: rgb(51, 51, 51);" class="">{ν : int | ν ≥ 0}</code><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class="">).</span></div></div></div><br class=""><blockquote type="cite" class=""><div class=""><div class="" 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;">I’m in favor of it, but I think someone’s already made that suggestion… At the very least, I didn’t know what the phrase meant until a few days ago, and I know I learned about it from reading something on swift-evolution.</div></div></blockquote><div class=""><br class=""></div><div class="">That was probably Matthew (<a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160104/005925.html" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160104/005925.html</a>) or me (<a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160104/005918.html" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160104/005918.html</a>) - the thread is called '<span style="font-family: 'Helvetica Neue';" class="">Proposal: named invariants for variable declarations'</span></div><div class=""><br class=""></div><div class="">And I agree with Matthew that this won’t happen anytime soon. That’s why I didn’t want to discuss that topic too much. It’s just that the ABI will be finalized later this year and I wanted to mention that there is definitely interest in this area in case some ABI-related things are needed for refinement types (or even dependent types, someday, one can dream 😇) which need to be thought of before the finalization.</div><div class=""><br class=""></div>- Dennis</div><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div class="" 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;"><div class="">- Dave Sweeris</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 14, 2016, at 20:32, Suminda Dharmasena 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=""><div dir="ltr" class=""><div class="gmail_extra">E.g.&nbsp;</div><div class="gmail_extra"><br class=""></div><div class="gmail_extra"><ol class="" 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;"><li class="" 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-color: transparent; background-position: initial initial; background-repeat: initial initial;"><code class="" 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-color: transparent; background-position: initial initial; background-repeat: initial initial;"><span class="" style="border: 0px; font-size: 11.9px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(170, 51, 145); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">var @where("<span class="" 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-color: transparent; background-position: initial initial; background-repeat: initial initial;">myVariable</span><span class="" style="font-size: 11.9px; line-height: 22.4px;"> </span>&lt;= 100 &amp;&amp; <span class="" 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-color: transparent; background-position: initial initial; background-repeat: initial initial;">myVariable</span> &gt;= 0")</span> <span class="" style="border: 0px; font-size: 11.9px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(63, 110, 116); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">myVariable</span> = <span class="" style="border: 0px; font-size: 11.9px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(28, 0, 207); background-color: transparent; background-repeat: initial initial;">42</span></code></li></ol><div class="" style="text-indent: -13px;"><br class=""></div><div class="" style="text-indent: -13px;"><div class=""><font color="#aa3391" face="Menlo, monospace" class=""><span class="" style="font-size: 11.9px; line-height: 22.4px; white-space: pre-wrap;"><br class=""></span></font></div><div class=""><ol class="" 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-repeat: initial initial;"><li class="" 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-color: transparent;"><code class="" 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-color: transparent; background-position: initial initial; background-repeat: initial initial;"><span class="" style="border: 0px; font-size: 11.9px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(170, 51, 145); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">@where("<span class="" 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-color: transparent; background-position: initial initial; background-repeat: initial initial;">myVariable</span><span class="" style="font-size: 11.9px; line-height: 22.4px;"> </span>&lt;= 80 &amp;&amp; <span class="" 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-color: transparent; background-position: initial initial; background-repeat: initial initial;">myVariable</span><span class="" style="font-size: 11.9px; line-height: 22.4px;"> </span><span class="" style="font-size: 11.9px; line-height: 22.4px;">&gt;= 50</span>")</span></code></li><li class="" 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-color: transparent;"><code class="" 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-color: transparent; background-position: initial initial; background-repeat: initial initial;">{</code></li><li class="" 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-color: transparent; background-repeat: initial initial;"><code class="" 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-color: transparent; background-repeat: initial initial;"><font class="">    </font><font color="#aa3391" class="">...</font></code></li><li class="" 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-color: transparent;"><code class="" 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-color: transparent; background-position: initial initial; background-repeat: initial initial;">}</code></li></ol></div><div class=""><font color="#aa3391" face="Menlo, monospace" class=""><span class="" style="font-size: 11.9px; line-height: 22.4px; white-space: pre-wrap;"><br class=""></span></font></div><div class=""><font color="#aa3391" face="Menlo, monospace" class=""><span class="" style="font-size: 11.9px; line-height: 22.4px; white-space: pre-wrap;"><br class=""></span></font></div><ol class="" 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;"><li class="" 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-color: transparent;"><code class="" 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-color: transparent; background-position: initial initial; background-repeat: initial initial;"><span class="" style="border: 0px; font-size: 11.9px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(170, 51, 145); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">@where("score &lt;= 100 &amp;&amp; <span class="" style="font-size: 11.9px; line-height: 22.4px;">score &gt;= 0</span>")</span></code></li><li class="" 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-color: transparent;"><code class="" 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-color: transparent; background-position: initial initial; background-repeat: initial initial;"><span class="" style="border: 0px; font-size: 11.9px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(170, 51, 145); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">for</span> <span class="" style="border: 0px; font-size: 11.9px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(63, 110, 116); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">score</span> <span class="" style="border: 0px; font-size: 11.9px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(170, 51, 145); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">in</span> <span class="" style="border: 0px; font-size: 11.9px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(63, 110, 116); background-color: transparent; background-position: initial initial; background-repeat: initial initial;">individualScores</span> {</code></li><li class="" 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-color: transparent;"><code class="" 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-color: transparent; background-repeat: initial initial;"><font class="">    </font><font color="#aa3391" class="">...</font></code></li><li class="" 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-color: transparent;"><code class="" 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-color: transparent;">}</code></li></ol></div></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=mnFI6pg-2FTCMHnIXafbniMQOkvAOxgYUwbalcxNWA5RdDGNV8iM2feO0rvLraT0CXvJhPMa-2FKtBLAehYslsrqIzTyY7UO6tpTiuZmCIKk-2BDsj4z9Ne7s6Si-2B8z8IEoadwjfRNWqDAnEq9tjLL3PuiKKRVlXyEb5MUhxq3gRP-2FBBtGwkGlVsi1HLdCHWiv3PtRXoj3ljvlTENcdyRyZiHiNE-2B1yrc73VAuDnNDRXB1Zy8-3D" alt="" width="1" height="1" border="0" class="" style="height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;"><span class="Apple-converted-space">&nbsp;</span>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=8CZIdLciSFC-2BO5jF-2FiP8qI4HoRkMSGQZzNYm-2FNO1boKFmxqU0G3w878abGTSELn-2Fb7BuHHDik1FCnuD-2Fx-2B5GVkH2yGEufvJZh9ynZJ82k6wjqceBKjLQfW2FYivn2nfbUEb53xm-2FdK-2FSWqb5-2FZTkC-2BBKDZsjBfyUaoqmtnfKZVvm-2FZzKq-2FGfuUIVcHpnCBlJJ3Y0bLTmqCpBaGulYpqaDo-2FdyfPmvQ-2BhhsnhYkkEWJk-3D" alt="" width="1" height="1" border="0" 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; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" 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=""><span class="Apple-converted-space">&nbsp;</span>_______________________________________________</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="">swift-evolution mailing list</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=""><a href="mailto:swift-evolution@swift.org" 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="">swift-evolution@swift.org</a><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=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" 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="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class="">
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=amyhbYWPIxEqpemwz9EpI5i8QxjCDgJjSh-2BoGo-2F3tHnjIasvRKcFHFmsofbjNFiCKhx2xzxPZoZh7pxaR1eZ175ZZUT71imkOF5-2B3Gw-2FS9KmApSaGLPblCdNgegVr8fe6PF9wsv2v5G-2BREaeai0QZ3swdozW3sHINIYpmrWnFaCC4O90xR7P6rLDqLk7vxxf0n6k2DuLdEh-2Bk4euL6fZJVgdlhpZENHG2TwD974brLw-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;" class="">
</div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></body></html>