[XQuery 3.1] clarification required on arrow postfix behavior

Dear All,

What is the expected behavior if the arrow postfix operator is applied to a
sequence containing more than one item?

Does the semantic equivalence "$seq=>$f(…) is the same as $f( $seq, … )"
also hold when count($seq) != 1?
ex, ( 1, 2, 3 ) => avg() or ()=>count()

In the last call working draft the wording for arrow postfix definition
implies that a [single] item is expected, but don’t see why or if this
restriction would be necessary.

“[Definition: An arrow operator is a postfix operator that applies a
function to an item, using the item as the first argument to the function.]
If $i is an item and f() is a function, then $i=>f() is equivalent to
f($i), and $i=>f($j) is equivalent to f($i, $j).”

If the single restriction doesn't apply, then I suggest modifying the
definition to reflect this.

And a question related to operator precedence: currently it is not possible
to use a node selection on the lhs of an arrow operator without wrapping it
with extra parenthesis:
$DAYS//@From => max() - syntax error
($DAYS//@From) => max() - ok
is it planned for the arrow operator to be moved above the step
expression(i.e. get lower precedence) so that one can use a node selection
=> without the need of the extra parenthesis?

Best regards,
Botond Biró

Received on Friday, 5 December 2014 18:28:08 UTC