RosettaCodeData/Task/Conditional-structures/Lambdatalk/conditional-structures.lambdatalk
2023-07-01 13:44:08 -04:00

17 lines
253 B
Text

{if true then yes else no}
-> yes
{def switch
{lambda {:n}
{if {< :n 0}
then :n is negative
else {if {> :n 0}
then :n is positive
else :n is zero}}}}
{switch -12}
-> -12 is negative
{switch 12}
-> 12 is positive
{switch 0}
-> 0 is zero