You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [8]:for a =1:3, b =4:6
b ==5&&breakprintln("a = $a")
println("b = $b")
end
a =1
b =4
a =2
b =4
a =3
b =4
(i.e. the break only breaks the inner loop).
I'm not saying this is wrong, but it might be good to add a sentence or two about it in the docs as one might think that the nested loop syntax only creates a single loop to break from.
The text was updated successfully, but these errors were encountered:
And then there's always #330.
I always thought of this form as just a syntactic convenience, but maybe we are "wasting syntax" by not having this kind of loop mean something different --- namely that you want conceptually a "single" loop but over an n-d space.
I'm rather in favor of that. It makes it a little easier to express a different behavior and the bonus is that I think the difference is not only useful but entirely intuitive. Imagining writing that paragraph in the manual doesn't make me wince.
I noticed this today
(i.e. the break only breaks the inner loop).
I'm not saying this is wrong, but it might be good to add a sentence or two about it in the docs as one might think that the nested loop syntax only creates a single loop to break from.
The text was updated successfully, but these errors were encountered: