Stream: beginners

Topic: Breaking out of loops


view this post on Zulip Hubert Małkowski (Feb 04 2026 at 18:48):

Is there any way in the new compiler to break out of a loop without early return? Like break keyword or something?

BTW I also noticed that function walk_until was not ported to the new compiler, I can add that if you are interested :)

view this post on Zulip Luke Boswell (Feb 04 2026 at 20:33):

https://github.com/roc-lang/roc/blob/main/docs/langref/loops.md#break-statement

view this post on Zulip Luke Boswell (Feb 04 2026 at 20:34):

Im not sure about walk_until it may have been intentional in preference for while or for loops and good old (the GOAT) recursion

view this post on Zulip Hubert Małkowski (Feb 04 2026 at 20:35):

Ah shit, looked at this file few days ago when it was empty :rolling_on_the_floor_laughing:

view this post on Zulip Hubert Małkowski (Feb 04 2026 at 20:36):

Nevermind, break was there - I'm just blind


Last updated: Feb 20 2026 at 12:27 UTC