John McCall +1<br>I agree. The placement should remain the same.<br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 3, 2017 at 8:29 AM John McCall via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> 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" class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Dec 29, 2016, at 12:33 AM, Dave Abrahams via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br class="m_7586749252269168850Apple-interchange-newline gmail_msg"><div class="gmail_msg"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">on Wed Dec 28 2016, Chris Lattner <</span><a href="http://clattner-at-apple.com/" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg" target="_blank">clattner-AT-apple.com</a><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">> wrote:</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><blockquote type="cite" class="gmail_msg">On Dec 28, 2016, at 9:52 AM, Dave Abrahams <<a href="mailto:dabrahams@apple.com" class="gmail_msg" target="_blank">dabrahams@apple.com</a>> wrote:<br class="gmail_msg"><br class="gmail_msg"><blockquote type="cite" class="gmail_msg">it would be ambiguous to move the ‘throws’ keyword to the end of the<br class="gmail_msg">function type, because you'd get:<br class="gmail_msg"><br class="gmail_msg"></blockquote></blockquote><br class="gmail_msg"><blockquote type="cite" class="gmail_msg"><blockquote type="cite" class="gmail_msg"><span class="m_7586749252269168850Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>let x : (_ a : Int) -> (_ b: Float) -> Double throws throws<br class="gmail_msg"></blockquote><br class="gmail_msg">I see. <br class="gmail_msg"><br class="gmail_msg">We *could* say that the "throws" keyword comes after the return type<br class="gmail_msg">unless it's a function type, in which case it comes after the return<br class="gmail_msg">type's parameter list<br class="gmail_msg"><br class="gmail_msg"> let x : (_ a : Int) -> (_ b: Float) throws -> Double throws<br class="gmail_msg"><br class="gmail_msg">I admit this is a horrible rule from a language designer's point of view<br class="gmail_msg">but there's a chance it could end up being better for users.<br class="gmail_msg"></blockquote><br class="gmail_msg">Indeed this is horrid for an ivory tower language designer, but the<br class="gmail_msg">pragmatic among them often have to make concessions to the real world.<br class="gmail_msg">That said, I think this would be worse for typical swift programmers<br class="gmail_msg">as well: it introduces multiple ways to do things,<span class="m_7586749252269168850Apple-converted-space gmail_msg"> </span><br class="gmail_msg"></blockquote><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">Do you mean it introduces multiple ways to do the *same* thing? I</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">didn't think I was introducing any of those. If you think I was, you</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">probably misunderstood my suggestion (or I did!), FWIW.</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg">Chris's point is that we can't stop allowing "throws" where it currently is, and</div><div class="gmail_msg">therefore any proposal which allows it in a new place creates two ways of</div><div class="gmail_msg">spelling the same thing.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Also, your proposal reinterprets the currently-valid syntax:</div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"> (_ a : Int) -> (_ b : Float) throws -> Double</div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg">Currently this means a non-throwing function that returns a throwing function.</div><div class="gmail_msg">Your proposal flips it around.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Also, I would find this extremely surprising as a user. A core aspect of the</div><div class="gmail_msg">first function type is written *inside* the second? With all respect, Dave,</div><div class="gmail_msg">that is just bizarre. :)</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I'm sorry if people dislike the placement of "throws", but that ship has sailed,</div><div class="gmail_msg">and any attempt to "fix" it at this point is just going to cause problems for</div><div class="gmail_msg">negligible benefit.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">As I see it, the current syntax has one mild deficiency, called out previously</div><div class="gmail_msg">in this thread: a reader has to recognize that "throws -> X" does not mean</div><div class="gmail_msg">that the function throws an X, but instead that it either throws or returns an X.</div><div class="gmail_msg">It's always nice when something is immediately obvious and doesn't have to</div><div class="gmail_msg">be explicitly learned, and I appreciate and mourn that my design may have</div><div class="gmail_msg">fallen short of that standard here. However, overall I still do think the syntax</div><div class="gmail_msg">is much cleaner than the alternatives, especially as return types grow more</div><div class="gmail_msg">complicated, and that this small rule is not at all difficult to master.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">For what it's worth, this visual ambiguity is precisely why I would insist that</div><div class="gmail_msg">any typed-throws addition be spelled "throws(X)" instead of "throws X".</div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">John.</div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg">which work inconsistently and surprisingly in some cases.<br class="gmail_msg"><br class="gmail_msg">Here is a different way of looking at this: The predictable case is<br class="gmail_msg">the one we already have now (and we wouldn’t take it away). Is your<br class="gmail_msg">beef with the current syntax so great that you think it is worth<br class="gmail_msg">adding complexity to the language to privilege some special cases?<br class="gmail_msg"></blockquote><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">Not really, no.</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">--<span class="m_7586749252269168850Apple-converted-space gmail_msg"> </span></span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">-Dave</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">_______________________________________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">swift-evolution mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><a href="mailto:swift-evolution@swift.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class="gmail_msg"></div>_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div>