aboutsummaryrefslogtreecommitdiff
path: root/doc/ref/guile/util.texi
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-09-10 17:07:56 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-09-11 18:00:15 +0200
commit5672d44892c4010cdfbdc46f5fb29259fa51e076 (patch)
tree3afc2ee6dac2d17746014f7f73a704d793336bc1 /doc/ref/guile/util.texi
parentAdd documentation and tests for xdg basedir. (diff)
downloadcalp-5672d44892c4010cdfbdc46f5fb29259fa51e076.tar.gz
calp-5672d44892c4010cdfbdc46f5fb29259fa51e076.tar.xz
Add `break` and `continue` support in `for`.
Diffstat (limited to 'doc/ref/guile/util.texi')
-rw-r--r--doc/ref/guile/util.texi15
1 files changed, 13 insertions, 2 deletions
diff --git a/doc/ref/guile/util.texi b/doc/ref/guile/util.texi
index 7536a9bc..95af9038 100644
--- a/doc/ref/guile/util.texi
+++ b/doc/ref/guile/util.texi
@@ -34,8 +34,8 @@ our extra specialized @var{when}}, but binds the return of
@defmacx for (key ...) in collection body ...
Syntactic sugar over @code{map}.
@example
-for x in collection
- body ...
+(for x in collection
+ body ...)
@end example
expands into
@example
@@ -44,6 +44,17 @@ expands into
If keys are a list, an match-lambda is used instead.
@xref{Pattern Matching,,,guile}
+
+@defun break args ...
+Abandon the entire loop. Returing what was given to @code{break}.
+@end defun
+
+@defun continue [arg]
+Abandon the current iteration of the loop. If an argument is given,
+it's used as the result in the resulting list, otherwise @code{#f} is
+used.
+@end defun
+
@end defmac