Jump to content

First-class functions: Difference between revisions

(→‎{{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 translatetranscribe the [[#Wren|Wren]] entry to jq, as follows:
<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
2,459

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.