<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="">-1 for addressing this now. Typed throws will undoubtedly affect this change and the two issues should be addressed at the same time.</div><div class=""><br class=""></div><div class="">As a Java veteran, I agree with the sentiment to avoid the Java exception typing mechanism which complicates using and maintaining large projects. Knowing the recoverable exceptions that a function can throw cane be useful, however, and some sort of optional listing of exception types is probably the best solution.</div><div class=""><br class=""></div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Dec 28, 2016, at 2:36 PM, Anton Zhilin 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 dir="ltr" class=""><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important" class="">TLDR: I support moving <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="">throws</code>, and also think that ‘typed throws’ should fit for Phase 2, at least.</p>
<blockquote style="margin:1.2em 0px;border-left:4px solid rgb(221,221,221);padding:0px 1em;color:rgb(119,119,119);quotes:none" class="">
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px" class=""><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important" class="">let x : (_ a : Int) -> (_ b: Float) throws -> Double throws
</code></pre></blockquote><p style="margin:0px 0px 1.2em!important" class="">Count me in those who cried in anger :)</p>
<hr class=""><p style="margin:0px 0px 1.2em!important" class="">I see why current syntax is very logical for currying:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px" class=""><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important" class="">let x: (Int) throws -> (Float) throws -> Double // clean
let x: (Int) -> (Float) -> Double throws throws // looks ambiguous
</code></pre><p style="margin:0px 0px 1.2em!important" class="">Although, the ambiguity can be resolved using parentheses:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px" class=""><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important" class="">let x: (Int) -> ((Float) -> Double throws) throws
let x: (Int) -> ((Float) -> Double throws Error2) throws Error1 // with 'typed throws'
</code></pre><p style="margin:0px 0px 1.2em!important" class="">Compare it to how we incorporate optionals (which are just another form of error handling) in curried functions now:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px" class=""><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important" class="">let x: (Int) -> ((Float) -> Double?)?
</code></pre><p style="margin:0px 0px 1.2em!important" class="">Overall, current Swift syntax is uniquely nice to error handling in curried functions. Is it worth keeping this advantage? Probably not, if the new form does not contain too much noise and is even more logical. Everything slides into place, if <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="">throws</code> is a binary operator on types with precedence higher than <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="">-></code>. Although <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="">A throws B</code> is not a type on itself, I can clearly see it becoming one in the future. Then <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="">try</code> will handle pattern matching of such types.</p><p style="margin:0px 0px 1.2em!important" class="">Another point for the suggested syntax: as we now know, Swift users prefer to see results after <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="">-></code> in function declarations. Is it stretching too far to conclude that error type is a possible result, and should also come after <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="">-></code>?</p>
<div title="MDH:PGRpdj5UTERSOiBJIHN1cHBvcnQgbW92aW5nIGB0aHJvd3NgLCBhbmQgYWxzbyB0aGluayB0aGF0
ICd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b21pbmcgb25lIGluIHRoZSBmdXR1cmUuIFRoZW4gYHRyeWAgd2ls
bCBoYW5kbGUgcGF0dGVybiBtYXRjaGluZyBvZiBzdWNoIHR5cGVzLjwvZGl2PjxkaXY+PGJyPjwv
ZGl2PjxkaXY+QW5vdGhlciBwb2ludCBmb3IgdGhlIHN1Z2dlc3RlZCBzeW50YXg6IGFzIHdlIG5v
dyBrbm93LCBTd2lmdCB1c2VycyBwcmVmZXIgdG8gc2VlIHJlc3VsdHMgYWZ0ZXIgYC0mZ3Q7YCBp
biBmdW5jdGlvbiBkZWNsYXJhdGlvbnMuIElzIGl0IHN0cmV0Y2hpbmcgdG9vIGZhciB0byBjb25j
bHVkZSB0aGF0IGVycm9yIHR5cGUgaXMgYSBwb3NzaWJsZSByZXN1bHQsIGFuZCBzaG91bGQgYWxz
byBjb21lIGFmdGVyIGAtJmd0O2A/PC9kaXY+PC9kaXY+PC9kaXY+PC9kaXY+" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0" class=""></div></div></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>