RosettaCodeData/Task/Short-circuit-evaluation/R/short-circuit-evaluation-4.r
2023-07-01 13:44:08 -04:00

14 lines
196 B
R

> switchop(-1, a(1), b(1))
a called
[1] TRUE
> switchop(1, a(1), b(1))
a called
b called
[1] TRUE
> switchop(1, a(0), b(1))
a called
[1] FALSE
> switchop(0, a(0), b(1))
a called
b called
[1] TRUE