Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
# Illustration of map/1 using the builtin filter: exp
|
||||
map(exp) # exponentiate each item in the input list
|
||||
|
||||
# A compound expression can be specified as the argument to map, e.g.
|
||||
map( (. * .) + sqrt ) # x*x + sqrt(x)
|
||||
|
||||
# The compound expression can also be a composition of filters, e.g.
|
||||
map( sqrt|floor ) # the floor of the sqrt
|
||||
|
||||
# Array comprehension
|
||||
reduce .[] as $n ([]; . + [ exp ])
|
||||
|
||||
# Elementwise operation
|
||||
[.[] + 1 ] # add 1 to each element of the input array
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
$ jq -c ' [.[] + 1 ]'
|
||||
[0, 1 , 10]
|
||||
[1,2,11]
|
||||
Loading…
Add table
Add a link
Reference in a new issue