Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fn:document, fn:function-available: default arguments #69

Open
rhdunn opened this issue Apr 12, 2021 · 3 comments
Open

fn:document, fn:function-available: default arguments #69

rhdunn opened this issue Apr 12, 2021 · 3 comments
Labels
Editorial Minor typos, wording clarifications, example fixes, etc. PRG-easy Categorized as "easy" at the Prague f2f, 2024 PRG-required Categorized as "required for 4.0" at the Prague f2f, 2024 XSLT An issue related to XSLT

Comments

@rhdunn
Copy link
Contributor

rhdunn commented Apr 12, 2021

This issue tracks the changes needed to the built-in functions to allow them to combine the declarations into a single definition with default parameter values.

The general approach to this is to make required arguments optional if they are for a function signature that is not the lowest argument count signature, and move any associated logic into the function.

fn:document

  1. Change fn:document/$base-node from node() to node()?.
- If $base-node is supplied,
+ If $base-node is not empty,

fn:function-available

  1. Change fn:function-available/$arity from xs:integer to xs:integer?.

If $arity is the empty sequence, the function-available function returns true if and only if there is at least one available function (with some arity) whose name matches the value of the $name argument.

If $arity is not the empty sequence, the function-available function returns true if and only if there is an available function whose name matches the value of the $function-name argument and whose arity matches the value of the $arity argument.

@rhdunn rhdunn added XSLT An issue related to XSLT Enhancement A change or improvement to an existing feature labels Sep 14, 2022
@ChristianGruen ChristianGruen changed the title [XSLT] Built-in function changes to support default values Built-in function changes to support default values Apr 27, 2023
@ChristianGruen ChristianGruen added Editorial Minor typos, wording clarifications, example fixes, etc. and removed Enhancement A change or improvement to an existing feature labels Jun 29, 2023
@ChristianGruen
Copy link
Contributor

@rhdunn I can’t really judge (as it affects XSLT functions): Is this still valid?

@michaelhkay
Copy link
Contributor

Good catch, yes, we've made this change across all the F+O functions but it still needs to be made to XSLT functions.

@ChristianGruen ChristianGruen changed the title Built-in function changes to support default values fn:document, fn:function-available: default arguments Feb 13, 2024
@ndw ndw added PRG-required Categorized as "required for 4.0" at the Prague f2f, 2024 PRG-easy Categorized as "easy" at the Prague f2f, 2024 labels Jun 4, 2024
@ndw
Copy link
Contributor

ndw commented Jun 4, 2024

What's above are just examples, the problem is likely a little wider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Editorial Minor typos, wording clarifications, example fixes, etc. PRG-easy Categorized as "easy" at the Prague f2f, 2024 PRG-required Categorized as "required for 4.0" at the Prague f2f, 2024 XSLT An issue related to XSLT
Projects
None yet
Development

No branches or pull requests

4 participants