File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ Goal: improve language ergonomics for complex script logic and recovery behavior
233233- [x] Add parser/runtime tests for each new control flow construct.
234234- [x] Add nested control flow tests for edge cases.
235235- [x] Add docs updates in ` docs/control-flow.md ` and ` docs/errors.md ` .
236- - [ ] Add examples under ` examples/control_flow/ ` for each new feature.
236+ - [x ] Add examples under ` examples/control_flow/ ` for each new feature.
237237
238238### v0.16.0 Definition of Done
239239
Original file line number Diff line number Diff line change 1+ def odds_below(limit)
2+ out = []
3+ n = 0
4+ while n < limit
5+ n = n + 1
6+ if n == limit
7+ break
8+ end
9+ if n % 2 == 0
10+ next
11+ end
12+ out = out + [n]
13+ end
14+ out
15+ end
16+
17+ def run()
18+ odds_below(10)
19+ end
Original file line number Diff line number Diff line change 1+ def collect_until(limit)
2+ out = []
3+ n = 0
4+ until n >= limit
5+ out = out + [n]
6+ n = n + 1
7+ end
8+ out
9+ end
10+
11+ def run()
12+ collect_until(5)
13+ end
Original file line number Diff line number Diff line change 1+ def countdown(start)
2+ out = []
3+ n = start
4+ while n > 0
5+ out = out + [n]
6+ n = n - 1
7+ end
8+ out
9+ end
10+
11+ def run()
12+ countdown(5)
13+ end
You can’t perform that action at this time.
0 commit comments