Re: [XQuery 3.1] clarification required on arrow postfix behavior

> 
> 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.

You're right, I think it's a bug. It should be any sequence.

> 
> “[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

We can certainly review it. 

Michael Kay
Saxonica

Received on Friday, 5 December 2014 19:04:27 UTC