Re: Arrow operator and empty sequences

I agree with Christian.  I think a key difference with path
expressions is that the RHS operand is not called once per item in the
result of evaluating the LHS operand (which indeed, is zero times for
the empty sequence).

With the arrow operator, the RHS is called exactly once, whatever the
result of evaluating the LHS.

Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/


On 17 December 2015 at 17:50, Christian Grün wrote:
>> This is probably intended, but if not, I wonder if an optimizing processor may evaluate the right-hand side of this operator and stop evaluation if it concludes it is the empty sequence.
>
> I don’t think so, because there are many functions which provide
> meaningful results other than empty sequences, even if the input is
> empty (such as e.g. /one/two/three => count() ).
>
> Christian

Received on Thursday, 17 December 2015 17:34:40 UTC