|
Re: FunctionSignature, rev 2: msg#00211text.xml.exist
I have a different idea for handling "overloaded" functions like fn:sum(). The spec "overloads" functions by changing their function signatures to have different numbers of arguments. So it is possible to have fn:sum($a) and fn:sum($a, $b) but fun:sum($a, $b, $c) is not specified and should not be allowed. I think to properly handle this, org.exist.query.Module _should_ have the methods FunctionSignature getSignatureForFunction(QName, numArgs) and Class getClassForFunction(QName, numArgs) Change the semantics of FunctionSignature.isOverloaded() to signify that this _QName_ is overloaded, and that AbstractInternalModules should keep for that QName key in its Map a List of FunctionDefs (or a Map, keyed by the number of Arguments?), not just a FunctionDef. Have two implementing classes for fn:sum - one with one arg and one with two. Their functiondefs could look like: FunctionDef(SumFunction1.signature, SumFunction1.class) FunctionDef(SumFunction2.signature, SumFunction2.class) etc. This takes us away from adding semantics to try to deal with "optional" sequences as arguments, including the concept of "unlimited" sequences (which is there now but which I now think is not right). What do you think? On Thu, 23 Sep 2004, Wolfgang Meier wrote: I have been thinking a bit more about the changes you proposed. They point ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | matches() function: 00211, Jonathan Miller |
|---|---|
| Next by Date: | Re: FunctionSignature, rev 2: 00211, finder |
| Previous by Thread: | Re: FunctionSignature, rev 2i: 00211, Wolfgang Meier |
| Next by Thread: | Re: FunctionSignature, rev 2: 00211, finder |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |