All, The following query:
let $lookupSequence := ('a','b') let $map := map {'c': 'x'} let $mapLookupEvaluation := $map?($lookupSequence) return ( 'Evaluation of the map lookup is: ' || string-join($mapLookupEvaluation,", "), 'count($mapLookupEvaluation) is: ' || count($mapLookupEvaluation) )
Results in: Evaluation of the map lookup is: count($mapLookupEvaluation) is: 2
I would have expected 0 instead of 2. Am I missing something? Best regards, Johannes
Hi Johannes,
You’ve found a little bug that was introduced more than two years ago (a wrong static type was attached to the map constructor; we ignored the fact that a map lookup may yield an empty sequence). A new snapshot is available [1,2].
Thanks for the report, Christian
[1] https://github.com/BaseXdb/basex/issues/1766 [2] http://files.basex.org/releases/latest/
On Fri, Dec 6, 2019 at 5:18 PM Johannes Echterhoff echterhoff@interactive-instruments.de wrote:
All,
The following query:
let $lookupSequence := ('a','b')
let $map := map {'c': 'x'}
let $mapLookupEvaluation := $map?($lookupSequence)
return
(
'Evaluation of the map lookup is: ' || string-join($mapLookupEvaluation,", "),
'count($mapLookupEvaluation) is: ' || count($mapLookupEvaluation)
)
Results in:
Evaluation of the map lookup is:
count($mapLookupEvaluation) is: 2
I would have expected 0 instead of 2. Am I missing something?
Best regards,
Johannes
basex-talk@mailman.uni-konstanz.de