RosettaCodeData/Task/Conditional-structures/Transd/conditional-structures.transd

19 lines
356 B
Plaintext

#lang transd
MainModule: {
_start: (λ locals: b 1 c 0
(textout (if b "OK" else "NO") "\n")
// switch/case emulation
(textout (* 5
(if (== b 0) 2
elsif (== b 1) 5
else 6)) "\n")
// example of using 'or' as a conditional construct
(or (!= c 0) (textout "c is 0"))
)
}