<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">What about Kevin&#39;s Rust-like approach (the fuse) as an alternative considered? <br>He suggested that instead of changing the guarantees and behavior of the existing<br>GeneratorType, that Swift introduce a new FuseGenerator adaptor that could include <br>extra state ensuring that it could safely return nil  indefinitely as Rust does</blockquote><div><br></div><div>I&#39;ll include a section about that! </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 19, 2016 at 1:16 AM, Erica Sadun <span dir="ltr">&lt;<a href="mailto:erica@ericasadun.com" target="_blank">erica@ericasadun.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>What about Kevin&#39;s Rust-like approach (the fuse) as an alternative considered? </div><div>He suggested that instead of changing the guarantees and behavior of the existing</div><div>GeneratorType, that Swift introduce a new FuseGenerator adaptor that could include </div><div>extra state ensuring that it could safely return nil  indefinitely as Rust does</div><div><br></div><div>-- E</div><div><br></div><br><div><blockquote type="cite"><span class=""><div>On Mar 17, 2016, at 11:47 PM, Patrick Pijnappel via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br></span><div><div dir="ltr">Proposal pull request: <a href="https://github.com/apple/swift-evolution/pull/213" target="_blank">#213</a><div><span class="">Implementation pull request: <a href="https://github.com/apple/swift/pull/1702" target="_blank">#1702</a><br><div>Original pitch thread: <a href="http://thread.gmane.org/gmane.comp.lang.swift.evolution/8519" target="_blank">[Proposal] Change guarantee for GeneratorType.next() to always return nil past end</a></div><div><br></div></span><span class=""><div><h1 style="font-size:2.25em;margin-right:0px;margin-bottom:16px;margin-left:0px;line-height:1.2;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;margin-top:0px!important"><span style="font-size:1.75em">Alternatives considered</span></h1><ul style="padding-left:2em;margin-top:0px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;font-size:16px;margin-bottom:0px!important"><li>Require <code style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">IteratorType</code> to not crash but keep the return value up to specific implementations. This allows them to use it for other behavior e.g. repeating the sequence after <code style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">nil</code> is returned. This however retains most of the problems of the original guaranteee described in this proposal.</li></ul><div><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3"><br></font></div></div></span></div></div><span class="">
_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></span></div></blockquote></div><br></div></blockquote></div><br></div>