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

%method functions, dynamic function calls #1846

Open
ChristianGruen opened this issue Feb 25, 2025 · 1 comment
Open

%method functions, dynamic function calls #1846

ChristianGruen opened this issue Feb 25, 2025 · 1 comment
Labels
Enhancement A change or improvement to an existing feature Propose Closing with No Action The WG should consider closing this issue with no action XQuery An issue related to XQuery

Comments

@ChristianGruen
Copy link
Contributor

With the #1817, the %method annotation was introduced for functions. It is interpreted by the lookup operator:

let $number := { 'value': -3, 'abs': %method fn() { abs($this?value) } }
return $number?abs()

I think we should extend this mechanism to dynamic function calls, as many people use the constructs interchangeably:

return $number('abs')()

I agree that the binding mechanism should not apply for map:get or any other map functions and iterations.

@ChristianGruen ChristianGruen added Enhancement A change or improvement to an existing feature XQuery An issue related to XQuery labels Feb 25, 2025
@michaelhkay
Copy link
Contributor

My preference is to confine this to the lookup operator - primarily because that looks more like a method call in OO languages.

@ChristianGruen ChristianGruen added the Propose Closing with No Action The WG should consider closing this issue with no action label Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A change or improvement to an existing feature Propose Closing with No Action The WG should consider closing this issue with no action XQuery An issue related to XQuery
Projects
None yet
Development

No branches or pull requests

2 participants