Short-circuit evaluation: Difference between revisions
Content added Content deleted
(→{{header|PureBasic}}: Added task) |
(+Icon) |
||
Line 17: | Line 17: | ||
y = a(j) or b(j) |
y = a(j) or b(j) |
||
If the language does not have short-circuit evaluation, this might be achieved with nested if statements. |
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}}== |
=={{header|PureBasic}}== |
||
Line 63: | Line 73: | ||
Calculating: x = a(1) Or b(1) |
Calculating: x = a(1) Or b(1) |
||
# Called function a(1)</pre> |
# Called function a(1)</pre> |
||
=={{header|Python}}== |
=={{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. |
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. |