Re: "anonymous function"

> 
> I don't think we should change definitions that occur in XQuery 3.0 unless there is an important reason to do so, and this is an established term:
> 
> https://www.w3.org/TR/xquery-30/#dt-anonymous-function

I don't think that link resolves. The term "anonymous function" does not appear in the glossary.

(Incidentally, it would be a nice touch if the glossary used a more appropriate collation)

> 
> I do think it is useful to rewrite the function call section to simplify it.  I think we should also try to keep the conceptual framework close to that used in XQuery 3.1 [you mean 3.0].  The purpose of XQuery 3.1 is to add JSON support, and we should be conservative about changing things that are not related to that goal.
> 
> 

I think the section needs to change partly because it is broken, and partly because of new things we have added to the language.

Which reminds me that the taxonomy of functions in the current draft doesn't seem to include maps or arrays.

Which makes me even more convinced that the current approach is fundamentally wrong.

What we should be saying is:

5(b) If FC is not a partial function application, F is invoked.

The following information is potentially available to F:

* The converted argument values
* The static and dynamic context of the function call (SC/DC). 

Note: most functions do not make use of this context information, and in the case of functions whose implementation is a FunctionBody, there is no means of making use of the information. In particular, the dynamic context of the function call is NOT available as the dynamic context of the FunctionBody. Built-in functions that make use of context information are listed in [F+O] with the property context-dependent.

The implementation of F either returns a value of the declared result type, or raises a dynamic error. This return value or dynamic error becomes the outcome of the function call.

Note: where the implementation of the function is a FunctionBody, the return value computed by the FunctionBody is converted to the declared result type using the function conversion rules.

For more details of how particular kinds of function are evaluated, see ......

Michael Kay
Saxonica

Received on Tuesday, 1 March 2016 23:06:40 UTC