[Bug 7350] [XPath 2.1] Higher Order Functions Need Sugar


--- Comment #7 from Michael Kay <mike@saxonica.com>  2009-10-13 17:56:17 ---
Perhaps, before we forget the reasoning, I could add a little bit more detail
of the discussion that led to these decisions.

On (1) the discussion was mainly about forwards compatibility. Allowing the
arity to be omitted only in the case where there were currently no overloads
would prevent such overloads being added in future without causing existing
programs to fail. Making an omitted arity refer to the function with minimum
arity would allow new arguments to be added, but would not allow an existing
argument to be made optional, as happened recently with string-join. Desigating
one of the overloads as primary requires a lot of syntactic machinery which we
felt was not justified by the benefits.

On (2) we felt that the existing family of op: functions was not especially
well designed for this job. For example, instead of six functions representing
the six operators op:greater-than, op:ge, op:lt, op:le, op:eq, and op:ne, there
are generally only two or three. We felt we would need to redesign this
interface if it were exposed to users, and this would be a lot of work.
Meanwhile it was quite possible for users or third parties to build a function
library on top of the operators and use this.

On (3) there was a general feeling that the idea was a good one, and various
discussions about the best way to do it (and the best characters to use - tilde
in place of question mark made a strong showing). We decided to require either
an expression or a "?" in each argument position so there was no ambiguity
about which function was being referenced, regardless whether a function was
being named explicitly or by reference to an expression returning a function

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 13 October 2009 17:56:22 UTC