<div dir="ltr"><div dir="ltr" style="font-size:13px">But it does say it is in-order. It says for SequenceType:<div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>"A type that can be iterated with a for...in loop"</div><div><br></div></blockquote>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? It also categorically says that you can't iterate multiple times reliably:<br><div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"> "As a consequence, it is not possible to run multiple for loops on a sequence to "resume" iteration".</blockquote><div><div><br></div><div>So why am I seeing two passes?</div><div><br></div><div>And an index out of bounds?</div></div></div></div><div class="" style="font-size:13px"></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:26, 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"><br><div><blockquote type="cite"><div>On Feb 8, 2016, at 9:28 PM, Howard Lovatt via swift-users <<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> wrote:</div><br><div><div 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">Not sure where it says that it won't be sequential - do you have a reference? </div></div></blockquote>…<br><blockquote type="cite"><div><div 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">Not sure where it says it can be called more than one - the filter might be a very expensive operation like a database lookup!</div></div></blockquote></div><br><div>I think it’s more that the documentation <i>doesn’t</i> specify sequential ordering, and that it <i>doesn’t</i> say the closure is only called once … so you can’t assume that those conditions are true. You’re just inferring that they are, based on your intuition about the implementation.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>—Jens</div></font></span></div></blockquote></div><br></div>