Replies: 1 comment
-
|
Additionaly, for loops should be able to return a values, instead of being "true" always that are useless... This should be worked on in the future to allow actual results like any other expression: Result := loop:
if (Value := GetRandomInt(0, 100) > 80): # 20% chance of breaking out of loop
break Value * 10 # Breaks out the loop, giving the value
# Result has type `int` with the proper value inside it
#### Another example:
Result := loop:
Data := ProcessData()
if (ShouldStop[]):
break Data
# Result carries the Data returned by ProcessData() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
-
Additionally, fix
break, return, continue, yeld(all keywords) work on the side oforwithout needing workarounds:Beta Was this translation helpful? Give feedback.
All reactions