<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Dec 13, 2015 at 3:43 PM, Michael Henson via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Currently, the construct:<br><br>for x in something {}<div><br>expects "something" to be a SequenceType. From that variable, the underlying code retrieves a generator by calling something.generate(). The resulting GeneratorType instance is unavailable to calling code.<br><br>Unless there is a reason for the language to require a SequenceType, it seems like there are good use cases for accepting a caller-provided GeneratorType, too.<br></div></div></blockquote><div><br></div><div>I support this. We would need to define what happens when the expression is both a generator and a sequence, but otherwise I don't see why not.</div><div><br></div><div>Dmitri</div></div><div><br></div>-- <br><div class="gmail_signature">main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if<br>(j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>>*/</div>
</div></div>