I don't know if this has been discussed before. But I was able to simulate a switch feature by using a loop and making sure I break on each condition.
loop
if x < 1 then
do_something()
break
endif
if x < 5 then
do_something_else()
break
endif
// put the default options here since they don't match any conditions
default()
break // don't forget to break here
repeat
The coolness of doing this is that if you have a large number of exclusive possibilities that you are testing for you can exit the checking as soon as you find the right one. Or if you're dealing with a deeply nested if .. then .. else this can cut down the depth.