<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="">At a minimum, this gives me&nbsp;<a href="http://swiftstub.com/60017598" class="">http://swiftstub.com/60017598</a></div><div class=""><br class=""></div><div class="">But I remember reading *somewhere* (can't remember) that we were supposed to avoid AnyGenerator/AnySequence and they were on the way out. Am I out of my mind?</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 Dec 18, 2015, at 2:47 PM, Jacob Bandes-Storch &lt;<a href="mailto:jtbandes@gmail.com" class="">jtbandes@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Oops, of course I meant product&lt;S1: SequenceType, S2: SequenceType&gt;(...) !<div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div class="">Jacob<br class=""></div></div></div></div>
<br class=""><div class="gmail_quote">On Fri, Dec 18, 2015 at 1:45 PM, Jacob Bandes-Storch <span dir="ltr" class="">&lt;<a href="mailto:jtbandes@gmail.com" target="_blank" class="">jtbandes@gmail.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">1. Maybe ProductGenerator?<div class="">2. Use AnyGenerator&lt;(T, U)&gt;?</div><div class=""><br class=""></div><div class="">I'd love to see something like this in stdlib:</div><div class=""><br class=""></div><div class="">func product&lt;S1, S2&gt;(s1: S1, s2: S2) -&gt; ProductSequence&lt;S1.Generator.Element, S2.Generator.Element&gt; {</div><div class="">&nbsp; &nbsp; ...</div><div class="">}</div><div class=""><br class=""></div><div class="">where ProductSequence&lt;T,U&gt;.Generator.Element is (T, U).</div><div class=""><br class=""></div><div class="">So your example could be "for (x,y) in product(0..&lt;4, 0..&lt;2)".</div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class=""><div dir="ltr" class=""><div class="">Jacob Bandes-Storch<br class=""></div></div></div></div>
<br class=""><div class="gmail_quote"><div class=""><div class="h5">On Fri, Dec 18, 2015 at 1:22 PM, Erica Sadun via swift-users <span dir="ltr" class="">&lt;<a href="mailto:swift-users@swift.org" target="_blank" class="">swift-users@swift.org</a>&gt;</span> wrote:<br class=""></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><div class="h5"><div style="word-wrap:break-word" class="">Source:&nbsp;<a href="http://swiftstub.com/788132715" target="_blank" class="">http://swiftstub.com/788132715</a><div class=""><br class=""></div><div class="">Two questions:</div><div class=""><br class=""></div><div class="">1. Can anyone recommended a better name than Cartesian? 2D doesn't work for the compiler and I'm looking for something that doesn't seem "floating-point"-y</div><div class="">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 class=""><br class=""></div><div class="">Thanks</div><div class=""><br class=""></div><div class="">-- Erica</div><div class=""><br class=""></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=P-2BsYbBZHRBuLDBJaL4DIKDNfkkjpROowTyRAObV11qw2GpYjFY1N-2B9BLQyR91bR8qHqJt2Mm45fNMiV5iuydvgsESPIuZoy6xBdV9jAWu1AM518i4JJdezVjoA1zy0lb8zVlfSY1VtgihfsWeYksV3dxjfdw1HLcdZ8Z-2FXBd-2BWlK67Psm9l15JTiAYbGukdRJrQTeDKs8tyS2NW-2BgfERdATY-2FEsttTMbZB0J-2F2iBj9U-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important" class="">
</div>
<br class=""></div></div>_______________________________________________<br class="">
swift-users mailing list<br class="">
<a href="mailto:swift-users@swift.org" target="_blank" class="">swift-users@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-users</a><br class="">
<br class=""></blockquote></div><br class=""></div></div>
</blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>