Skip to content

Commit 88a6dc5

Browse files
committed
Merge pull request #77 from jkleint/patch-1
Clarify description of `as`
2 parents fee38af + 115552f commit 88a6dc5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/content/3.manual/manual.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -972,10 +972,11 @@ sections:
972972
973973
.realnames as $names | .posts[] | {title, author: $names[.author]}
974974
975-
The expression "foo as $x" runs foo, puts the result in $x,
976-
and returns the original input. Apart from the side-effect
977-
of binding the variable, it has the same effect as ".".
978-
975+
The expression `exp as $x | ...` means: for each value of expression
976+
`exp`, run the rest of the pipeline with the entire original input, and
977+
with `$x` set to that value. Thus `as` functions as something of a
978+
foreach loop.
979+
979980
Variables are scoped over the rest of the expression that defines
980981
them, so
981982

0 commit comments

Comments
 (0)