- From: Michael Brundage <xquery@comcast.net>
- Date: Mon, 03 Nov 2003 21:07:51 -0800
- To: Michael Rys <mrys@microsoft.com>, "Kay, Michael" <Michael.Kay@softwareag.com>, Noe Michejda <noe_michejda@7thportal.pl>, XQuery Public Comments <public-qt-comments@w3.org>
- Message-ID: <BBCC7427.636%xquery@comcast.net>
But Michael, this makes no sense. When would overloading by arity ever produce a result inconsistent with overloading by type? Overloading by type always starts with the premise that the two functions have the same name and same number of arguments -- and then looks to the types of the arguments to distinguish which function is invoked. Therefore, by definition, overloading by arity is forwards-compatible with overloading by type. Note also that youšve already defined overloading by arity for functions in the built-in function namespace. Therefore, any future overloading rules must be compatible with overloading by arity, or else you just create an inconsistent mess for implementers in which the built-in functions use a different set of overloading rules than other functions. (Oh wait, youšre already there.) Based on technical merits alone, therešs simply no reason to exclude overloading user-defined functions by arity in this version of XQuery. There are, however, plenty of other kinds of reasons (time-to-market, inertia, personal preference, inability to achieve consensus, etc.). Cheers, Michael (also speaking for himself) On 11/3/03 4:05 PM, "Michael Rys" <mrys@microsoft.com> wrote: > 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 00:07:56 UTC