Currying: Difference between revisions
Content deleted Content added
jq |
→{{header|jq}}: fix typo |
||
Line 253: | Line 253: | ||
In jq, functions are filters. Accordingly, we illustrate currying by defining plus(x) to be a filter that adds x to its input, and then define plus5 as plus(5): |
In jq, functions are filters. Accordingly, we illustrate currying by defining plus(x) to be a filter that adds x to its input, and then define plus5 as plus(5): |
||
<lang jq> |
<lang jq> |
||
def plus(x): . + |
def plus(x): . + x; |
||
def plus5: plus(5); |
def plus5: plus(5); |