Short-circuit evaluation: Difference between revisions

+Icon
(+Icon)
Line 17:
y = a(j) or b(j)
If the language does not have short-circuit evaluation, this might be achieved with nested if statements.
 
== Icon and Unicon ==
Placeholder.
==={{header|Icon}}===
<lang Icon>
</lang>
==={{header|Unicon}}===
<lang Unicon>
</lang>
The Icon solution works in Unicon.
 
=={{header|PureBasic}}==
Line 63 ⟶ 73:
Calculating: x = a(1) Or b(1)
# Called function a(1)</pre>
 
=={{header|Python}}==
Pythons '''and''' and '''or''' binary, infix, boolean operators will not evaluate their right-hand expression if the outcome can be determined from the value of the left-hand expression.
Anonymous user