diff options
author | Stanley Lim <slim679975@gmail.com> | 2019-11-21 10:54:24 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-21 10:54:24 -0500 |
commit | 2b1e1cca08eac0d4dc8f685dbe98d80683ca9d3a (patch) | |
tree | 460bb7d5cbc1141f8e710e3704f6d03dc25ea193 /elixir.html.markdown | |
parent | d4c5ff14cc8a0717f68746b4fe84cfb4efbdecf6 (diff) | |
parent | f1d03b0318a43441bb96bfdaabbd914eaa985879 (diff) |
Merge pull request #1 from adambard/master
Merging from master.
Diffstat (limited to 'elixir.html.markdown')
-rw-r--r-- | elixir.html.markdown | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/elixir.html.markdown b/elixir.html.markdown index a74baa38..7af29202 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 @@ -448,7 +452,7 @@ Agent.update(my_agent, fn colors -> ["blue" | colors] end) ## References * [Getting started guide](http://elixir-lang.org/getting-started/introduction.html) from the [Elixir website](http://elixir-lang.org) -* [Elixir Documentation](http://elixir-lang.org/docs/master/) +* [Elixir Documentation](https://elixir-lang.org/docs.html) * ["Programming Elixir"](https://pragprog.com/book/elixir/programming-elixir) by Dave Thomas * [Elixir Cheat Sheet](http://media.pragprog.com/titles/elixir/ElixirCheat.pdf) * ["Learn You Some Erlang for Great Good!"](http://learnyousomeerlang.com/) by Fred Hebert |