You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pannous edited this page Dec 28, 2022
·
3 revisions
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.