I mistyped a start clause in a tumbling window expression using "where"
instead of "when"

for tumbling window $w in (1 to 20)
start at $s where $s mod 3 = 1
return <window>{$w}</window>

see
https://fiddle.basex.org/?share=%28%27query%21%27for+tumbling+-*w+in+%7B1+to+20%7D%5Cnstart+at4where4mod+3+%3D+1%5Cnreturn+%3C5%28%24w%29%3C%2F5.%21%27%27%7Emode%21%27XQuery+%7BBaseX%7D.Type%21%27xml%27%29*+%24-window.%27%7Econtext4*s+5-%3E%0154.-*_,
but I didn't get an error but a result


<window>1</window>
<window>4</window>
<window>7</window>
<window>10</window>
<window>13</window>
<window>16</window>
<window>19</window>


Shouldn't that query give a syntax error that "when" is expected instead
of "where"?

Or is that a new XQuery 4 feature that the "when" clause can be omitted
and the above is kind of parsed/executed as


for tumbling window $w in (1 to 20)
start at $s
where $s mod 3 = 1
return <window>{$w}</window>

?

Reply via email to