Boolean expression: Difference between revisions

Content deleted Content added
m languagess->languages - Fix a typo in one click
Boolean operators: short-circuit operators
Line 37:
 
Some programming languages derived from [[PL/I]] have a bit string type and use BIT(1) rather than a separate boolean type. In those languages the same operators serve for boolean operations and bitwise operations. The languages represent OR, AND, NOT and EXCLUSIVE OR by "|", "&", "¬" (infix) and "¬" (prefix).
 
===Short-circuit operators===
{{Main|Short-circuit evaluation}}
Some programming languages, e.g., [[Ada (programming language)|Ada]], have [[Short-circuit evaluation|short-circuit]] boolean operators. These operators use a [[lazy evaluation]], that is, if the value of the expression can be determined from the left hand boolean expression then they do not evaluate the right hand boolean expression. As a result, there may be [[Side effect (computer science)|side effects]] that only occur for one value of the left hand operand.
 
==Examples==