From da38c6bbedc188f9710ddf8dfb35770b9a9d4d1a Mon Sep 17 00:00:00 2001 From: Henrique Becker Date: Tue, 15 Dec 2020 17:03:16 -0300 Subject: [PATCH] Note that `&&` and `||` are `and` and `or`. (#37463) Suggested by this post in Discourse: https://discourse.julialang.org/t/and-or-bitwise-or-shortcircuit-what-we-get-searching-docs/46263 --- doc/src/manual/control-flow.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/manual/control-flow.md b/doc/src/manual/control-flow.md index 52bf59a662a0b..1b785070c0e1a 100644 --- a/doc/src/manual/control-flow.md +++ b/doc/src/manual/control-flow.md @@ -256,8 +256,9 @@ short-circuit behavior, but beware that `&` and `|` have higher precedence than Short-circuit evaluation is quite similar to conditional evaluation. The behavior is found in most imperative programming languages having the `&&` and `||` boolean operators: in a series of boolean expressions connected by these operators, only the minimum number of expressions are -evaluated as are necessary to determine the final boolean value of the entire chain. Explicitly, -this means that: +evaluated as are necessary to determine the final boolean value of the entire chain. Some +languages (like Python) refer to them as `and` (`&&`) and `or` (`||`). Explicitly, this means +that: * In the expression `a && b`, the subexpression `b` is only evaluated if `a` evaluates to `true`. * In the expression `a || b`, the subexpression `b` is only evaluated if `a` evaluates to `false`.