Currying: Difference between revisions

Content deleted Content added
Peak (talk | contribs)
jq
Peak (talk | contribs)
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): . + 5;
def plus(x): . + x;


def plus5: plus(5);
def plus5: plus(5);