diff options
author | Stephen Dolan <mu@netsoc.tcd.ie> | 2013-05-05 18:39:59 -0700 |
---|---|---|
committer | Stephen Dolan <mu@netsoc.tcd.ie> | 2013-05-05 18:39:59 -0700 |
commit | 88a6dc5343a66b2db3ad36f0fa9f24fc89282caa (patch) | |
tree | d0819c761b0fadb7ed8453ce7dabdf60426f765c | |
parent | fee38afd8bb0b1d226241c52094f7f1d0f2f8339 (diff) | |
parent | 115552f3a6d75da79e4aef544c2a76aaee2eb01d (diff) |
Merge pull request #77 from jkleint/patch-1
Clarify description of `as`
-rw-r--r-- | docs/content/3.manual/manual.yml | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/content/3.manual/manual.yml b/docs/content/3.manual/manual.yml index eac28a3c..6f80b78b 100644 --- a/docs/content/3.manual/manual.yml +++ b/docs/content/3.manual/manual.yml @@ -972,10 +972,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 |