<div style="white-space:pre-wrap">Yes, I meant for the email to go to the list. <br><br>&gt; Nope, that doesn&#39;t work because of my comment above.  That&#39;s the change to Swift I am hoping will be adopted for 3.0.<br><br>Did you try this? The idea is to write a function for multiplying a Number and an Int, so the rhs will create a Number which will then be set to the variable. It should work actually. </div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 7, 2015 at 00:47 Don Wills &lt;<a href="mailto:don.wills@portablesoftware.com">don.wills@portablesoftware.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hello Ilya,<div><br></div><div></div></div><div style="word-wrap:break-word"><div>On Dec 6, 2015, at 1:09 PM, ilya &lt;<a href="mailto:ilya.nikokoshev@gmail.com" target="_blank">ilya.nikokoshev@gmail.com</a>&gt; wrote:<br></div></div><div style="word-wrap:break-word"><div><div><blockquote type="cite"><div><div dir="ltr"><div><br></div>On Sun, Dec 6, 2015 at 5:26 PM, Don Wills via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Silvan,</div><div><br></div>Yes, I understand the concern you raise.  I too have held that general opinion of overloading operators in other languages for many years.  That said, overloading arithmetic and other operators causes the same opportunity for abuse.   </div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">For example, overloading + for integers to do something different (like rounding instead of truncation) would make maintenance of existing programs into a giant guessing game.<div><br></div><div>That said, once the cat is out of the bag to overload operators, I don&#39;t see how adding support for = makes things any worse.</div><div><br></div></div></blockquote><div><br></div><div>This is not really the same. You only use + explicitely, but the compiler must insert some assigments automatically, for example by copying when the function closes over some variables. It must know exactly what the semantics in this case is to be able to compile correct program.</div></div></div></div></div></blockquote><div><br></div></div></div></div><div style="word-wrap:break-word"><div><div>My example wasn&#39;t the best.  IMO, there is almost no conceptual difference between &quot;amount = 5.5;&quot; and &quot;amount += 5.5;&quot;.  The second example works (that is += can be overloaded) where the first example is not allowed because when I try to define the &quot;func = (...) {...}&quot; overload implementation, the compiler squawks.</div></div></div><div style="word-wrap:break-word"><div><div><br><div><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div></div><div>FYI, the reason for my suggestion is to add support for fixed decimal arithmetic just like that available in COBOL.  Yeh I can hear the groans now.  </div></div></blockquote><div><br></div><div>I&#39;m with you.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>However, for business applications, fixed decimal arithmetic is a basic feature that has been tossed away in new languages by language designers who don&#39;t actually labor in the trenches. </div></div></blockquote><div><br></div><div>I didn&#39;t look into the new Foundation, but doesn&#39;t it contain NSDecimalNumber? </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div> </div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div> I&#39;ve built a simple class to do just that - here is some sample code that uses my Number class that gives an idea of what the code does:</div><div><br></div><div>var amount = Number(left: 6, right: 2);</div><div>var result = Number(left: 9, right: 2);</div><div>amount &lt;- 3.9;</div><div>amount += 1;</div><div>result &lt;- amount * 4;</div><div>print(result)</div><div><br></div></div></blockquote><div><br></div><div>I&#39;m not sure why you feel the need to overload = in this example. If Number * Int -&gt; Number is defined, you can just use</div><div><br></div><div>result = amount * 4</div></div></div></div></div></blockquote><div><br></div></div></div></div><div style="word-wrap:break-word"><div><div><div>Nope, that doesn&#39;t work because of my comment above.  That&#39;s the change to Swift I am hoping will be adopted for 3.0.</div><div><br></div><div>Did you mean to not post your email to me only?  I haven&#39;t figured out the protocol for this email list yet.</div></div></div></div><div style="word-wrap:break-word"><div><div><div><br></div><div>Don Wills</div><div><br></div></div></div></div></blockquote></div>