Re: QT4CG-003-02: MK to propose a reformulation of fn:index-of() in terms of fn:index-where()

> 
>> But it might be better to formulate index-where as
>> 
>> for $item at $position in $input
>> where $predicate($item)
>> return $position
> 
> That seems clear to me. Is the suggestion that it should be normatively
> described this way, or only that this should be shown as an illustration
> of its semantics?
> 

I personally like the approach of giving the rules in readable English prose, and then adding the phrase "More formally, the function returns the value of {some expression}."

With this formulation, both the prose and the expression are normative, but it should be clear to the reader that the "more formally" exposition can be relied on to resolve any ambiguities in the prose.

In the old joint WG, some XSL-WG members objected to such expositions relying exclusively on XQuery syntax, and insisted on an equivalent being provided in XSLT. I don't feel any strong need to continue that tradition.

Michael Kay 

Received on Wednesday, 21 September 2022 07:25:25 UTC