RosettaCodeData/Task/Higher-order-functions/Jq/higher-order-functions-1.jq
2023-07-01 13:44:08 -04: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"