First-class functions: Difference between revisions
→{{header|jq}}
(→{{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>
However this transcription is inefficient because at each iteration (i.e. for each $i), all three components of A and of B are computed.
To avoid this, one would have to ignore A and B, and instead write:
<pre>
0.5
|