<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Shouldn't it be:</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature"><span style="background-color: rgba(255, 255, 255, 0);">func foo() yields -> String</span><br><br>Also +1 on the idea.<br><br>/Jonathan</div><div><br>12 dec. 2015 kl. 03:18 skrev Jordan Rose via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>>:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div class="">Another possible syntax, inspired by "throws".</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">func foo() yield -> String</div></blockquote><div class=""><br class=""></div><div class="">I'm not sure what happens if a function both yields <i class="">and</i> throws. I guess that can't happen right now because generators are required not to throw when producing their next() value.</div><div class=""><br class=""></div><div class="">Jordan</div><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 11, 2015, at 18:14 , Jordan Rose <<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">It's desireable for the signature of a function to be fully checkable without looking at the body, for a number of reasons. It's also something clients of a library will want to know, so it needs to be displayed in the library's interface <i class="">somehow.</i></div><div class=""><i class=""><br class=""></i></div><div class="">Jordan</div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 11, 2015, at 18:03 , Andrey Tarantsov 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="">Do we actually need the "generator" keyword? Why can't the compiler figure it out by the presence of yield?<br class=""><br class="">And "yield" is a fairly standard keyword across languages, so no harm in claiming it, IMO.<br class=""><br class="">+1 on the proposal.<br class=""><br class="">A.<br class=""><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="">
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=3H-2Bjq6g-2FrmhPdZznzzcOM7hJzszzEydjVMmbmBFWR96hy3ygGRbQvIk8dH1OU0GUrZsSY94oup2S9SOuVr68dW16Zi1QKtsjo6Csz58uQD8QcJzyVyfawQOk8IF-2FVONNtG5WJkf7qwt6ZLkFy3dU-2BZMBejaeiXG5sx-2BbO7uixqBGcuk8I9SYKLXS-2BHb9h-2BVl2QnAkTZeOyj0J-2FFRA-2FboDWIiySmcPXADkcwoEyQuPxQ-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;">
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>