<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div class="">Jaden Geller: What benefit do Iterator2D and Iterator3D provide that nesting does not?</div></div></div></blockquote><br class=""></div></div></div></blockquote><blockquote type="cite" class="">Ted F.A. van Gaalen: well, simply because of hiding/enclosing repetitive functionality like with every other programming element is convenient, prevents errors and from writing the same over and over again.</blockquote><div><br class=""></div><div>I’m not sure why you’re trying to avoid sequences - as far as the actual values you are iterating over, your needs seem to be pretty well covered by the existing stride() family.</div><div><br class=""></div><div>Given that you just want to flatten the call sites, perhaps something like this would suit your needs:</div><div><br class=""></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> xrange = </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">stride</span><span style="font-variant-ligatures: no-common-ligatures" class="">(from: </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0.0</span><span style="font-variant-ligatures: no-common-ligatures" class="">, to: </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">30.0</span><span style="font-variant-ligatures: no-common-ligatures" class="">, by: </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">10.0</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> yrange = </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">stride</span><span style="font-variant-ligatures: no-common-ligatures" class="">(from: </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0.0</span><span style="font-variant-ligatures: no-common-ligatures" class="">, to: </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">20.0</span><span style="font-variant-ligatures: no-common-ligatures" class="">, by: </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">5.0</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> zrange = </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">stride</span><span style="font-variant-ligatures: no-common-ligatures" class="">(from: </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">10.0</span><span style="font-variant-ligatures: no-common-ligatures" class="">, to:</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">-10.0</span><span style="font-variant-ligatures: no-common-ligatures" class="">, by:</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">-5.0</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">for</span><span style="font-variant-ligatures: no-common-ligatures" class=""> (x, y, z) </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">in</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">cartesianProduct</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">xrange</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">yrange</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">zrange</span><span style="font-variant-ligatures: no-common-ligatures" class="">) {</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span><span style="font-variant-ligatures: no-common-ligatures" class="">"x = </span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">\</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">x</span><span style="font-variant-ligatures: no-common-ligatures" class="">) y = </span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">\</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">y</span><span style="font-variant-ligatures: no-common-ligatures" class="">) z = </span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">\</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">z</span><span style="font-variant-ligatures: no-common-ligatures" class="">)"</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">if</span><span style="font-variant-ligatures: no-common-ligatures" class=""> z < </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0.0</span><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> ( </span><span style="font-variant-ligatures: no-common-ligatures" class="">"** z value </span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">\</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">z</span><span style="font-variant-ligatures: no-common-ligatures" class="">) is below zero! **"</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> )</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">break</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div></div></div></blockquote><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span></div></div></div><div><div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Using strides removes the need for any of the NumericType labels, and cartesianProduct() would be usable for any (reiterable) sequences, not just your designated types. </span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">If you want a language issue to obsess over, I suggest the inflexibility of tuples, which force you to have a separate wrapper for each number of dimensions. :-)</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">I would have thought there’d be an off-the-shelf cartesian product somewhere that you could use, but it doesn’t seem to come up in the Google. It’d look something like this. (This is causing a compiler crash in Xcode 8b3 and so is not completely vetted, but it’s probably close…)</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div><div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> cartesianProduct<U, V </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">where</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">U</span><span style="font-variant-ligatures: no-common-ligatures" class="">: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Sequence</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">V</span><span style="font-variant-ligatures: no-common-ligatures" class=""> == </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">U</span><span style="font-variant-ligatures: no-common-ligatures" class="">.Iterator.Element>(</span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> args: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">U</span><span style="font-variant-ligatures: no-common-ligatures" class="">...) -></span></div></span></div></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">AnyIterator</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><[</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">V</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">]></span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">{</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> iterators = args.</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">map</span><span style="font-variant-ligatures: no-common-ligatures" class=""> { $0.</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">makeIterator</span><span style="font-variant-ligatures: no-common-ligatures" class="">() }</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> values = [</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">V</span><span style="font-variant-ligatures: no-common-ligatures" class="">?]()</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">for</span><span style="font-variant-ligatures: no-common-ligatures" class=""> i </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">in</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class=""> ... iterators.</span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">endIndex</span><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> values.</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">append</span><span style="font-variant-ligatures: no-common-ligatures" class="">(iterators[i].</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">next</span><span style="font-variant-ligatures: no-common-ligatures" class="">())</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> done = values.</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">contains</span><span style="font-variant-ligatures: no-common-ligatures" class=""> { $0 == </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">nil</span><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span></p></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">AnyIterator</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">() {</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">if</span><span style="font-variant-ligatures: no-common-ligatures" class=""> done {</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">nil</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> thisValue = values.</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">map</span><span style="font-variant-ligatures: no-common-ligatures" class=""> { $0! }</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> i = args.<font color="#703daa" class="">endIndex</font></span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">repeat</span><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> values[i] = iterators[i].</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">next</span><span style="font-variant-ligatures: no-common-ligatures" class="">()</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">if</span><span style="font-variant-ligatures: no-common-ligatures" class=""> values[i] != </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">nil</span><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span><span style="font-variant-ligatures: no-common-ligatures" class=""> thisValue</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> } </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">else</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">if</span><span style="font-variant-ligatures: no-common-ligatures" class=""> i == </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> done = </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">true</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span><span style="font-variant-ligatures: no-common-ligatures" class=""> thisValue</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> } </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">else</span><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> iterators[i] = args[i].</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">makeIterator</span><span style="font-variant-ligatures: no-common-ligatures" class="">()</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> values[i] = iterators[i].</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">next</span><span style="font-variant-ligatures: no-common-ligatures" class="">()</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> i -= </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> } </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">while</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">true</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> cartesianProduct<U, V </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">where</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">U</span><span style="font-variant-ligatures: no-common-ligatures" class="">: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Sequence</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">V</span><span style="font-variant-ligatures: no-common-ligatures" class=""> == </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">U</span><span style="font-variant-ligatures: no-common-ligatures" class="">.Iterator.Element>(</span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> a: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">U</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> b: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">U</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> c: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">U</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -></span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">AnyIterator</span><span style="font-variant-ligatures: no-common-ligatures" class=""><(</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">V</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">V</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">V</span><span style="font-variant-ligatures: no-common-ligatures" class="">)></span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">{</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> subIterator: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">AnyIterator</span><span style="font-variant-ligatures: no-common-ligatures" class=""><[</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">V</span><span style="font-variant-ligatures: no-common-ligatures" class="">]> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">cartesianProduct</span><span style="font-variant-ligatures: no-common-ligatures" class="">(a, b, c)</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">AnyIterator</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">() {</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">if</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> value = subIterator.</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">next</span><span style="font-variant-ligatures: no-common-ligatures" class="">() {</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span><span style="font-variant-ligatures: no-common-ligatures" class=""> (value[</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class="">], value[</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">], value[</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">2</span><span style="font-variant-ligatures: no-common-ligatures" class="">])</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">nil</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div></span></div></div></blockquote><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span></div></span></div></div><div><div><span style="font-variant-ligatures: no-common-ligatures" class=""><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Garth</span></div></span></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">That is why there are functions.</div><div class="">but you already know that, of course.</div><div class="">Kind Regards</div><div class="">TedvG</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div class=""><br class="">On Jul 30, 2016, at 1:48 PM, Ted F.A. van Gaalen via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class="">Hi Chris,<div class=""><br class=""><div class="">thanks for the tip about Hirundo app!</div></div><div class=""><br class=""></div><div class=""><div class="">A positive side-effect of removing the classical for;; loop</div><div class=""> (yes, it’s me saying this :o) is that it forces me to find</div><div class="">a good and generic equivalent for it, </div><div class="">making the conversion of my for;;s to 3.0 easier.</div><div class="">which is *not* based on collections or sequences and</div><div class="">does not rely on deeper calls to Sequence etc.</div><div class=""><br class=""></div><div class="">so, I’ve made the functions [iterator, iterator2D, iterator3D] (hereunder)</div><div class="">wich btw clearly demonstrate the power and flexibility of Swift. </div><div class=""><br class=""></div><div class="">Very straightforward, and efficient (i assume) just like the classical for;; loop. </div><div class="">It works quite well in my sources.</div><div class=""><br class=""></div></div><div class="">As a spin-off, I’ve extended these to iterators for matrices 2D and cubes? 3D...</div><div class=""><br class=""></div><div class="">Question: </div><div class="">Perhaps implementing “multi dimensional iterator functions</div><div class="">in Swift might be a good idea. so that is no longer necessary to nest/nest/nest iterators. </div><div class=""><br class=""></div><div class="">Met vriendelijke groeten, sorry for my “intensity” in discussing the classical for;; </div><div class="">I'll have to rethink this for;; again.. </div><div class="">Thanks, Ted.</div><div class=""><br class=""></div><div class="">Any remarks ( all ), suggestions about the code hereunder: ? </div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">protocol</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> NumericType</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;">{</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">func</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> +(lhs: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">Self</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, rhs: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">Self</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Self</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">func</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> -(lhs: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">Self</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, rhs: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">Self</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Self</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">func</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> *(lhs: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">Self</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, rhs: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">Self</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Self</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">func</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> /(lhs: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">Self</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, rhs: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">Self</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Self</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">func</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> %(lhs: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">Self</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, rhs: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">Self</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Self</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;">}</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"></span><br class=""></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extension</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Double</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> : </span><span class="" style="font-variant-ligatures: no-common-ligatures;">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> { }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extension</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Float</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> : </span><span class="" style="font-variant-ligatures: no-common-ligatures;">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> { }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extension</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">CGFloat</span><span class="" style="font-variant-ligatures: no-common-ligatures;">: </span><span class="" style="font-variant-ligatures: no-common-ligatures;">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> { }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extension</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Int</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> : </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> { }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extension</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Int8</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> : </span><span class="" style="font-variant-ligatures: no-common-ligatures;">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> { }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extension</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Int16</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> : </span><span class="" style="font-variant-ligatures: no-common-ligatures;">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> { }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extension</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Int32</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> : </span><span class="" style="font-variant-ligatures: no-common-ligatures;">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> { }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extension</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Int64</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> : </span><span class="" style="font-variant-ligatures: no-common-ligatures;">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> { }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extension</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">UInt</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> : </span><span class="" style="font-variant-ligatures: no-common-ligatures;">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> { }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extension</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">UInt8</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> : </span><span class="" style="font-variant-ligatures: no-common-ligatures;">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> { }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extension</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">UInt16</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> : </span><span class="" style="font-variant-ligatures: no-common-ligatures;">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> { }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extension</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">UInt32</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> : </span><span class="" style="font-variant-ligatures: no-common-ligatures;">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> { }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">extension</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">UInt64</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> : </span><span class="" style="font-variant-ligatures: no-common-ligatures;">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> { }</span></div><div class=""><span class="" style="font-variant-ligatures: no-common-ligatures;"><br class=""></span></div></div><div class=""><br class=""></div><div class=""><div class=""><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// Simple iterator with generic parameters, with just a few lines of code.</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);">/// for most numeric types (see above)</div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// Usage Example:</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">///</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// iterate(xmax, { $0 > xmin}, -xstep,</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// {x in</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// print("x = \(x)")</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// return true // returning false acts like a break</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// } )</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">///</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// -Parameter vstart: Initial value</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// -Parameter step: The iteration stepping value.</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// -Parameter test: A block with iteration test. e.g. {$0 > 10}</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">///</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// -Parameter block: A block to be executed with each step.</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// The block must include a return true (acts like "continue")</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// or false (acts like "break")</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><div class="" style="margin: 0px; line-height: normal;"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// -Please Note: </span></div><div class="" style="margin: 0px; line-height: normal;"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// There is minor precision loss ca: 1/1000 ... 1/500 </span></div><div class="" style="margin: 0px; line-height: normal;"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// when iterating with floating point numbers.</span></div><div class="" style="margin: 0px; line-height: normal;"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// However, in most cases this can be safely ignored.</span></div><div class="" style="margin: 0px; line-height: normal;"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// made by ted van gaalen.</span></div><div class="" style="margin: 0px; line-height: normal;"><br class=""></div><div class="" style="margin: 0px; line-height: normal;"><br class=""></div></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">func</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> iterate<T:</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;">> (</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> vstart: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">,</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> vstep: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">,</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> test: (</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Bool</span><span class="" style="font-variant-ligatures: no-common-ligatures;">,</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> block: (</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Bool</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> )</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;">{</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> current = vstart</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><br class="webkit-block-placeholder"></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">while</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> test(current) && block(current)</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> {</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> current = current </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);">+</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> vstep</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;">}</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><br class=""></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"></span><br class=""></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// X,Y 2D matrix (table) iterator with generic parameters</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">func</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> iterate2D<T:</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;">> (</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> xstart: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> xstep: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> xtest: (</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Bool</span><span class="" style="font-variant-ligatures: no-common-ligatures;">,</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ystart: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ystep: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ytest: (</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Bool</span><span class="" style="font-variant-ligatures: no-common-ligatures;">,</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> block: (</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">,</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Bool</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> )</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;">{</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> xcurrent = xstart</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ycurrent = ystart</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><br class="webkit-block-placeholder"></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> dontStop = </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">true</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><br class="webkit-block-placeholder"></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">while</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> xtest(xcurrent) && dontStop</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> {</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> ycurrent = ystart</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">while</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ytest(ycurrent) && dontStop</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> {</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> dontStop = block(xcurrent, ycurrent)</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> ycurrent = ycurrent </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);">+</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ystep</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> xcurrent = xcurrent </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);">+</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> xstep</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;">}</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"></span><br class=""></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"></span><br class=""></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;">/// X,Y,Z 3D (cubic) iterator with generic parameters:</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"></span><br class=""></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">func</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> iterate3D<T:</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">NumericType</span><span class="" style="font-variant-ligatures: no-common-ligatures;">> (</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> xstart: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> xstep: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> xtest: (</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Bool</span><span class="" style="font-variant-ligatures: no-common-ligatures;">,</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ystart: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ystep: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ytest: (</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Bool</span><span class="" style="font-variant-ligatures: no-common-ligatures;">,</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> zstart: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> zstep: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ztest: (</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Bool</span><span class="" style="font-variant-ligatures: no-common-ligatures;">,</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">_</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> block: (</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">,</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">,</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">T</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) -> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Bool</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> )</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;">{</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> xcurrent = xstart</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ycurrent = ystart</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> zcurrent = zstart</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><br class="webkit-block-placeholder"></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">var</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> dontStop = </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">true</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><br class="webkit-block-placeholder"></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">while</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> xtest(xcurrent) && dontStop</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> {</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> ycurrent = ystart</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">while</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ytest(ycurrent) && dontStop</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> {</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> zcurrent = zstart</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">while</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ztest(zcurrent) && dontStop</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> {</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> dontStop = block(xcurrent, ycurrent, zcurrent)</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> zcurrent = zcurrent </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);">+</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> zstep</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> ycurrent = ycurrent </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);">+</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ystep</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> xcurrent = xcurrent </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);">+</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> xstep</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;">}</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><br class=""></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><br class=""></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">func</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> testIterator()</span><span class="" style="font-variant-ligatures: no-common-ligatures;"></span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;">{</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);">iterate</span><span class="" style="font-variant-ligatures: no-common-ligatures;">(</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">0.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">0.5</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, {$0 < </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">1000.00000</span><span class="" style="font-variant-ligatures: no-common-ligatures;">} ,</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> { value </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">in</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);">print</span><span class="" style="font-variant-ligatures: no-common-ligatures;">(</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">"Value = </span><span class="" style="font-variant-ligatures: no-common-ligatures;">\</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">(</span><span class="" style="font-variant-ligatures: no-common-ligatures;">value</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">) </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">"</span><span class="" style="font-variant-ligatures: no-common-ligatures;">)</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">return</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">true</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> } )</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><br class=""></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">let</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> startv: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">CGFloat</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> = -</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">20.0</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">let</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> stepv: </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">CGFloat</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> = </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">0.5</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><br class="webkit-block-placeholder"></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);">iterate</span><span class="" style="font-variant-ligatures: no-common-ligatures;">(startv, stepv, {$0 < </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">1000.00000</span><span class="" style="font-variant-ligatures: no-common-ligatures;">} ,</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> { val </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">in</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);">print</span><span class="" style="font-variant-ligatures: no-common-ligatures;">(</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">"R = </span><span class="" style="font-variant-ligatures: no-common-ligatures;">\</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">(</span><span class="" style="font-variant-ligatures: no-common-ligatures;">val</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">)"</span><span class="" style="font-variant-ligatures: no-common-ligatures;">)</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">return</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">true</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> } )</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><br class=""></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">let</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> tolerance = </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">0.01</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="color: rgb(0, 132, 0); font-variant-ligatures: no-common-ligatures;">// boundary tolerance for floating point type</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><br class="webkit-block-placeholder"></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);">iterate2D</span><span class="" style="font-variant-ligatures: no-common-ligatures;">( </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">0.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">10.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, { $0 < </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">100.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> + tolerance } ,</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">0.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">5.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, { $0 < </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">50.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> + tolerance } ,</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> {x,y </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">in</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);">print</span><span class="" style="font-variant-ligatures: no-common-ligatures;">(</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">"x = </span><span class="" style="font-variant-ligatures: no-common-ligatures;">\</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">(</span><span class="" style="font-variant-ligatures: no-common-ligatures;">x</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">) y = </span><span class="" style="font-variant-ligatures: no-common-ligatures;">\</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">(</span><span class="" style="font-variant-ligatures: no-common-ligatures;">y</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">)"</span><span class="" style="font-variant-ligatures: no-common-ligatures;">)</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">return</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">true</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures;">// false from block stops iterating ( like break)</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> } )</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><br class=""></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);">iterate3D</span><span class="" style="font-variant-ligatures: no-common-ligatures;">( </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">0.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">10.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, { $0 < </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">30.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> } , </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 132, 0);">// x</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">0.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">5.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, { $0 < </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">20.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> } , </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 132, 0);">// y</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">10.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, -</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">5.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, { $0 > -</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">10.0</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> } , </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 132, 0);">// z</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> {x,y,z </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">in</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);">print</span><span class="" style="font-variant-ligatures: no-common-ligatures;">(</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">"x = </span><span class="" style="font-variant-ligatures: no-common-ligatures;">\</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">(</span><span class="" style="font-variant-ligatures: no-common-ligatures;">x</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">) y = </span><span class="" style="font-variant-ligatures: no-common-ligatures;">\</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">(</span><span class="" style="font-variant-ligatures: no-common-ligatures;">y</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">) z = </span><span class="" style="font-variant-ligatures: no-common-ligatures;">\</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">(</span><span class="" style="font-variant-ligatures: no-common-ligatures;">z</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">)"</span><span class="" style="font-variant-ligatures: no-common-ligatures;">)</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">if</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> z < </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">0.0</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> {</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);">print</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> ( </span><span class="" style="font-variant-ligatures: no-common-ligatures;">"** z value </span><span class="" style="font-variant-ligatures: no-common-ligatures;">\</span><span class="" style="font-variant-ligatures: no-common-ligatures;">(</span><span class="" style="font-variant-ligatures: no-common-ligatures;">z</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) is below zero! **"</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> )</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><br class="webkit-block-placeholder"></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">return</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">false</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures;">// (acts as break in for;;)</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> }</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">return</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">true</span><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures;">// return stmt is obligatory (continue)</span></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"> } )</div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;">}</div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"></span><br class=""></div><div class="" style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;"><span class="" style="font-variant-ligatures: no-common-ligatures;"></span><br class=""></div></div><div class=""><br class=""></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div></blockquote><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></div></div></blockquote></div><br class=""></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></blockquote></div><br class=""></body></html>