<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">What about Kevin's Rust-like approach (the fuse) as an alternative considered?&nbsp;</div><div class="">He&nbsp;suggested that instead of changing the guarantees and behavior of the existing</div><div class="">GeneratorType, that Swift introduce a new FuseGenerator adaptor that could include&nbsp;</div><div class="">extra state ensuring that it could safely return nil &nbsp;indefinitely as Rust does</div><div class=""><br class=""></div><div class="">-- E</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 17, 2016, at 11:47 PM, Patrick Pijnappel 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=""><div dir="ltr" class="">Proposal pull request: <a href="https://github.com/apple/swift-evolution/pull/213" class="">#213</a><div class="">Implementation pull request: <a href="https://github.com/apple/swift/pull/1702" class="">#1702</a><br class=""><div class="">Original pitch thread:&nbsp;<a href="http://thread.gmane.org/gmane.comp.lang.swift.evolution/8519" class="">[Proposal] Change guarantee for GeneratorType.next() to always return nil past end</a></div><div class=""><br class=""></div><div class=""><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:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';margin-top:0px!important" class=""><span style="font-size: 1.75em;" class="">Alternatives considered</span></h1><ul style="padding-left:2em;margin-top:0px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;margin-bottom:0px!important" class=""><li style="" class="">Require&nbsp;<code style="font-family:Consolas,'Liberation Mono',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" class="">IteratorType</code>&nbsp;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&nbsp;<code style="font-family:Consolas,'Liberation Mono',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" class="">nil</code>&nbsp;is returned. This however retains most of the problems of the original guaranteee described in this proposal.</li></ul><div class=""><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3" class=""><br class=""></font></div></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>