Skip to content
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.

Home

Philosophy

data & code blocks

features

inventions

evaluation

keywords

iteration

tasks

examples

todo : bad ideas and open questions

⚠️ specification and progress are out of sync

Clone this wiki locally