musique/regression-tests/builtin/if.mq

14 lines
341 B
Plaintext
Raw Permalink Normal View History

-- If executes then first block when condition is true
2022-10-31 00:39:56 +01:00
if true (say 1),
if true (say 2) (say 3),
-- If executes second block when condition is false
2022-10-31 00:39:56 +01:00
if false (say 4) (say 5),
-- If returns nil when without else block
2022-10-31 00:39:56 +01:00
say (if false (say 6)),
-- If returns block execution value
2022-10-31 00:39:56 +01:00
say (if true (7)),
say (if false (say 100, 8) (say 200, 9)),