<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="">Lazier.<div class=""><br class=""></div><div class=""><a href="http://swiftstub.com/596982131" class="">http://swiftstub.com/596982131</a></div><div class=""><br class=""></div><div class=""><br class=""><div style=""><blockquote type="cite" class=""><div class="">On Dec 18, 2015, at 3:32 PM, Erica Sadun <<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">p.s. <a href="http://swiftstub.com/195460039" class="">http://swiftstub.com/195460039</a><div class=""><br class=""></div><div class="">(I'm sure this could be done more lazily and well)</div><div class=""><br class=""></div><div class=""><br class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 18, 2015, at 2:47 PM, Jacob Bandes-Storch <<a href="mailto:jtbandes@gmail.com" class="">jtbandes@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Oops, of course I meant product<S1: SequenceType, S2: SequenceType>(...) !<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=""><<a href="mailto:jtbandes@gmail.com" target="_blank" class="">jtbandes@gmail.com</a>></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<(T, U)>?</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<S1, S2>(s1: S1, s2: S2) -> ProductSequence<S1.Generator.Element, S2.Generator.Element> {</div><div class=""> ...</div><div class="">}</div><div class=""><br class=""></div><div class="">where ProductSequence<T,U>.Generator.Element is (T, U).</div><div class=""><br class=""></div><div class="">So your example could be "for (x,y) in product(0..<4, 0..<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=""><<a href="mailto:swift-users@swift.org" target="_blank" class="">swift-users@swift.org</a>></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: <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=""></div></div></div></div></blockquote></div><br class=""></div></body></html>