<div dir="ltr"><span style="font-size:13px">I am using StrideThrough which is a SequenceType and therefore the quotes I used in the previous email were from the SequenceType documentation. There is no random access for a SequenceType, all you can do is call a generator. Which is what `for` does and therefore the generator must return elements in the sequence defined by the underlying struct or class, in this case StrideThrough. The documentation for StrideThrough says "A SequenceType of values formed by striding over a closed interval." Which to me implies in order since you take one stride and then another of the same size; it isn't called RandomWalk!</span><div style="font-size:13px"><br><div>Anyway: you can see from the printout that it is sequential.</div><div><br></div><div>But it does two passes and generates an out of bounds!</div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"> -- Howard.<br></div></div>
<br><div class="gmail_quote">On 9 February 2016 at 17:39, Jens Alfke <span dir="ltr"><<a href="mailto:jens@mooseyard.com" target="_blank">jens@mooseyard.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Did you mean to reply just to me?</div><span class=""><br><div><blockquote type="cite"><div>On Feb 8, 2016, at 10:33 PM, Howard Lovatt <<a href="mailto:howard.lovatt@gmail.com" target="_blank">howard.lovatt@gmail.com</a>> wrote:</div><br><div><span style="font-family:Alegreya-Regular;font-size:15px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">which means it must be in-order (for loops are allowed side effects). Also why would you call something SequenceType if it wasn't sequential?</span></div></blockquote><br></div></span><div>The fact that the collection <i>can</i> be accessed sequentially doesn’t guarantee that it will be. If you called a binary search function on it, the comparison function wouldn’t be called in order, for example.</div><span class=""><div><br></div><div><blockquote type="cite"><span style="font-family:Alegreya-Regular">It also categorically says that you can't iterate multiple times reliably:</span></blockquote><br></div></span><div>I’ve lost track of what method you’re calling, to be honest. Maybe it’s defined on Collection, not Sequence.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>—Jens</div></font></span></div></blockquote></div><br></div>