Skip to content

Commit

Permalink
update switch docs
Browse files Browse the repository at this point in the history
  • Loading branch information
leafo committed Jan 25, 2013
1 parent 7c4cd41 commit 05f6a0b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -696,12 +696,15 @@ is done with the `==` operator.
switch name
when "Robert"
print "You are robert"
when "Dan"
when "Dan", "Daniel"
print "Your name, it's Dan"
else
print "I don't know about your name"
```

A switch `when` clause can match against multiple values by listing them out
comma separated.

Switches can be used as expressions as well, here we can assign the result of
the switch to a variable:

Expand Down

0 comments on commit 05f6a0b

Please sign in to comment.