Short-circuit evaluation: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: fixed a typo, added a dash.) |
Alextretyak (talk | contribs) (Added 11l) |
||
Line 28: | Line 28: | ||
<br>If the language does not have short-circuit evaluation, this might be achieved with nested '''if''' statements. |
<br>If the language does not have short-circuit evaluation, this might be achieved with nested '''if''' statements. |
||
<br><br> |
<br><br> |
||
=={{header|11l}}== |
|||
{{trans|Python}} |
|||
<lang 11l>F a(v) |
|||
print(‘ ## Called function a(#.)’.format(v)) |
|||
R v |
|||
F b(v) |
|||
print(‘ ## Called function b(#.)’.format(v)) |
|||
R v |
|||
L(i) (0B, 1B) |
|||
L(j) (0B, 1B) |
|||
print("\nCalculating: x = a(i) and b(j)") |
|||
V x = a(i) & b(j) |
|||
print(‘Calculating: y = a(i) or b(j)’) |
|||
V y = a(i) | b(j)</lang> |
|||
{{out}} |
|||
<pre> |
|||
Calculating: x = a(i) and b(j) |
|||
# Called function a(0B) |
|||
Calculating: y = a(i) or b(j) |
|||
# Called function a(0B) |
|||
# Called function b(0B) |
|||
Calculating: x = a(i) and b(j) |
|||
# Called function a(0B) |
|||
Calculating: y = a(i) or b(j) |
|||
# Called function a(0B) |
|||
# Called function b(1B) |
|||
Calculating: x = a(i) and b(j) |
|||
# Called function a(1B) |
|||
# Called function b(0B) |
|||
Calculating: y = a(i) or b(j) |
|||
# Called function a(1B) |
|||
Calculating: x = a(i) and b(j) |
|||
# Called function a(1B) |
|||
# Called function b(1B) |
|||
Calculating: y = a(i) or b(j) |
|||
# Called function a(1B) |
|||
</pre> |
|||
=={{header|Ada}}== |
=={{header|Ada}}== |