<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=""><div class="">My mistake, here is a truly lazy version (it gets a little ugly yes):</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><font size="1" class=""><span style="color: rgb(53, 86, 138);" class="">func</span> helloGenerator(name : <span style="color: rgb(195, 89, 0);" class="">String</span>?) -&gt; <span style="color: rgb(195, 89, 0);" class="">LazyMapCollection</span>&lt;[() -&gt; <span style="color: rgb(195, 89, 0);" class="">String</span>], <span style="color: rgb(195, 89, 0);" class="">String</span>&gt; {</font></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><font size="1" class="">&nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #35568a" class="">return</span> [</font></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><font size="1" class="">&nbsp; &nbsp; &nbsp; &nbsp; { <span style="font-variant-ligatures: no-common-ligatures; color: #e82300" class="">"Hello"</span> },</font></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><font size="1" class="">&nbsp; &nbsp; &nbsp; &nbsp; { name ?? <span style="font-variant-ligatures: no-common-ligatures; color: #e82300" class="">"World"</span> }</font></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><font size="1" class="">&nbsp; &nbsp; ].<span style="font-variant-ligatures: no-common-ligatures; color: #587ea8" class="">lazy</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #587ea8" class="">map</span>{ $0() }</font></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><font size="1" class="">}</font></div><div><br class=""></div>I agree that this would make it very convenient. I’m +.5 on this, because I don’t like adding two more keywords for a single feature, but it seems like it has good applications<div><br class=""></div><div><blockquote type="cite" class=""><div class="">On 12 Dec 2015, at 02:50, Kevin Wooten &lt;<a href="mailto:kdubb@me.com" class="">kdubb@me.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><br class="Apple-interchange-newline">On Dec 11, 2015, at 6:38 PM, Kametrixom Tikara 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 class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">What exactly is the difference to just returning a sequence?<div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="1" class=""><span class="" style="color: rgb(53, 86, 138);">func</span><span class="Apple-converted-space">&nbsp;</span>helloGenerator(name :<span class="Apple-converted-space">&nbsp;</span><span class="" style="color: rgb(195, 89, 0);">String</span>?) -&gt; [<span class="" style="color: rgb(195, 89, 0);">String</span>] {</font></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="1" class="">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span><span class="" style="color: rgb(53, 86, 138);">return</span><span class="Apple-converted-space">&nbsp;</span>[</font></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="1" class="">&nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span><span class="" style="color: rgb(232, 35, 0);">"Hello"</span>,</font></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="1" class="">&nbsp; &nbsp; &nbsp; &nbsp; name ??<span class="Apple-converted-space">&nbsp;</span><span class="" style="color: rgb(232, 35, 0);">"World"</span></font></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="1" class="">&nbsp; &nbsp; ]</font></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="1" class="">}</font></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 16px;"><font size="1" class=""><br class=""></font></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(88, 126, 168);"><font size="1" class=""><span class="" style="color: rgb(53, 86, 138);">for</span><span class=""><span class="Apple-converted-space">&nbsp;</span>str<span class="Apple-converted-space">&nbsp;</span></span><span class="" style="color: rgb(53, 86, 138);">in</span><span class=""><span class="Apple-converted-space">&nbsp;</span></span>helloGenerator<span class="">(</span><span class="" style="color: rgb(232, 35, 0);">"David"</span><span class="">) {</span></font></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="1" class="">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span><span class="" style="color: rgb(88, 126, 168);">print</span>(str)</font></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="1" class="">}</font></div><div class=""><br class=""></div><div class="">And if you want if lazy:</div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="1" class=""><span class="" style="color: rgb(53, 86, 138);">func</span><span class="Apple-converted-space">&nbsp;</span>helloGenerator(name :<span class="Apple-converted-space">&nbsp;</span><span class="" style="color: rgb(195, 89, 0);">String</span>?) -&gt;<span class="Apple-converted-space">&nbsp;</span><span class="" style="color: rgb(195, 89, 0);">LazyCollection</span>&lt;[<span class="" style="color: rgb(195, 89, 0);">String</span>]&gt; {</font></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="1" class="">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span><span class="" style="color: rgb(53, 86, 138);">return</span><span class="Apple-converted-space">&nbsp;</span>[</font></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="1" class="">&nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span><span class="" style="color: rgb(232, 35, 0);">"Hello"</span>,</font></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="1" class="">&nbsp; &nbsp; &nbsp; &nbsp; name ??<span class="Apple-converted-space">&nbsp;</span><span class="" style="color: rgb(232, 35, 0);">"World"</span></font></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="1" class="">&nbsp; &nbsp; ].<span class="" style="color: rgb(88, 126, 168);">lazy</span></font></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="1" class="">}</font></div></div><div class=""><br class=""></div></div></div></div></blockquote><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Imagine reading images from a directory and returning them lazily. &nbsp;I don’t think anybody is arguing that you cannot implement it now with a special lazy collection (your version actually materializes the array fully first) but here’s how simple it could be:</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">func readAllImagesInDirectory(path: String) -&gt; GeneratorType&lt;Image&gt; {</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>let imagePaths = listImagesInDirectory(path)</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>return generator func generatorImage() -&gt; Image {</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="Apple-tab-span" style="white-space: pre;">                </span>for imagePath in imagePaths {</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="Apple-tab-span" style="white-space: pre;">                        </span>yield&nbsp;readImageAtPath(image</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="Apple-tab-span" style="white-space: pre;">                </span>}</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>}</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">}</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">(Please forgive any errant syntax in my contrived example). &nbsp;Point is it could be a very fast/compact way to create generators; although it’s possible today.</div><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class="">Seems like exactly the same, except it doesn’t need two new keywords nor revamping of SequenceType/GeneratorType</div><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 12 Dec 2015, at 01:21, David Waite 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 class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Looking for feedback on crafting a proposal adding generator functions to Swift. I understand this will likely be a very involved proposal at the language level, although I actually don’t know the complexity of the change within the Swift compiler itself.<div class=""><div class=""><br class=""></div><div class="">This would be a function which returns multiple values, which is converted by the compiler to a function returning a SequenceType<div class=""><br class=""></div><div class="">A very basic syntax would be to add generator as a modifier to func, and likely involve a new keyword ‘yield’ to differentiate from the flow control behavior of ‘return’.</div><div class=""><br class=""></div><div class="">So for example:</div><div class=""><br class=""></div><blockquote class="" style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div class="">generator func helloGenerator(name:String?) -&gt; String {</div><div class="">&nbsp; &nbsp; yield “Hello”</div><div class="">&nbsp; &nbsp; yield name ?? “World”</div><div class="">}</div></blockquote><div class=""><br class=""></div><div class="">Would have the following expected usage:</div><div class=""><br class=""></div><blockquote class="" style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div class="">for str in helloGenerator(“David") {</div><div class="">&nbsp; &nbsp;print str</div>// prints:</blockquote><blockquote class="" style="margin: 0px 0px 0px 40px; border: none; padding: 0px;">// &nbsp; &nbsp;Hello<br class=""><div class="">// &nbsp; &nbsp;David</div></blockquote><blockquote class="" style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div class="">}</div></blockquote><br class=""><div class=""><div class="">And for those unfamiliar to these sorts of simple cases, would have equivalent behavior to the following code:</div><div class=""><br class=""></div><blockquote class="" style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;45&gt;<span class="Apple-converted-space">&nbsp;</span></span>func helloGenerator(name:String?) -&gt; HelloGenerator {&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;46.<span class="Apple-converted-space">&nbsp;</span></span>&nbsp; return HelloGenerator(name)&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(169, 169, 169);">&nbsp;47.<span class="Apple-converted-space">&nbsp;</span><span class="">}&nbsp;</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(169, 169, 169);">&nbsp;48.<span class="Apple-converted-space">&nbsp;</span><span class="">&nbsp;</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;49.<span class="Apple-converted-space">&nbsp;</span></span>struct HelloGenerator : GeneratorType, SequenceType {&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;50.&nbsp;</span><span class="Apple-converted-space">&nbsp;</span>&nbsp; var position:Int = 0&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;51.&nbsp;</span><span class="Apple-converted-space">&nbsp;</span>&nbsp; let name:String?&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(169, 169, 169);">&nbsp;52.<span class="Apple-converted-space">&nbsp;</span><span class="">&nbsp;</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;53.&nbsp;</span><span class="Apple-converted-space">&nbsp;</span>&nbsp; private init(_ name:String?) {&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;54.<span class="Apple-converted-space">&nbsp;</span></span>&nbsp; &nbsp; &nbsp; self.name = name&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;55.&nbsp;</span><span class="Apple-converted-space">&nbsp;</span>&nbsp; }&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(169, 169, 169);">&nbsp;56.&nbsp;<span class=""><span class="Apple-converted-space">&nbsp;</span>&nbsp; &nbsp;</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;57.&nbsp;</span><span class="Apple-converted-space">&nbsp;</span>&nbsp; func generator() -&gt; HelloGenerator {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;58.&nbsp;</span><span class="Apple-converted-space">&nbsp;</span>&nbsp; &nbsp; &nbsp; return self&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;59.&nbsp;</span><span class="Apple-converted-space">&nbsp;</span>&nbsp; }&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;60.<span class="Apple-converted-space">&nbsp;</span></span>&nbsp; &nbsp; &nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;61.&nbsp;</span><span class="Apple-converted-space">&nbsp;</span>&nbsp; mutating func next() -&gt; String? {&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;62.<span class="Apple-converted-space">&nbsp;</span></span>&nbsp; &nbsp; &nbsp; switch position {&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;63.<span class="Apple-converted-space">&nbsp;</span></span>&nbsp; &nbsp; &nbsp; case 0:&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;64.<span class="Apple-converted-space">&nbsp;</span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; position = 1&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;65.<span class="Apple-converted-space">&nbsp;</span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return "Hello"&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;66.<span class="Apple-converted-space">&nbsp;</span></span>&nbsp; &nbsp; &nbsp; case 1:&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;67.<span class="Apple-converted-space">&nbsp;</span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; position = 2&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;68.<span class="Apple-converted-space">&nbsp;</span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return name ?? "World"&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;69.<span class="Apple-converted-space">&nbsp;</span></span>&nbsp; &nbsp; &nbsp; default:&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;70.<span class="Apple-converted-space">&nbsp;</span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return nil&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;71.<span class="Apple-converted-space">&nbsp;</span></span>&nbsp; &nbsp; &nbsp; }&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(169, 169, 169);">&nbsp;72.&nbsp;</span><span class="Apple-converted-space">&nbsp;</span>&nbsp; }&nbsp;</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(169, 169, 169);">&nbsp;73.<span class="Apple-converted-space">&nbsp;</span><span class="">}&nbsp;</span></div></div><div class=""><br class=""></div></blockquote>This syntax has at a bare minimum issues with generator closures and for a terse syntax for yielding over another sequence type within a generator function vs. using a loop. (possibly “yield in sequenceName”)</div><div class=""><br class=""></div><div class="">The interaction with the error system might involve disallowing throws from generator functions, or having the Element type be a Result&lt;T&gt; rather than T, as the GeneratorType next() method is not declared as throwing.</div><div class=""><br class=""></div><div class=""><div class="">This could pair well to make for-in loops more comprehensive, especially if C-style for loops are eliminated.</div></div><div class=""><br class=""></div><div class="">This would possibly be a first step toward a coroutine-based concurrency system, although I am not proposing that sort of usage or scope here. The goal would be to emit an object compatible with SequenceType</div></div><div class=""><br class=""></div><div class="">-David Waite (DW)</div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=UMghxGHOvTEcVGG3PKHzuJe-2F1jwKPcDcSNH0SiRhP154FpbHyH8LgfGq4t4pY0jlEzFyN3HG0284UFBybtPAVRsupOwEhsCN2pXeRkqc831KfClDufYK5Kl4WNqtWpBbjzIyzXRbhMZmZppGDt9RYzBk3yCacZhYgXUJQK4FGfP6ZgzUedIBjcHAlKZlb5Z5kMydnZo9wpG8pAM77QPtBU-2Bgl-2BMjyQGxgf-2FwNnwzxdc-3D" alt="" width="1" height="1" border="0" class="" style="height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;"></div>_______________________________________________<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></blockquote></div><br class=""></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=1Ry8ov4zuU66O51YNcjYWY2OsnHz47cZjZ4sjBGk0IxbQ-2BjzsdPNCuLincv3quL98yGAQP6a4UXTK2OsEZkaXQ13XpJ7Xcg-2FcVyWl9ajn1s7PBRQfjU1gtpLbwFpbcaLwSNXKv9qhoogIPuCKLfNZt7y7xzQx4ena9LBG-2FVV5bkD7lCy7AynxrJxoM-2Bshl2wIy1OXiVyk4YgNs9rZcKH8g-3D-3D" alt="" width="1" height="1" border="0" class="" style="height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;"></div>_______________________________________________<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></div></blockquote></div></blockquote></div><br class=""></div></body></html>