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

Implement named function references on builtin functions #346

Open
CanBerker opened this issue Oct 28, 2019 · 1 comment
Open

Implement named function references on builtin functions #346

CanBerker opened this issue Oct 28, 2019 · 1 comment

Comments

@CanBerker
Copy link
Collaborator

CanBerker commented Oct 28, 2019

XQuery spec defines a functionItem format and guidelines for evaluationg static and dynamic functions at https://www.w3.org/TR/xquery-30/#id-eval-function-call.

Currently, the built-in functions perform operations such as calculating argument values, performing type checking and executing the function body in the iterator directly. In order to be able to reference them dynamically with functionality's such as namedFunctionReferences or partial application, built-in functions must be refactored to fit into the structure implemented in functionItem which is designed around XQuery spec. By having a clear function signature and function body definition, these functions can be passed around in the application as well for further modification (eg. on their params in partial application).

Once this refactoring takes place, partial application and namedfunction references should be enabled on built-in functions. Furthermore, please consider refactoring the Functions catalog to a nicer structure as well, since UserDefinedFunctions and BuiltinFunctions will now be compatible to be stored together.

Edit1: Support for partial application can be extended for built-in functions once they adhere to the format. Currently this throws an 'Unimplemented Exception'

@ghislainfourny
Copy link
Member

ghislainfourny commented Dec 9, 2019

Update: now everything is in place. The next step is to either introduce a new function item class that wraps a builtin function (e.g., just with its name) rather than a runtime iterator, or to use the existing FunctionItem class populating it with the iterator taken from the catalogue, so that it can be returned and invoked via named function references (e.g., count#1).

@ghislainfourny ghislainfourny changed the title Built-in functions do not fit into the functionItem format Implement named function references on builtin functions Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants