W3C home > Mailing lists > Public > public-xsl-query@w3.org > April 2016

RE: review of "Evaluating Function Calls"

From: Abel Braaksma <abel.braaksma@xs4all.nl>
Date: Tue, 19 Apr 2016 17:09:45 +0200
To: "'Robie, Jonathan'" <jonathan.robie@emc.com>, "'Michael Dyck'" <jmdyck@ibiblio.org>, "'Public Joint XSLT XQuery XPath'" <public-xsl-query@w3.org>
Message-ID: <03db01d19a4d$82f68b90$88e3a2b0$@xs4all.nl>
> >Because maps and arrays are functions, one can presumably perform partial
> >function application on them (though I think it would not generally be
> >useful). Is the resulting function a map/array? E.g., consider:
> >     let $m := map {"Su": "Sunday"} return ($m(?)) ? "Su"
> >Does the lookup return "Sunday", or does it raise a type error? I don't
> >think 3.1.5.1 gives a clear answer.
> 
> 
> Good point.
> 
> I agree that it isnĀ¹t terribly useful to create maps or arrays as the
> result of partial function application, but supporting it would be less
> surprising than not supporting it. It would require more test cases.
> 
> 

Alternatively, a more orthogonal solution may be to let the lookup operators allow to operate on function items as context item, but this would require to remove the "If the context item is not a map or an array, a type error is raised" from 3.11.3.1, and possibly modifying the rules here.

Cheers,
Abel
Received on Tuesday, 19 April 2016 15:10:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:43:16 UTC