summaryrefslogtreecommitdiffstats
path: root/docs/content
diff options
context:
space:
mode:
authorjkleint <jkleint@gmail.com>2013-01-25 12:17:56 -0500
committerjkleint <jkleint@gmail.com>2013-01-25 12:17:56 -0500
commit115552f3a6d75da79e4aef544c2a76aaee2eb01d (patch)
treeaf025cabd754af0d24c7ecd3d87faf5720e21ee6 /docs/content
parent925ec3751f3b407c17412b0fa04a84fe39c1e0b7 (diff)
Clarify description of `as`
It's more of a foreach loop than an identity operation. Addresses issue #72.
Diffstat (limited to 'docs/content')
-rw-r--r--docs/content/3.manual/manual.yml9
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/content/3.manual/manual.yml b/docs/content/3.manual/manual.yml
index de608210..d6732e68 100644
--- a/docs/content/3.manual/manual.yml
+++ b/docs/content/3.manual/manual.yml
@@ -953,10 +953,11 @@ sections:
.realnames as $names | .posts[] | {title, author: $names[.author]}
- The expression "foo as $x" runs foo, puts the result in $x,
- and returns the original input. Apart from the side-effect
- of binding the variable, it has the same effect as ".".
-
+ The expression `exp as $x | ...` means: for each value of expression
+ `exp`, run the rest of the pipeline with the entire original input, and
+ with `$x` set to that value. Thus `as` functions as something of a
+ foreach loop.
+
Variables are scoped over the rest of the expression that defines
them, so