switch - pannous/angle GitHub Wiki

color=red
switch color {
green: print "woods!"
red: say "fire!"
}

the switch operator in wasp is similar to map indexing:

action_map={
green: print "woods!"
red: say "fire!"
}
switch color action_map == action_map[color] or action_map[default] !
get color within action_map 

the difference between the switch operator and map indexing is that it is always an execution context and if no key matches it tries the ' default' key.