(if cond a b)
Now you can have nested ifs (ifs inside of ifs) A common thing to see is a if as the b function. An easier way to do that is with switch.
A switch is just a condensed form of nested ifs. If put in the if form it would look like this
Code: Select all
(if cond1
a1
(if cond2
a2
(if cond3
a3
...
(if condN
aN
default
)
...
)
)
)
Code: Select all
(switch
cond1 a1
cond2 a2
cond3 a3
...
cond4 a4
default
)