<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="">Silvan,</div><div class=""><br class=""></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. 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 class=""><br class=""></div><div class="">That said, once the cat is out of the bag to overload operators, I don't see how adding support for = makes things any worse.</div><div class=""><br class=""></div><div class="">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. However, for business applications, fixed decimal arithmetic is a basic feature that has been tossed away in new languages by language designers who don't actually labor in the trenches. I'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 class=""><br class=""></div><div class="">var amount = Number(left: 6, right: 2);</div><div class="">var result = Number(left: 9, right: 2);</div><div class="">amount <- 3.9;</div><div class="">amount += 1;</div><div class="">result <- amount * 4;</div><div class="">print(result)</div><div class=""><br class=""></div><div class="">Note that <- is the assignment operator. I am sure all would agree that = is superior in this situation. Such code would be far more readable and the Number values would act just like and interoperate with Float and Int in all regards *except* that currently the = operator is not available for assignment.</div><div class=""><br class=""></div><div class="">Don Wills</div><div class=""><br class=""></div><div class="">PS. FWIW, the IEEE 754-2008 d128 alternative that Chris Lattner mentioned to me is inferior to the kind of support for fixed decimal arithmetic that I believe would help make Swift superior to C# for business applications.</div><div class=""><br class=""></div><div class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Dec 6, 2015, at 6:58 AM, Silvan Mosberger <<a href="mailto:kametrixom@icloud.com" class="">kametrixom@icloud.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Don</div><div class=""><br class=""></div><div class="">I think this is a terrible idea! Imagine what you’d be able to do with that:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 18px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #35568a" class="">let</span> x : <span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">String</span> = <span style="font-variant-ligatures: no-common-ligatures; color: #35568a" class="">3</span></div></div><div class=""><br class=""></div><div class="">This would lead to the same problems already discussed with implicit initialisers: <a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151130/000531.html" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151130/000531.html</a>, just worse. Also assignment is something more fundamental than other operators, I doubt it’s even possible to do that.</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 06 Dec 2015, at 14:44, Don Wills via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">The ability to overload operators is very useful. However, that utility is diminished without the ability to overload the simple assignment operator ( = ). I vaguely recall reading somewhere that there is a reason for this having to do with syntax ambiguity. Can this problem be solved so that = can be overloaded?<br class=""><br class="">Don Wills<br class="">_______________________________________________<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></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></body></html>