<div dir="ltr">1. Maybe ProductGenerator?<div>2. Use AnyGenerator&lt;(T, U)&gt;?</div><div><br></div><div>I&#39;d love to see something like this in stdlib:</div><div><br></div><div>func product&lt;S1, S2&gt;(s1: S1, s2: S2) -&gt; ProductSequence&lt;S1.Generator.Element, S2.Generator.Element&gt; {</div><div>    ...</div><div>}</div><div><br></div><div>where ProductSequence&lt;T,U&gt;.Generator.Element is (T, U).</div><div><br></div><div>So your example could be &quot;for (x,y) in product(0..&lt;4, 0..&lt;2)&quot;.</div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div>Jacob Bandes-Storch<br></div></div></div></div>
<br><div class="gmail_quote">On Fri, Dec 18, 2015 at 1:22 PM, Erica Sadun via swift-users <span dir="ltr">&lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt;</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">Source: <a href="http://swiftstub.com/788132715" target="_blank">http://swiftstub.com/788132715</a><div><br></div><div>Two questions:</div><div><br></div><div>1. Can anyone recommended a better name than Cartesian? 2D doesn&#39;t work for the compiler and I&#39;m looking for something that doesn&#39;t seem &quot;floating-point&quot;-y</div><div>2. Is there a way to internalize the generator and not make it public? I&#39;d ideally like to hide all details except the fact that this is a sequence of (Int, Int)</div><div><br></div><div>Thanks</div><div><br></div><div>-- Erica</div><div><br></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">
</div>
<br>_______________________________________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
<br></blockquote></div><br></div></div>