RosettaCodeData/Task/Higher-order-functions/Jq/higher-order-functions-1.jq
2017-09-25 22:28:19 +02:00

8 lines
199 B
Text

def foo( filter ):
("world" | filter) as $str
| "hello \($str)" ;
# blue is defined here as a filter that adds blue to its input:
def blue: "blue \(.)";
foo( blue ) # prints "hello blue world"