<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 10, 2016 at 7:45 AM, Dany St-Amant <span dir="ltr"><<a href="mailto:dsa.mls@icloud.com" target="_blank">dsa.mls@icloud.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> Le 10 juin 2016 à 02:25, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com">xiaodi.wu@gmail.com</a>> a écrit :<br>
><br>
> * The word "where" does not consistently imply `break` or `continue`. In current Swift, `where` implies `break` in the context of a `while` loop and `continue` in the context of a `for` loop. Some users intuitively guess the correct meaning in each context, while others guess the wrong meaning. Therefore, the only way to learn for sure what `where` means in any context is to read the rulebook. That, by definition, means that this is unintuitive.<br>
<br>
</span>An example here would have help... I had trouble visualizing the 'where' with 'while'. A quick example I was able to conjure is:<br>
<br>
var array = [9,8,7,6,5,4,3,2,1]<br>
while let x = are.popLast() where x < 5 { print(x) }<br>
print(array)<br>
<br>
What? 'array' is not empty at the end. I admit, I was surprised by the result at first. The confusion here is not that 'where' in 'for' behave like 'continue' and 'where' in 'while' act like a 'break', as the later doesn't conceptually exist. The later concept is using 'where' as a conditional binding in a 'while' causes a failure of the bind and thus a 'break' out of the loop. With the acceptance of the revised SE-0099, the 'while' can no longer appear to be using 'where', thus removing this confusion.<br></blockquote><div><br></div><div>I'm relieved that it's been addressed. There was no small amount of contention that `where` in `while` loops was stylistically delightful and ought to remain, but I think you see why at least on first sight it is rather alarming.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
Dany<br>
<br>
<br>
</font></span></blockquote></div><br></div></div>