<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Dec 18, 2015 at 1:22 PM, Erica Sadun via swift-users <span dir="ltr"><<a href="mailto:swift-users@swift.org" target="_blank">swift-users@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 style="word-wrap:break-word"><div>2. Is there a way to internalize the generator and not make it public? I'd ideally like to hide all details except the fact that this is a sequence of (Int, Int)</div></div></blockquote><div><br></div><div>You can use AnySequence and AnyGenerator, but they come at a cost of dynamic dispatch for every call. In this case, if you want this component to be suitable for performance-critical code, I would suggest to avoid them for now.</div><div><br></div><div>Dmitri</div><div><br></div></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>