Skip to content

Commit

Permalink
Document break with/continue with
Browse files Browse the repository at this point in the history
  • Loading branch information
edemaine committed Sep 11, 2024
1 parent 1a0356c commit 077e9e3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions civet.dev/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,24 @@ Labels have the colon on the left to avoid conflict with implicit object
literals. The colons are optional in `break` and `continue`.
:::
### Controlling Loop Value
<Playground>
function varVector(items, mean)
for item of items
continue with 0 unless item?
item -= mean
item * item
</Playground>
<Playground>
found :=
loop
item := nextItem()
break with item if item.found
process item
</Playground>
## Other Blocks
### Try Blocks
Expand Down

0 comments on commit 077e9e3

Please sign in to comment.