<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>In general, I think this is fantastic. In particular, I *really* like the notion that `BinaryFloatingPoint` conforms to `FloatingPoint`. I would do a few things differently, though:</div><div><blockquote type="cite" class=""><div class="">On Apr 14, 2016, at 6:55 PM, Stephen Canon 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=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; 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);"><pre style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;" class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">public</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">protocol</span> FloatingPoint: SignedArithmetic, <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Comparable</span> {
  ...
  <span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">/// The greatest finite number.</span>
  <span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">///</span>
  <span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">/// Compares greater than or equal to all finite numbers, but less than</span>
  <span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">/// infinity.  Corresponds to the C macros `FLT_MAX`, `DBL_MAX`, etc.</span>
  <span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">/// The naming of those macros is slightly misleading, because infinity</span>
  <span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">/// is greater than this value.</span>
  <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">static</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">var</span> greatestFiniteMagnitude: <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">Self</span> { <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">get</span> }
  ...
}</pre></div></div></div></blockquote></div><div class="">Why put this in FloatingPoint? The concept is valid for any real type (IMHO, it’s valid for rectangular Complex/Quaternion/etc types as well... I’m not sure if it is for the various polar formats, though). I think a better place for it is either in `Arithmetic`, or another protocol to which `Arithmetic` conforms:</div><div class=""><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal;" class=""><div style="font-family: Menlo; margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">protocol</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> HasMinAndMaxFiniteValue</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp;{</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">static</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> maxFinite: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> {</span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">get</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">} </span><span style="font-variant-ligatures: no-common-ligatures" class="">// I think “max”/“min" are clear enough (especially if the docs are explicit), but I understand the objection</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">static</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> minFinite: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">get</span><span style="font-variant-ligatures: no-common-ligatures" class="">}</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="color: rgb(0, 132, 0); font-variant-ligatures: no-common-ligatures;" class="">// 0 for unsigned types</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class="">}</div><div style="margin: 0px; line-height: normal;" class=""><div style="font-family: Helvetica; margin: 0px; line-height: normal;" class="">This would unify the syntax for getting a numeric type’s min or max finite value across all the built-in numeric types (this means that `Int.max` would become `Int.maxFinite`). Similarly, IMHO infinity shouldn’t be tied to floating point types. While it’s true that the *native* integer types don’t support infinity, arbitrary precision integer types might.</div></div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><div style="margin: 0px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">protocol</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;HasInfinity</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;{</span></font></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">static</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">var</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;infinity:&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;{</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">get</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">}</span></div><div style="font-family: Menlo; color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class="">}</div><div style="font-family: Menlo;" class=""><br class=""></div><div style="font-family: Menlo;" class=""><br class=""></div></div></div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><blockquote type="cite" class=""><pre class="" style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal;"><span class="pl-c" style="color: rgb(150, 152, 150); box-sizing: border-box;">/// Arithmetic protocol declares methods backing binary arithmetic operators,</span><font color="#333333" class="">
</font><span class="pl-c" style="color: rgb(150, 152, 150); box-sizing: border-box;">/// such as  `+`, `-` and `*`; and their mutating counterparts.  These methods</span><font color="#333333" class="">
</font><span class="pl-c" style="color: rgb(150, 152, 150); box-sizing: border-box;">/// operate on arguments of the same type.</span><font color="#333333" class="">
</font><font color="#969896" class="">...</font><font color="#333333" class="">
</font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">public</span><font color="#333333" class=""> </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">protocol</span><font color="#333333" class=""> Arithmetic: </font><span class="pl-c1" style="color: rgb(0, 134, 179); box-sizing: border-box;">Equatable</span><font color="#333333" class="">, </font><span class="pl-c1" style="color: rgb(0, 134, 179); box-sizing: border-box;">IntegerLiteralConvertible</span><font color="#333333" class=""> {
  </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">init</span><font color="#333333" class="">()
</font><font color="#333333" class="">  </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">func</span><font color="#333333" class=""> </font><span class="pl-en" style="color: rgb(121, 93, 163); box-sizing: border-box;">adding</span><font color="#333333" class="">(rhs: </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">Self</span><font color="#333333" class="">) </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">-&gt;</span><font color="#333333" class=""> Self
</font><font color="#333333" class="">  </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">mutating</span><font color="#333333" class=""> </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">func</span><font color="#333333" class=""> </font><span class="pl-en" style="color: rgb(121, 93, 163); box-sizing: border-box;">add</span><font color="#333333" class="">(rhs: </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">Self</span><font color="#333333" class="">)
</font><font color="#333333" class="">  </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">func</span><font color="#333333" class=""> </font><span class="pl-en" style="color: rgb(121, 93, 163); box-sizing: border-box;">subtracting</span><font color="#333333" class="">(rhs: </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">Self</span><font color="#333333" class="">) </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">-&gt;</span><font color="#333333" class=""> Self
</font><font color="#333333" class="">  </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">mutating</span><font color="#333333" class=""> </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">func</span><font color="#333333" class=""> </font><span class="pl-en" style="color: rgb(121, 93, 163); box-sizing: border-box;">subtract</span><font color="#333333" class="">(rhs: </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">Self</span><font color="#333333" class="">)
</font><font color="#333333" class="">  </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">func</span><font color="#333333" class=""> </font><span class="pl-en" style="color: rgb(121, 93, 163); box-sizing: border-box;">multiplied</span><font color="#333333" class="">(</font><span class="pl-en" style="color: rgb(121, 93, 163); box-sizing: border-box;">by</span><font color="#333333" class=""> </font><span class="pl-smi" style="color: rgb(51, 51, 51); box-sizing: border-box;">rhs</span><font color="#333333" class="">: </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">Self</span><font color="#333333" class="">) </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">-&gt;</span><font color="#333333" class=""> Self
</font><font color="#333333" class="">  </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">mutating</span><font color="#333333" class=""> </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">func</span><font color="#333333" class=""> </font><span class="pl-en" style="color: rgb(121, 93, 163); box-sizing: border-box;">multiply</span><font color="#333333" class="">(</font><span class="pl-en" style="color: rgb(121, 93, 163); box-sizing: border-box;">by</span><font color="#333333" class=""> </font><span class="pl-smi" style="color: rgb(51, 51, 51); box-sizing: border-box;">rhs</span><font color="#333333" class="">: </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">Self</span><font color="#333333" class="">)
</font><font color="#333333" class="">  </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">func</span><font color="#333333" class=""> </font><span class="pl-en" style="color: rgb(121, 93, 163); box-sizing: border-box;">divided</span><font color="#333333" class="">(</font><span class="pl-en" style="color: rgb(121, 93, 163); box-sizing: border-box;">by</span><font color="#333333" class=""> </font><span class="pl-smi" style="color: rgb(51, 51, 51); box-sizing: border-box;">rhs</span><font color="#333333" class="">: </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">Self</span><font color="#333333" class="">) </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">-&gt;</span><font color="#333333" class=""> Self
</font><font color="#333333" class="">  </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">mutating</span><font color="#333333" class=""> </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">func</span><font color="#333333" class=""> </font><span class="pl-en" style="color: rgb(121, 93, 163); box-sizing: border-box;">divide</span><font color="#333333" class="">(</font><span class="pl-en" style="color: rgb(121, 93, 163); box-sizing: border-box;">by</span><font color="#333333" class=""> </font><span class="pl-smi" style="color: rgb(51, 51, 51); box-sizing: border-box;">rhs</span><font color="#333333" class="">: </font><span class="pl-k" style="color: rgb(167, 29, 93); box-sizing: border-box;">Self</span><font color="#333333" class="">)
}
</font></pre></blockquote><div class=""><br class=""></div><div class="">I’d restructure this a bit:</div><div class=""><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">protocol</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Arithmetic {&nbsp;</span><span style="color: rgb(0, 132, 0);" class="">//AFAIK *all* numeric types should be able to do these</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">init</span><span style="font-variant-ligatures: no-common-ligatures" class="">()</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> adding(rhs: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -&gt; </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Self</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">mutating</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> add(rhs: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> subtracting(rhs: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -&gt; </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Self</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">mutating</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> subtract(rhs: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">protocol</span><span style="font-variant-ligatures: no-common-ligatures" class=""> ScalarArithmetic : </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Arithmetic</span><span style="font-variant-ligatures: no-common-ligatures" class=""> {&nbsp;</span><span style="color: rgb(0, 132, 0);" class="">//These can be iffy for non-scalar types</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> multiplied(by rhs: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -&gt; </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Self</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">mutating</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> multiply(by rhs: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> divided(by rhs: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -&gt; </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Self</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">mutating</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> divide(by rhs: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div></div><div class=""><br class=""></div><div class="">Multiplication isn't always defined for any two arbitrarily-dimensioned matrices (plus, there are so many reasonable matrix “subtypes” that there's no guarantee that the return type should always be the same), and I don’t think there’s a generally agreed-upon meaning for matrix division at all.</div><div class=""><br class=""></div><div class="">[Slight_Rabbit_Trail] For a while, I was trying to get work around the issue in my own code by doing something like (this was before the change to “associatedtype”):</div><div class=""><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">public</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">protocol</span><span style="font-variant-ligatures: no-common-ligatures" class=""> MathLibNumberType</span><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;{</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">typealias</span><span style="font-variant-ligatures: no-common-ligatures" class=""> AddType</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">typealias</span><span style="font-variant-ligatures: no-common-ligatures" class=""> AddReturnType</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; ... &nbsp; &nbsp;</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> +(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">_</span><span style="font-variant-ligatures: no-common-ligatures;" class="">:&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">,</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">_</span><span style="font-variant-ligatures: no-common-ligatures;" class="">: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.AddType) -&gt; </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.AddReturnType</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; ...</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">But there was some problem when I got to this part:</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="color: rgb(187, 44, 162); font-variant-ligatures: no-common-ligatures;" class="">public</span><span style="color: rgb(0, 0, 0); font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="color: rgb(187, 44, 162); font-variant-ligatures: no-common-ligatures;" class="">protocol</span><span style="color: rgb(0, 0, 0); font-variant-ligatures: no-common-ligatures;" class=""> ScalarType : </span><span style="font-variant-ligatures: no-common-ligatures;" class=""><font color="#4f8187" class="">MathLibNumberType</font></span><span style="color: rgb(0, 0, 0); font-variant-ligatures: no-common-ligatures;" class="">&nbsp;{</span></div><div style="color: rgb(112, 61, 170); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">typealias</span><span style="font-variant-ligatures: no-common-ligatures" class=""> AddType = </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">Self</span></div><div style="color: rgb(112, 61, 170); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">typealias</span><span style="font-variant-ligatures: no-common-ligatures" class=""> AddReturnType = </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">Self</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp; ...</span></div><div style="color: rgb(112, 61, 170); margin: 0px; line-height: normal;" class="">}</div><div style="color: rgb(112, 61, 170);" class=""><div style="margin: 0px; line-height: normal; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">extension</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </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" class="">ScalarType</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> {}</span></div></div></div></span></div><div class="">I can’t remember what the exact problem was anymore. It’s been a while… I think maybe even pre-Swift 2. &nbsp;Hmm… maybe I should try it again...</div><div class="">[/Slight_Rabbit_Trail]&nbsp;</div><div class=""><br class=""></div><div class="">Anyway, those are my thoughts on the matter.</div><div class=""><br class=""></div><div class="">- Dave Sweeris</div></div></div></div></body></html>