On 26/03/2026 01:12, Eliúd Santiago Meza y Rivera via BaseX-Talk wrote:
Hello,

I was testing the feature https://docs.basex.org/main/XQuery_4.0#methods, but the examples raise the error XQST0045

let $vector := {
  'x': 5,
  'y': 6,
  'sum': %method fn() { ?x + ?y }
} 
return $vector =?> sum()


In the fiddle the variation

let $vector := {
  'x': 5,
  'y': 6,
  'sum': fn { ?x + ?y }

return $vector =?> sum()

works


let $number := {
  'value': 1,
  'inc': %method fn() { map:put(., 'value', ?value + 1) }
} 
return $number?inc()


as does

let $number := {
  'value': 1,
  'inc': fn { map:put(., 'value', ?value + 1) }

return $number=?>inc()


Not sure about the state of the annotation %method