But in your example, the function item is the empty sequence, so you are effectively doing
Gesendet: Samstag, 14. Februar 2026 um 09:57
Von: "Rob Stapper via BaseX-Talk" <basex-talk@mailman.uni-konstanz.de>
An: "basex-talk@mailman.uni-konstanz.de" <basex-talk@mailman.uni-konstanz.de>
Betreff: [basex-talk] function as default parameter
Good morning,
I came across some unexpected behaviour when using a function as a default functionparameter:
declare function local:test
( $exec as function(*)? := fn( $a, $b) { $a => trace("test1: ") }
)
{ $exec( "a", "b")
} ;
local:test(())
I would expect a trace- and a execution result, but I got nothing. Are my expectations wrong or could it be a bug?
PS code snipped added as test.xqm
PS The optimized query shows an empty value.