<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 7, 2016, at 2:33 PM, Don Wills &lt;<a href="mailto:don.wills@portablesoftware.com" class="">don.wills@portablesoftware.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant: 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;">Do you really believe that you can stop the "users" who "loathed them so much" from doing what they want to do with Swift? &nbsp;Hubris isn't a strong enough word to describe that attitude.</div></div></blockquote><div><br class=""></div><div>It’s impossible to implement unchecked exceptions in Swift because it lacks any form of stack-unwinding. For example, if A calls B calls C, and B is not marked as ‘throws’, then there is no way for C to return an error back to A. (Unless the error is stored externally, like as an object property, instead of being directly returned.)</div><br class=""><blockquote type="cite" class=""><div class="" style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant: 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;">FWIW, I've already started down the path of dealing with the lack of unchecked &lt;whatever-you-call-em&gt;s by using the following code:</div></blockquote><br class=""></div><div>“try!” isn’t anything like an unchecked exception. It simply <i class="">ignores</i> the error. It’s the equivalent of the unfortunate Java idiom:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>try {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>somethingThatMightThrowAnException();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>} catch(Exception e) { /* la la la I can’t hear you */ }</div><div>Back in my Java days I tracked several mysterious bugs down to usage of this idiom. Internally something was failing, but the exception was ignored so there was no indication of the failure. That made it much harder for me to find.</div><div><br class=""></div><div><blockquote type="cite" class=""><div class="" style="font-family: Alegreya-Regular;"><font face="Courier New" class=""><b class="">&nbsp; &nbsp; throw Exception("Invalid type") &nbsp;/* for those types not supported which is a programmer error */</b></font></div></blockquote><div class=""><div class="" style="font-family: Alegreya-Regular;"><font face="Courier New" class=""><b class=""><br class=""></b></font></div></div></div><div>The correct way to signal a programmer error in Swift is with assert() or fatalError() [sp?]. Which removes your need to use the above workaround, because the method no longer needs to be marked as throws.</div><div><br class=""></div><div>—Jens</div></body></html>