Skip to content

Commit 8551b7f

Browse files
committed
langref: Clarify use of operators on vectors (and and or not allowed)
1 parent 25b398c commit 8551b7f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

doc/langref.html.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,8 +1926,10 @@ or
19261926
Vector types are created with the builtin function {#link|@Vector#}.
19271927
</p>
19281928
<p>
1929-
Vectors support the same builtin operators as their underlying base types.
1930-
These operations are performed element-wise, and return a vector of the same length
1929+
Vectors generally support the same builtin operators as their underlying base types.
1930+
The only exception to this is the keywords `and` and `or` on vectors of bools, since
1931+
these operators affect control flow, which is not allowed for vectors.
1932+
All other operations are performed element-wise, and return a vector of the same length
19311933
as the input vectors. This includes:
19321934
</p>
19331935
<ul>
@@ -1937,6 +1939,7 @@ or
19371939
<li>Bitwise operators ({#syntax#}>>{#endsyntax#}, {#syntax#}<<{#endsyntax#}, {#syntax#}&{#endsyntax#},
19381940
{#syntax#}|{#endsyntax#}, {#syntax#}~{#endsyntax#}, etc.)</li>
19391941
<li>Comparison operators ({#syntax#}<{#endsyntax#}, {#syntax#}>{#endsyntax#}, {#syntax#}=={#endsyntax#}, etc.)</li>
1942+
<li>Boolean not ({#syntax#}!{#endsyntax#})</li>
19401943
</ul>
19411944
<p>
19421945
It is prohibited to use a math operator on a mixture of scalars (individual numbers)

0 commit comments

Comments
 (0)