JSONiq: Arrow doesn't work with inline functions
jsommr opened this issue · 3 comments
jsommr commented
This doesn't work: "test" => function ($str) { "ok" }
Workaround:
declare function f($arrow-val, $fn)
{
$fn($arrow-val)
};
"test" => f(function($str) { "ok" })
ghislainfourny commented
Thanks a lot, indeed I think it is only implemented for static calls for now. We will look into it.
ghislainfourny commented
Happy to announce that this is now supported in the master, and it will be part of the next release!
ghislainfourny commented
As a comment regarding the query in the original comment: please note that the syntax is like this:
"test" => (function ($str) { "ok" })()
i.e., the dynamic function must actually be called.