Short-circuit evaluation: Difference between revisions

→‎{{header|ooRexx}}: oops. the comma implies an or. corrected program, augmented the output
(→‎{{header|ooRexx}}: oops. the comma implies an or. corrected program, augmented the output)
Line 1,565:
<lang oorexx>Parse Version v
Say 'Version='v
If a() &| b() Then Say 'a and b are true'
If \a() &| b() Then Say 'Surprise'
Else Say 'ok'
If a(), b() Then Say 'a and b areis true'
If \a(), b() Then Say 'Surprise'
Else Say 'ok: \a(If) is false'
Select
When \a(), b() Then Say 'Surprise'
Otherwise Say 'ok: \a() is false (Select)'
End
Exit
a: Say 'a returns .true'; Return .true
b: Say 'b returns 1'; Return 1</lang>
</lang>
{{out}}
<pre>Version=REXX-ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014
Line 1,585 ⟶ 1,586:
a returns .true
b returns 1
Surprise
ok
a returns .true
b returns 1
a and b areis true
a returns .true
ok: \a(If) is false
a returns .true
ok: \a() is false (Select)</pre>
</pre>
 
=={{header|Oz}}==
2,295

edits