RE: Overloading functions in XSLT and XQuery

Given two functions
 
declare function f($x as X, $y as Y) {...};
 
declare function f($x as X) { ... };
 
and two function calls
 
f(1,2)
 
f(1)
 
 
I don't see how we could ever come up with any different resolution of these
function calls than binding the first call to the first declaration and the
second to the second. I don't think this argument holds water.
 
Michael Kay

-----Original Message-----
From: Michael Rys [mailto:mrys@microsoft.com] 
Sent: 04 November 2003 00:05
To: Kay, Michael; Noe Michejda; public-qt-comments@w3.org
Subject: RE: Overloading functions in XSLT and XQuery



The reason is that the current built-in overloading with arity should
continue to work if we go to overloading based on the full signature
information. Once we allow the users to overload, I am concerned that we get
cases where overloading with arity will result in a different resolution
than overloading based on the typed signature. So instead of having to deal
with this in (for XQuery) the first version, we wanted to postpone this
feature.

 

Best regards

Michael (speaking for himself)

 

 


  _____  


From: Kay, Michael [mailto:Michael.Kay@softwareag.com] 
Sent: Sunday, November 02, 2003 8:17 AM
To: Noe Michejda; Michael Rys; public-qt-comments@w3.org
Subject: RE: Overloading functions in XSLT and XQuery

 

> 
> RE: Overloading functions in XSLT and XQuery> XQuery 1.0 
> decided to only allow overloading of XQuery's own built-in 
> functions and not provide overloading 
> > capabilities for the user-defined functions. 
> > This explains the perceived contradiction below. 
> 
> But XSLT allows overloaded user-defined functions. 
> This will be very inconvinient for products allowing using of 
> XSLT libraries in XQuery. And to some degree event for people 
> porting libraries from XSLT to XQuery. 
> 

Personally, I agree. I can't see any logical objection to overloading by
arity (two functions with the same name but different numbers of arguments).
I think it's very odd that the function calling mechanism in XQuery allows
for it, but that user-defined functions have to be uniquely named.

Michael Kay 

Received on Tuesday, 4 November 2003 10:50:11 UTC