First-class functions: Difference between revisions
→{{header|jq}}: for efficiency, skip A and B
(→{{header|jq}}: inefficiency) |
(→{{header|jq}}: for efficiency, skip A and B) |
||
Line 1,751:
but it does give near-first-class status to functions and functional expressions, which can
for example, be passed as arguments to functions. In fact, it is quite straightforward,
to
<syntaxhighlight lang=jq>
# Apply g first
Line 1,764:
| compose( A[$i]; B[$i] )
</syntaxhighlight>
To avoid this, one would have to write:
<pre>
0.5
| compose(sin; asin), compose(cos; acos), compose(pow(.;3); pow(.; 1/3))
</pre>
{{output}}
Using gojq:
|