Open timohanke opened 1 year ago
Sorry, that is a bit confusing but the Boolean constructs and
and or
and not
are not included in <binop>
, but instead have dedicated grammar productions and sections (eg https://internetcomputer.org/docs/current/motoko/main/language-manual#and) explaining their use, precisely because
andand
orare short-circuiting/lazy, unlike
But I should probably delete class L
which is defined but never used in the tables.
Thanks. I had not seen the dedicated sections on the and/or
operators but see them now. Please close the issue when class L
is removed.
https://github.com/dfinity/motoko/blob/c6d1af06ea9c5751d1cde37ff94dbab97977e1f0/doc/md/language-manual.md?plain=1#L236-L293
In this section it seems that all binary operators are listed but not the logical ones. Is that missing?
Further down in https://github.com/dfinity/motoko/blob/c6d1af06ea9c5751d1cde37ff94dbab97977e1f0/doc/md/language-manual.md?plain=1#L1682-L1684 the statement does not seem to be correct for binary logical operators. For example,
<exp1> and <exp2>
would not evaluate<exp2>
if<exp1>
evaluates to false. But the text says that<exp2>
is evaluated unless the evaluation of<exp1>
traps.