Skip to content

Commit

Permalink
Merge pull request #846 from michaelhkay/master
Browse files Browse the repository at this point in the history
845 Drop mention of tuples
  • Loading branch information
ndw authored Nov 21, 2023
2 parents ab946b1 + 53229d9 commit 34c6c8b
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions specifications/xquery-40/src/expressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18688,26 +18688,24 @@ subexpressions of the quantified expression that appear after the variable bindi
matching</termref>, a <termref
def="dt-type-error">type error</termref> is raised <errorref class="TY" code="0004"
/>.</p>
<p>The order in which test expressions are evaluated for the various binding
tuples is <termref

<p diff="chg" at="issue845">The order in which test expressions are evaluated
for the various items in the binding sequence is <termref
def="dt-implementation-dependent"
>implementation-dependent</termref>. If the quantifier
is <code>some</code>, an implementation may
return <code>true</code> as soon as it finds one binding tuple for which the test expression has
an <termref
def="dt-ebv"
>effective boolean value</termref> of <code>true</code>, and it may raise a <termref
def="dt-dynamic-error"
>dynamic error</termref> as soon as it finds one binding tuple for
which the test expression raises an error. Similarly, if the quantifier is <code>every</code>, an implementation may return <code>false</code> as soon as it finds one binding tuple for which the test expression has
an <termref
def="dt-ebv"
is <code>some</code>, an implementation may
return <code>true</code> as soon as it finds one item for which the test expression has
an <termref def="dt-ebv">effective boolean value</termref> of <code>true</code>, and it may raise a <termref
def="dt-dynamic-error">dynamic error</termref> as soon as it finds one item for
which the test expression raises an error. Similarly, if the quantifier is <code>every</code>, an
implementation may return <code>false</code> as soon as it finds one item for which the test expression has
an <termref def="dt-ebv"
>effective boolean value</termref> of <code>false</code>, and it may raise a <termref
def="dt-dynamic-error"
>dynamic error</termref> as soon as it finds one binding tuple for
which the test expression raises an error. As a result of these rules, the
value of a quantified expression is not deterministic in the presence of
errors, as illustrated in the examples below.</p>
def="dt-dynamic-error">dynamic error</termref> as soon as it finds one item for
which the test expression raises an error. As a result of these rules, the
value of a quantified expression is not deterministic in the presence of
errors, as illustrated in the examples below.</p>
<p>Here are some examples of quantified expressions:</p>

<ulist>
Expand Down Expand Up @@ -18749,7 +18747,7 @@ one <code>employee</code> element satisfies the given comparison expression:</p>

<item>
<p>In the following examples, each quantified expression evaluates its test
expression over nine pairs of variable bindings, formed from the Cartesian
expression over nine pairs of items, formed from the Cartesian
product of the sequences <code>(1, 2, 3)</code> and <code>(2, 3, 4)</code>.
The expression beginning with <code>some</code> evaluates to <code>true</code>,
and the expression beginning with <code>every</code> evaluates to <code>false</code>.</p>
Expand All @@ -18763,7 +18761,7 @@ satisfies $x + $y = 4]]></eg>
<item>
<p>This quantified expression may either return <code>true</code> or raise a <termref
def="dt-type-error"
>type error</termref>, since its test expression returns <code>true</code> for one variable binding
>type error</termref>, since its test expression returns <code>true</code> for one item
and raises a <termref
def="dt-type-error">type error</termref> for another:</p>
<eg role="parse-test"><![CDATA[some $x in (1, 2, "cat") satisfies $x * 2 = 4]]></eg>
Expand All @@ -18775,10 +18773,16 @@ and raises a <termref
<item>
<p>This quantified expression may either return <code>false</code> or raise a <termref
def="dt-type-error"
>type error</termref>, since its test expression returns <code>false</code> for one variable binding and raises a <termref
>type error</termref>, since its test expression returns <code>false</code> for one item and raises a <termref
def="dt-type-error">type error</termref> for another:</p>
<eg role="parse-test"><![CDATA[every $x in (1, 2, "cat") satisfies $x * 2 = 4]]></eg>
</item>

<item>
<p>This quantified expression returns <code>true</code>, because the binding sequence
is empty, despite the fact that the condition can never be satisfied:</p>
<eg role="parse-test"><![CDATA[every $x in () satisfies ($x lt 0 and $x gt 0)]]></eg>
</item>



Expand Down

0 comments on commit 34c6c8b

Please sign in to comment.