Skip to content

Clean up the builtin function catalogue - #2090

Draft
CaiJimmy wants to merge 3 commits into
masterfrom
jimmy/builtin-catalogue-cleanup
Draft

CaiJimmy wants to merge 3 commits into
masterfrom
jimmy/builtin-catalogue-cleanup

Conversation

@CaiJimmy

Copy link
Copy Markdown
Collaborator
  • Functions register themselves when they are defined, which removes the 430-line registration block. Registering a function twice now fails at startup. This caught two entries for random-between#5, of which only the last one was ever used, so the other is removed.
  • fn:concat is defined once as a variadic function, replacing its 99 entries for arities 2 to 100 and two special cases in getBuiltinFunction. getBuiltinFunction and exists now agree for any arity.
  • Names are written fn("abs"), jn("size"), … and take the prefix of their namespace. A few functions had no prefix or the wrong one:
prefix-from-QName(function-name(random#0))  (: was empty, now "fn" :)

Also random-between, error, item-type and others, and jn:yaml-doc, which was named fn:yaml-doc.

Each function registers itself when defined, so a duplicate fails at startup;
the unreachable duplicate of random-between#5 is removed. fn:concat is one
variadic function instead of 99 entries and two special cases in the lookup.
Function names take the prefix of their namespace.
…tions

Sequence type notations are parsed since #2075, so element() no longer needs a
SequenceType built by hand.
A function whose signature changes in a later language version declares the
new signature as a revision, which the lookup applies by version, instead of
checking for string-join and building its signature on every lookup.
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

QT3 Test Results - Parser: jsoniq

Regression baseline: run 42660324781

🎉 No regressions found for this build.

Summary of passed tests for jsoniq
Test Suite Passing Failing Errors Skipped Missing features Total
app 2146 1 9 1 0 2157
array 208 0 1 0 0 209
fn 10887 36 2 210 2 11135
map 220 0 0 0 0 220
math 149 0 0 0 0 149
misc 825 12 0 34 0 871
op 4366 0 0 0 0 4366
prod 11893 98 33 183 6 12207
ser 332 11 0 0 0 343
xs 158 0 0 6 0 164
Total 31184 158 45 434 8 31821

Full analysis report: see analysis-jsoniq in artifacts.

Download detailed test results

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

QT3 Test Results - Parser: xquery

Regression baseline: run 42660324781

🎉 No regressions found for this build.

Summary of passed tests for xquery
Test Suite Passing Failing Errors Skipped Missing features Total
app 2156 0 0 1 0 2157
array 209 0 0 0 0 209
fn 10925 0 0 210 2 11135
map 220 0 0 0 0 220
math 149 0 0 0 0 149
misc 837 0 0 34 0 871
op 4366