<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=""><div class="">You can write "sample map isEven“ but it will throw a MatchError exception when trying to match the first non-even element.</div><div class=""><br class=""></div><div class="">The syntax { case x if x % 2 == 0 =&gt; x+“ is even“ } is just sugar for the anonymous function</div><div class=""><br class=""></div><div class="">(param =&gt; param match {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>case x if x % 2 == 0 =&gt; x+“ is even“</div><div class="">})</div><div class=""><br class=""></div><div class="">I can assign an exhaustive pattern match { case x =&gt; x } to a partial function of type PartialFunction[Any, Any] so even exhaustive cases seem to be turned into PartialFunctions. But since a partial function is a subclass of a non-partial function and can do more this is a feature.</div><div class=""><br class=""></div><div class="">-Thorsten</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">Am 08.01.2016 um 14:51 schrieb Craig Cruden &lt;<a href="mailto:ccruden@novafore.com" class="">ccruden@novafore.com</a>&gt;:</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="">The PartialFunction samples that I was basing this on was:<div class=""><br class=""></div><div class=""><pre style="margin-top: 5px; margin-bottom: 5px; padding: 5px; border: 1px solid rgb(221, 221, 221); font-size: 13.3333px; vertical-align: baseline; line-height: normal; widows: 1; background-color: rgb(238, 238, 238);" class=""><span class="kw" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline;">val</span> sample = <span class="num" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: rgb(30, 144, 255);">1</span> to <span class="num" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: rgb(30, 144, 255);">10</span>
<span class="kw" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline;">val</span> isEven: PartialFunction[<span class="std" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: rgb(0, 128, 128);">Int</span>, <span class="std" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: rgb(0, 128, 128);">String</span>] = {
  <span class="kw" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline;">case</span> x <span class="kw" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline;">if</span> x % <span class="num" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: rgb(30, 144, 255);">2</span> == <span class="num" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: rgb(30, 144, 255);">0</span> <span class="kw" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline;">=&gt;</span> x+<span class="lit" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: rgb(199, 21, 133);">" is even"</span>
}

<span class="cmt" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: green;">// the method collect can use isDefinedAt to select which members to collect</span>
<span class="kw" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline;">val</span> evenNumbers = sample collect isEven

<span class="kw" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline;">val</span> isOdd: PartialFunction[<span class="std" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: rgb(0, 128, 128);">Int</span>, <span class="std" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: rgb(0, 128, 128);">String</span>] = {
  <span class="kw" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline;">case</span> x <span class="kw" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline;">if</span> x % <span class="num" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: rgb(30, 144, 255);">2</span> == <span class="num" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: rgb(30, 144, 255);">1</span> <span class="kw" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline;">=&gt;</span> x+<span class="lit" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: rgb(199, 21, 133);">" is odd"</span>
}

<span class="cmt" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: green;">// the method orElse allows chaining another partial function to handle</span>
<span class="cmt" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline; color: green;">// input outside the declared domain</span>
<span class="kw" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline;">val</span> numbers = sample map (isEven orElse isOdd)</pre><div class=""><br class=""></div><div class=""><br class=""></div><div class="">you would not be able to write:</div><div class=""><br class=""></div><div class=""><pre style="margin-top: 5px; margin-bottom: 5px; padding: 5px; border: 1px solid rgb(221, 221, 221); font-size: 13.3333px; vertical-align: baseline; line-height: normal; widows: 1; background-color: rgb(238, 238, 238);" class=""><span class="kw" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; font-style: inherit; font-size: 13.3333px; font-family: inherit; vertical-align: baseline;">val</span> numbers = sample map (isEven)</pre><div class=""><br class=""></div></div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">On 2016-01-08, at 20:47:41, Craig Cruden &lt;<a href="mailto:ccruden@novafore.com" class="">ccruden@novafore.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="">I did a quick read of the PartialFunction documentation and just reading the example it looks like the pattern matching is not based on the foundation of PartialFunction just that it can be used in a PartialFunction (not exhaustive because it is partial). &nbsp;If I only do not have an exhaustive pattern matching though it will blow chunks in map because it obviously is not a full function. &nbsp;<div class=""><br class=""></div><div class="">Not being an expert it does not look like case pattern matching is dependent on PartialFunction so it would be a separate feature (obviously a cool feature that would be nice). &nbsp;</div><div class=""><br class=""></div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 2016-01-08, at 19:58:45, Thorsten Seitz &lt;<a href="mailto:tseitz42@icloud.com" class="">tseitz42@icloud.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="">That is not a feature of Scala’s map or filter functions.<div class=""><br class=""></div><div class="">Writing { case (x, y) =&gt; x + y } just defines an anonymous unary function, more specifically a partially defined function or PartialFunction (<a href="http://www.scala-lang.org/api/current/index.html#scala.PartialFunction" class="">http://www.scala-lang.org/api/current/index.html#scala.PartialFunction</a>).</div><div class=""><br class=""></div><div class="">Btw: partial functions are quite cool as they can be chained, e.g. by „orElse“ if the first function is not defined for a given input. This allows quite nice abstractions (I’m thinking or error handler functions, for example).</div><div class=""><br class=""></div><div class="">So the question is whether we would want something like that in Swift, too, i.e.</div><div class=""><br class=""></div><div class="">{ case &lt;pattern1&gt;: &lt;expr1&gt; [case &lt;pattern2&gt;: &lt;expr2&gt;]* [default: &lt;expr&gt;] }&nbsp;</div><div class="">would define a unary function which matches its input against the case patterns and returns value of the matching expression.</div><div class=""><br class=""></div><div class="">(It would probably make sense to introduce partial functions as well on top of that, i.e. make this a partial function which might even statically know that it is defined everywhere in case the compiler can check the exhaustiveness of the patterns.)</div><div class=""><br class=""></div><div class="">Then we could simply define the following function</div><div class=""><br class=""></div><div class="">func match&lt;T,U&gt;(x: T, f: T -&gt; U) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>return f(x)</div><div class="">}</div><div class=""><br class=""></div><div class="">which would allow us to write a switch-expression without any further syntax extensions:</div><div class=""><br class=""></div><div class="">let value = match(color) {&nbsp;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>case .Red: "0xFF0000“</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>case .Green: "0x00FF00“</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>case .Blue: "0x0000FF“</div><div class="">}</div><div class=""><br class=""></div><div class="">And we could also just write the map example Craig gave with no magic in the definition of map required:</div><div class=""><br class=""></div><div class="">num.map {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>case x where x &lt; 5: x + 1</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>case x: x - 1</div><div class="">}</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">For comparison: with my proposal of a ternary-like switch-expression this would look like follows instead:</div><div class=""><br class=""></div><div class="">num.map { elem in elem?</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>case x where x &lt; 5: x + 1</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>case x: x - 1</div><div class="">}</div><div class=""><br class=""></div><div class="">where we are using the switch-expression</div><div class=""><br class=""></div><div class=""><div class="">elem?</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>case x where x &lt; 5: x + 1</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>case x: x - 1</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">But then the question arises: shouldn’t { case &lt;pattern&gt;: &lt;expr&gt; … } allow statements, too?</div><div class="">I would think so.</div><div class="">In Scala this is allowed, e.g. I can write</div><div class=""><div style="margin: 0px; line-height: normal; font-family: Monaco; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">val f: PartialFunction[Any, Int] = { case x: Int =&gt; { println(x); x + 1 } }</div></div><div class=""><br class=""></div><div class="">-Thorsten</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">Am 08.01.2016 um 06:11 schrieb Craig Cruden via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt;:</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="">I was thinking about this a bit, and was thinking that maybe we would not need a new keyword at all but just use `map` with pattern matching `case` clauses. &nbsp;It would mean adding `map` to individual values — or anything that we might want to use as input for matching. &nbsp;</div><div class=""><br class=""></div><div class="">Reference scala (section 8.5) pattern matching:&nbsp;<a href="http://www.scala-lang.org/docu/files/ScalaReference.pdf" class="">http://www.scala-lang.org/docu/files/ScalaReference.pdf</a></div><div class=""><br class=""></div><div class="">In scala inside `map` and `filter` (unfortunately not on things like `reduceLeft` or `foldLeft`&nbsp;you can specify pattern matching anonymous functions as such:</div><div class=""><br class=""></div><div class=""><div class=""><div class="">val num = List(1, 5, 7)</div><div class=""><br class=""></div><div class="">num.map {</div><div class="">&nbsp; case x if x &lt; 5 =&gt; x + 1</div><div class="">&nbsp; case x =&gt; x - 1</div><div class="">}</div></div><div class=""><br class=""></div><div class="">output:&nbsp;List(2, 4, 6)</div><div class=""><br class=""></div><div class="">So if the pattern matching was added (I don’t believe Swift currently allows case classes in maps - but then I am rather junior in the language) Swift would not need a `match expression` it would simply be part of map and become something like:</div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><font color="#bb2ca2" class="">let commission =&nbsp;</font><span class="" style="color: rgb(79, 129, 135);">trade</span><span class="">.map {</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);"><span class="Apple-tab-span" style="white-space:pre">        </span>case</span>&nbsp;.Buy(<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;quantity,&nbsp;<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;price)&nbsp;<span class="" style="color: rgb(187, 44, 162);">where</span>&nbsp;<span class="" style="color: rgb(112, 61, 170);">Double</span>(quantity) * price &gt;&nbsp;<span class="" style="color: rgb(39, 42, 216);">10000 in</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp;&nbsp;<span class="Apple-tab-span" style="white-space:pre">                </span><span class="" style="color: rgb(112, 61, 170);">Double</span>(quantity) * price *&nbsp;<span class="" style="color: rgb(79, 129, 135);">vipCommissionRate</span>&nbsp;/&nbsp;<span class="" style="color: rgb(39, 42, 216);">100</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);"><span class="Apple-tab-span" style="white-space:pre">        </span>case</span>&nbsp;.Buy(<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;quantity,&nbsp;<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;price):</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp;&nbsp;<span class="Apple-tab-span" style="white-space:pre">                </span><span class="" style="color: rgb(112, 61, 170);">Double</span>(quantity) * price *&nbsp;<span class="" style="color: rgb(79, 129, 135);">commissionRate</span>&nbsp;/&nbsp;<span class="" style="color: rgb(39, 42, 216);">100</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);"><span class="Apple-tab-span" style="white-space:pre">        </span>case</span>&nbsp;.Sell(<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;quantity,&nbsp;<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;price)&nbsp;<span class="" style="color: rgb(187, 44, 162);">where</span>&nbsp;<span class="" style="color: rgb(112, 61, 170);">Double</span>(quantity) * price &gt;&nbsp;<span class="" style="color: rgb(39, 42, 216);">10000</span>:</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp;&nbsp;<span class="Apple-tab-span" style="white-space:pre">                </span><span class="" style="color: rgb(112, 61, 170);">Double</span>(quantity) * price *&nbsp;<span class="" style="color: rgb(79, 129, 135);">vipCommissionRate</span>&nbsp;/&nbsp;<span class="" style="color: rgb(39, 42, 216);">100</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);"><span class="Apple-tab-span" style="white-space:pre">        </span>case</span>&nbsp;.Sell(<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;quantity,&nbsp;<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;price):</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp;&nbsp;<span class="Apple-tab-span" style="white-space:pre">                </span><span class="" style="color: rgb(112, 61, 170);">Double</span>(quantity) * price *&nbsp;<span class="" style="color: rgb(79, 129, 135);">commissionRate</span>&nbsp;/&nbsp;<span class="" style="color: rgb(39, 42, 216);">100</span></div></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(39, 42, 216);">}</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(39, 42, 216);"><br class=""></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(39, 42, 216);"><br class=""></span></div><div class=""><span class="" style="color: rgb(39, 42, 216);"><br class=""></span></div><div class=""><br class=""></div></div><div 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=""><br class=""></div><div class="">But if we go with brackets then I would recommend something like this:&nbsp;</div><div class=""><br class=""></div><div class=""><span style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;" class="">let </span><span style="font-family: Menlo; font-size: 11px;" class="">commission</span><span style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;" class=""> =</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;match (</span><span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px;" class="">trade) </span><span style="font-family: Menlo; font-size: 11px;" class=""><font color="#bb2ca2" class="">{</font></span></div><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;" class=""><div class=""><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">case</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">.Buy(</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">quantity,</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">price)</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">where</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170);">Double</span><span style="font-family: Menlo; font-size: 11px;" class="">(quantity) * price &gt;</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">10000</span><span style="font-family: Menlo; font-size: 11px;" class="">:</span></div><div class=""><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp; &nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170);">Double</span><span style="font-family: Menlo; font-size: 11px;" class="">(quantity) * price *</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135);">vipCommissionRate</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">/</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">100</span></div><div class=""><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">case</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">.Buy(</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">quantity,</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">price):</span></div><div class=""><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp; &nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170);">Double</span><span style="font-family: Menlo; font-size: 11px;" class="">(quantity) * price *</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135);">commissionRate</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">/</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">100</span></div><div class=""><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">case</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">.Sell(</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">quantity,</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">price)</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">where</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170);">Double</span><span style="font-family: Menlo; font-size: 11px;" class="">(quantity) * price &gt;</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">10000</span><span style="font-family: Menlo; font-size: 11px;" class="">:</span></div><div class=""><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp; &nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170);">Double</span><span style="font-family: Menlo; font-size: 11px;" class="">(quantity) * price *</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135);">vipCommissionRate</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">/</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">100</span></div><div class=""><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">case</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">.Sell(</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">quantity,</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">price):</span></div><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(112, 61, 170);">Double</span>(quantity) * price *&nbsp;<span class="" style="color: rgb(79, 129, 135);">commissionRate</span>&nbsp;/&nbsp;<span class="" style="color: rgb(39, 42, 216);">100</span></div></div></div></div></blockquote><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><font color="#272ad8" class="">}</font></div></div></div></div></div></div></blockquote></div><br class="">
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=1MXK54sosN3xru3iYcLt0oBZ2w20i49gyogXctgrspe7wA1knOK1HCJmiaMUpPlg12r0jwt46Yh0N0LDUsV7M0hA-2BH6rSWn24rL-2FSxCGKaF5VJNpm-2BNM1vIo7F7lX-2FsiQ3gkQt5tfCWGMmRCeSiiCJY5iKYRsCByXjMfzMeiVXpDsNTTYh-2FmailoylSKCeMvvHnzaLcauRM6m8CnOgm1zcM0RwI21HO9CsQSW8MvbUU-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></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></body></html>