W3C home > Mailing lists > Public > public-qt-comments@w3.org > August 2009

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

From: <bugzilla@wiggum.w3.org>
Date: Wed, 19 Aug 2009 23:01:07 +0000
To: public-qt-comments@w3.org
Message-Id: <E1Mdu9T-00009o-M9@wiggum.w3.org>

John Snelson <john.snelson@oracle.com> changed:

           What    |Removed                     |Added
                 CC|                            |john.snelson@oracle.com

--- Comment #4 from John Snelson <john.snelson@oracle.com>  2009-08-19 23:01:07 ---
I'm intrigued who our anonymous commenter could be :-).

My comments on the proposal:

1) I'm not keen on using "(~)" for literal function items - at least the "#"
symbol has an association with numbers and by extension arity. I see no reason
not to allow "local:func#" (without specific arity) to reference either a
function with unambiguous arity, or the function with minimum arity.

I strongly dislike the idea of retrofitting a "primary-overload" modifier to
one of many overloaded functions signatures. I think this is to complicated for
it's marginal benefit.

2) I have sympathy with the desire to reference functions for built in
operators, but think that exposing the underlying polymorphic operator
functions is undesirable. It's my opinion that something like an EXPath module
will quickly come into existence to fill this need.

3) I like the "?" syntax for partial application, and think it's a definite
improvement. With regard to Michael Dyck's comment, my suggestion is that this
is only allowed to be used when invoking function items ("dynamic function
invocation" in my proposal) - meaning a regular function call like this will
still be an error (wrong number of arguments):


However, we instead allow this to bind the first argument of fn:starts-with():


And this could bind a collation name for fn:starts-with():

fn:starts-with#3(?, ?, "http://my.collation.com")

This means the proposal example becomes:

let $sum := f:foldl#(local:add#, 0)

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 Wednesday, 19 August 2009 23:01:17 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:40 UTC