<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="">Howdy,<div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>I love it! &nbsp;The “do" blocks never did “feel” like Swift. &nbsp;I can see how both would be useful.</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>I like to use as many conditionals in a single guard statement as I can get away with, so I was concerned that guard/catch would need to interoperate with guard/else. &nbsp;However, I am fairly convinced that, at least for now, having to choose between guard /catch and guard /else is not that much of a problem. &nbsp;guard/catch appears optimized for the simple-call case, where there is a single throwing expression, so the code can handle its specific error/s more precisely. &nbsp;When catching anything in a batch is the goal, then a do block is probably fine.</div><div class="">-Ben</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 5, 2017, at 1:30 PM, Soroush Khanlou via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I’d like to propose a guard/catch construct to the language. It would allow code to use throwing functions and handle errors fully, without straying from a happy path. do/catch can be a bit heavy-handed sometimes, and it would be nice to be able to handle throwing functions without committing to all the nesting and ceremony of do/catch.</div><div class=""><br class=""></div><div class="">Full proposal, which discusses all the corner cases and alternatives:</div><div class=""><a href="https://gist.github.com/khanlou/8bd9c6f46e2b3d94f0e9f037c775f5b9" class="">https://gist.github.com/khanlou/8bd9c6f46e2b3d94f0e9f037c775f5b9</a></div><div class=""><br class=""></div><div class="">Looking forward to feedback!</div><div class=""><br class=""></div><div class="">Soroush</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=""></div></body></html>