W3C home > Mailing lists > Public > public-qt-comments@w3.org > November 2003

function overloading

From: Panagiotis Reveliotis <prevelio@bea.com>
Date: Tue, 25 Nov 2003 19:38:58 -0800
Message-ID: <32D5845A745BFB429CBDBADA57CD41AF0415E696@ussjex01.amer.bea.com>
To: <public-qt-comments@w3.org>

XQuery 1.0: An XML Query Language 
states (section 4.12: Function Declaration):
"In XQuery 1.0, user-declared functions may not be overloaded. 
A user-declared function is uniquely identified by its expanded QName. 
...
Note:
If a future version of XQuery supports overloading of user-declared functions, 
an ambiguity may arise between a function that takes a node as parameter and
a function with the same name that takes an atomic value as parameter (since a
function call automatically extracts the atomic value of a node when necessary). "

Would it be possible to relax this rule and allow for function overloading based 
on the arity of the function parameters? (in other words, allow for ns:fn(a), ns:fn(a,b),
ns:fn(a,b,c)). Such an approach would not lead to ambiguities, as a function
would be uniquely identified by its expanded QName and the number of its 
arguments. At the same time some of the flexibility provided by overloading 
would remain at the hands of the users.

Cheers,
Panagiotis
Received on Tuesday, 25 November 2003 22:39:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:28 GMT