From 8cd37fc2937d32d9f2457bcb35770b885cbd35b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Gim=C3=A9nez?= Date: Wed, 3 Jan 2018 21:43:43 -0300 Subject: [PATCH] Add Case control flow structre and remove css class --- elixir.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/elixir.md b/elixir.md index d9ed705a5..f67592614 100644 --- a/elixir.md +++ b/elixir.md @@ -105,7 +105,6 @@ Pattern matching works in function parameters too. Control flow ------------ -{: .-three-column} ### If @@ -116,6 +115,18 @@ else "This will" end ``` +### Case + +```elixir +case {1, 2, 3} do + {4, 5, 6} -> + "This clause won't match" + {1, x, 3} -> + "This clause will match and bind x to 2 in this clause" + _ -> + "This clause would match any value" +end +``` ### Cond