From 05f6a0b7f7de5896bcacd278eb215e00c49d9160 Mon Sep 17 00:00:00 2001 From: leaf corcoran Date: Thu, 24 Jan 2013 18:44:14 -0800 Subject: [PATCH] update switch docs --- docs/reference.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/reference.md b/docs/reference.md index e664dba..64d89da 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -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: