Short-circuit evaluation: Difference between revisions
added Arturo
Simple9371 (talk | contribs) m (→{{header|Batch File}}: added 'on if command') |
Drkameleon (talk | contribs) (added Arturo) |
||
Line 506:
{{true, false, false, false}, {true, true, true, false}}
</pre>
=={{header|Arturo}}==
<syntaxhighlight lang="arturo">a: function [v][
print ["called function A with:" v]
v
]
b: function [v][
print ["called function B with:" v]
v
]
loop @[true false] 'i ->
loop @[true false] 'j ->
print ["\tThe result of A(i) AND B(j) is:" and? -> a i -> b j]
print ""
loop @[true false] 'i ->
loop @[true false] 'j ->
print ["\tThe result of A(i) OR B(j) is:" or? -> a i -> b j]</syntaxhighlight>
{{out}}
<pre>called function A with: true
called function B with: true
The result of A(i) AND B(j) is: true
called function A with: true
called function B with: false
The result of A(i) AND B(j) is: false
called function A with: false
The result of A(i) AND B(j) is: false
called function A with: false
The result of A(i) AND B(j) is: false
called function A with: true
The result of A(i) OR B(j) is: true
called function A with: true
The result of A(i) OR B(j) is: true
called function A with: false
called function B with: true
The result of A(i) OR B(j) is: true
called function A with: false
called function B with: false
The result of A(i) OR B(j) is: false</pre>
=={{header|AutoHotkey}}==
|