Closed gregsdennis closed 1 year ago
Yes, I hope to support using the result of a function as an argument to a(nother) function in https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/pull/330.
Note that I don't intend to support passing a function as an argument to a(nother) function or returning a function from a(nother) function, as in the following example, which does both:
$?[foldr(add, 0)(@) > 29]
FWIW I'd be fine with this being in a follow-up PR to #330.
It actually looks like this is already supported.
function-argument
can be a filter-path
filter-path
can be a function-expression
function-expression
takes zero or more function-argument
s as parameters
Tangentially related to #335, would we consider the use of a function as an argument to another function. Currently this is not allowed as a function is not a
comparable
.An example for this may be:
to determine if the maximum between
sqrt(@.foo)
and@.bar
is less than 10.