Short-circuit evaluation: Difference between revisions
→{{header|ooRexx}}: oops. the comma implies an or. corrected program, augmented the output
Walterpachl (talk | contribs) m (→{{header|ooRexx}}: fix tag) |
Walterpachl (talk | contribs) (→{{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()
If \a()
Else Say 'ok'
If a(), b() Then Say 'a
If \a(), b() Then Say 'Surprise'
Else Say 'ok: \a(
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>
{{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
a returns .true
b returns 1
a
a returns .true
ok: \a(
a returns .true
ok: \a() is false (Select)
</pre>
=={{header|Oz}}==
|