summaryrefslogtreecommitdiffhomepage
path: root/elixir.html.markdown
diff options
context:
space:
mode:
authorDivay Prakash <divayprakash@users.noreply.github.com>2018-10-24 11:30:23 +0530
committerGitHub <noreply@github.com>2018-10-24 11:30:23 +0530
commitadfd3064e52e769dc46f62d8302be7e28be4e48d (patch)
tree204d82adc9f82ae4fe377b631a1406b97eb6b11d /elixir.html.markdown
parent92022da0a6ea9417521563de9e537f337c426465 (diff)
parent8f5a67190705c9a3101653901d8f8a7b48eb1775 (diff)
Merge branch 'master' into MarkdownFRChanges
Diffstat (limited to 'elixir.html.markdown')
-rw-r--r--elixir.html.markdown6
1 files changed, 5 insertions, 1 deletions
diff --git a/elixir.html.markdown b/elixir.html.markdown
index a74baa38..e82509e7 100644
--- a/elixir.html.markdown
+++ b/elixir.html.markdown
@@ -287,7 +287,11 @@ end
PrivateMath.sum(1, 2) #=> 3
# PrivateMath.do_sum(1, 2) #=> ** (UndefinedFunctionError)
-# Function declarations also support guards and multiple clauses:
+# Function declarations also support guards and multiple clauses.
+# When a function with multiple clauses is called, the first function
+# that satisfies the clause will be invoked.
+# Example: invoking area({:circle, 3}) will call the second area
+# function defined below, not the first:
defmodule Geometry do
def area({:rectangle, w, h}) do
w * h