You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We define A -> F(B, C) as being equivalent to A ! F(., B, C) which means that B and C are evaluated with a focus based on the current item in A, not with the outer focus. This is different from the => operator. For example if the $E is an element E, with several children called F, then
namespace-uri(.) -> fn:QName(name())
has a different effect from
namespace-uri(.) => fn:QName(name())
whereas it might reasonably be expected that in the case where the LHS produces a single value, the two operators are equivalent. We can't change the meaning of => because it's defined in 3.1. So should we change the meaning of -> to fall into line?
We could do this easily enough by defining A -> F(B, C) as equivalent to for $a in A return F($a, B, C). I think that as well as being more consistent with =>, the result is probably more intuitive. (We could also define it as equivalent to let $f := F(?, B, C) return A ! $f(.))
For the expression A -> {B}, and for the proposed A => {B}, I don't think we have any choice other than evaluating B with an inner focus based on A. But at least we can do it consistently for both operators.
The text was updated successfully, but these errors were encountered:
We define
A -> F(B, C)
as being equivalent toA ! F(., B, C)
which means that B and C are evaluated with a focus based on the current item in A, not with the outer focus. This is different from the=>
operator. For example if the $E is an element E, with several children called F, thennamespace-uri(.) -> fn:QName(name())
has a different effect from
namespace-uri(.) => fn:QName(name())
whereas it might reasonably be expected that in the case where the LHS produces a single value, the two operators are equivalent. We can't change the meaning of
=>
because it's defined in 3.1. So should we change the meaning of->
to fall into line?We could do this easily enough by defining
A -> F(B, C)
as equivalent tofor $a in A return F($a, B, C)
. I think that as well as being more consistent with=>
, the result is probably more intuitive. (We could also define it as equivalent tolet $f := F(?, B, C) return A ! $f(.)
)For the expression
A -> {B}
, and for the proposedA => {B}
, I don't think we have any choice other than evaluating B with an inner focus based on A. But at least we can do it consistently for both operators.The text was updated successfully, but these errors were encountered: