Add break builtin for foreach

This commit is contained in:
Nicolas Williams committed 2014-07-07 19:33:17 -05:00
1 parent 6458910ba3
commit 539dccae90
4 files changed
+7 -4

No files matched your search

+1 -2
View File
@@ -1844,8 +1844,7 @@ sections:
This is mostly useful only for constructing `reduce`- and
`limit`-like functions. But it is much more general, as it
allows for partial reductions (see the example below), as well
as breaking out of the "loop" with `empty`, or even `error(x)`
if there's a try/catch around the foreach.
as breaking out of the "loop" with `break`.
examples:
- program: '[foreach .[] as $item