Reword function pattern matching example

This commit is contained in:
Jay Hayes
2016-05-02 12:17:55 -05:00
parent 944f932ec5
commit 8bcd7d2c94

View File

@@ -69,7 +69,7 @@ defmodule PatternMatching do
def make_noise(%{type: "dog"}), do: "Woof" def make_noise(%{type: "dog"}), do: "Woof"
def make_noise(_anything), do: "Eh?" def make_noise(_anything), do: "Eh?"
koan "Functions can declare what kind of arguments they accept" do koan "Functions perform pattern matching on their arguments" do
cat = %{type: "cat"} cat = %{type: "cat"}
dog = %{type: "dog"} dog = %{type: "dog"}
snake = %{type: "snake"} snake = %{type: "snake"}