summaryrefslogtreecommitdiffstats
path: root/docs/content/3.manual
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2012-10-22 23:14:34 +0100
committerStephen Dolan <mu@netsoc.tcd.ie>2012-10-22 23:14:34 +0100
commit93f80b27260743dc0ea092dfdbaf81666b853508 (patch)
tree234455c209816047363b574cba7165c8f1e96fb1 /docs/content/3.manual
parent794d29a4309c421f8d6169328d082c8950e5b9b6 (diff)
I should probably document select and empty :) (#29, #5)
Diffstat (limited to 'docs/content/3.manual')
-rw-r--r--docs/content/3.manual/manual.yml30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/content/3.manual/manual.yml b/docs/content/3.manual/manual.yml
index 9039caf5..5981ce42 100644
--- a/docs/content/3.manual/manual.yml
+++ b/docs/content/3.manual/manual.yml
@@ -390,6 +390,36 @@ sections:
input: '{"abc": 1, "abcd": 2, "Foo": 3}'
output: ['["Foo", "abc", "abcd"]']
+ - title: `select`
+ body: |
+
+ The function `select(foo)` produces its input unchanged if
+ `foo` returns true for that input, and produces no output
+ otherwise.
+
+ It's useful for filtering lists: `[1,2,3] | select(. >= 2)`
+ will give you `[3]`.
+
+ examples:
+ - program: 'select(. >= 2)'
+ input: '[1,5,3,0,7]'
+ output: ['[5,3,7]']
+
+ - title: `empty`
+ body: |
+
+ `empty` returns no results. None at all. Not even `null`.
+
+ It's useful on occasion. You'll know if you need it :)
+
+ examples:
+ - program: '1, empty, 2'
+ input: 'null'
+ output: [1,2]
+ - program: '[1,2,empty,3]'
+ input: 'null'
+ output: ['[1,2,3]']
+
- title: `map(x)`
body: |