You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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'
The text was updated successfully, but these errors were encountered:
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
changed the title
Built-in functions do not fit into the functionItem format
Implement named function references on builtin functions
Dec 9, 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'
The text was updated successfully, but these errors were encountered: