<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>On Thu, May 19, 2016, at 04:20 PM, Trent Nadeau via swift-evolution wrote:<br></div>
<blockquote type="cite"><div dir="ltr"><div>Also note that there's a typo in the second example:<br></div>
<div>&nbsp;</div>
<div><pre style="font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace;font-size:14px;margin-top:0px;margin-bottom:0px;line-height:1.45;word-wrap:normal;padding-top:16px;padding-right:16px;padding-bottom:16px;padding-left:16px;overflow-y:auto;overflow-x:auto;background-color:rgb(247, 247, 247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(51, 51, 51);"><span class="colour" style="color:rgb(167, 29, 93)">for</span> view <span class="colour" style="color:rgb(167, 29, 93)">in</span> sequence(initial: someView, next: { $<span class="colour" style="color:rgb(0, 134, 179)">0</span><span class="colour" style="color:rgb(167, 29, 93)">.</span>superview }) {
    <span class="colour" style="color:rgb(150, 152, 150)">// someView, someView.superview, someView.superview.superview, ...</span>
}<br></pre></div>
<div>&nbsp;</div>
<div>should be:<br></div>
<div>&nbsp;</div>
<div><pre style="font-family:Consolas, 'Liberation Mono', Menlo, Courier, monospace;font-size:14px;margin-top:0px;margin-bottom:0px;line-height:1.45;word-wrap:normal;padding-top:16px;padding-right:16px;padding-bottom:16px;padding-left:16px;overflow-y:auto;overflow-x:auto;background-color:rgb(247, 247, 247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(51, 51, 51);"><span class="colour" style="color:rgb(167, 29, 93)">for</span> view <span class="colour" style="color:rgb(167, 29, 93)">in</span> sequence(state: someView, next: { $<span class="colour" style="color:rgb(0, 134, 179)">0</span><span class="colour" style="color:rgb(167, 29, 93)">.</span>superview }) {
    <span class="colour" style="color:rgb(150, 152, 150)">// someView, someView.superview, someView.superview.superview, ...</span>
}<br></pre></div>
</div>
</blockquote><div>&nbsp;</div>
<div>The code as written is correct. The rewritten version would actually just emit [someView.superview, someView.superview, someView.superview, ...] forever. I imagine the confusion stems from the fact that there's 2 examples but they both demonstrate just the first function, and there's no examples of the second function, which is something I'll try to address soon.<br></div>
<div>&nbsp;</div>
<div>-Kevin Ballard</div>
</body>
</html>