From cff5336ec71b6fee396a95bb0e4bea365e0cd1e8 Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Wed, 9 Jun 2021 16:02:22 +0200 Subject: docs: Document repeat(exp) --- docs/content/manual/manual.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/content/manual/manual.yml b/docs/content/manual/manual.yml index 8cec7bc..442fc0d 100644 --- a/docs/content/manual/manual.yml +++ b/docs/content/manual/manual.yml @@ -1664,6 +1664,22 @@ sections: input: '1' output: ['[1,2,4,8,16,32,64]'] + - title: "`repeat(exp)`" + body: | + + The `repeat(exp)` function allows you to repeatedly + apply expression `exp` to `.` until an error is raised. + + Note that `repeat(exp)` is internally defined as a + recursive jq function. Recursive calls within `repeat` will + not consume additional memory if `exp` produces at most one + output for each input. See advanced topics below. + + examples: + - program: '[repeat(.*2, error)?]' + input: '1' + output: ['[2]'] + - title: "`until(cond; next)`" body: | -- cgit v1.2.1