Skip to content

Commit 115552f

Browse files
author
jkleint
committed
Clarify description of as
It's more of a foreach loop than an identity operation. Addresses issue #72.
1 parent 925ec37 commit 115552f

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
@@ -953,10 +953,11 @@ sections:
953953
954954
.realnames as $names | .posts[] | {title, author: $names[.author]}
955955
956-
The expression "foo as $x" runs foo, puts the result in $x,
957-
and returns the original input. Apart from the side-effect
958-
of binding the variable, it has the same effect as ".".
959-
956+
The expression `exp as $x | ...` means: for each value of expression
957+
`exp`, run the rest of the pipeline with the entire original input, and
958+
with `$x` set to that value. Thus `as` functions as something of a
959+
foreach loop.
960+
960961
Variables are scoped over the rest of the expression that defines
961962
them, so
962963

0 commit comments

Comments
 (0)