From 2c5a83889a1bada27badaae3052420fdce48940f Mon Sep 17 00:00:00 2001
From: mikulely <mikulely@gmail.com>
Date: Mon, 25 Nov 2013 09:19:19 +0800
Subject: [PATCH 001/160] to_binary has been deprecated, to_string works

Tested on Interactive Elixir (0.11.2-dev)
---
 getting_started/3.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/3.markdown b/getting_started/3.markdown
index 8e297cb2c..311fb3777 100644
--- a/getting_started/3.markdown
+++ b/getting_started/3.markdown
@@ -464,6 +464,6 @@ In other words, we are simply calling the function `flatten` on the atom `:lists
 ```iex
 iex> is_atom(List)
 true
-iex> to_binary(List)
+iex> to_string(List)
 "Elixir.List"
 ```

From 0135851f34079fd73b81f4ff44da3c24d152e90b Mon Sep 17 00:00:00 2001
From: mikulely <mikulely@gmail.com>
Date: Mon, 25 Nov 2013 20:27:31 +0800
Subject: [PATCH 002/160] Key-value pair stores in a list, not in a tuple

Tested on Interactive Elixir (0.11.2-dev)
---
 getting_started/4.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/4.markdown b/getting_started/4.markdown
index 95cd7d42a..15a383705 100644
--- a/getting_started/4.markdown
+++ b/getting_started/4.markdown
@@ -188,7 +188,7 @@ If we inspect our `HashDict`, we can see it is a simple tuple:
 
 ```elixir
 inspect(dict, raw: true)
-#=> { HashDict, 1, [{:hello,"world"}] }
+#=> "{HashDict, 1, [[:hello | \"world\"]]}"
 ```
 
 Since `HashDict` is a data structure that contains values, it would be convenient to implement the `Blank` protocol for it too:

From 595a460b96918dec5b83211e711c6aed26f7147a Mon Sep 17 00:00:00 2001
From: mikulely <mikulely@gmail.com>
Date: Mon, 25 Nov 2013 21:34:38 +0800
Subject: [PATCH 003/160] The second element of tuple has been added some
 metadata.

Tested on Interactive Elixir (0.11.2-dev)
---
 getting_started/5.markdown | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/getting_started/5.markdown b/getting_started/5.markdown
index b72deeba5..7c07af3e0 100644
--- a/getting_started/5.markdown
+++ b/getting_started/5.markdown
@@ -28,7 +28,7 @@ Operators are also represented as such tuples:
 
 ```iex
 iex> quote do: 1 + 2
-{ :+, [], [1, 2] }
+{:+, [context: Elixir, import: Kernel], [1, 2]}
 ```
 
 Even a tuple is represented as a call to `{}`:
@@ -49,7 +49,7 @@ When quoting more complex expressions, we can see the representation is composed
 
 ```iex
 iex> quote do: sum(1, 2 + 3, 4)
-{ :sum, [], [1, { :+, [], [2, 3] }, 4] }
+{:sum, [], [1, {:+, [context: Elixir, import: Kernel], [2, 3]}, 4]}
 ```
 
 In general, each node (tuple) above follows the following format:

From d60a1dde2933a02039f441e3438e1e3d8409197d Mon Sep 17 00:00:00 2001
From: mikulely <mikulely@gmail.com>
Date: Tue, 26 Nov 2013 09:16:46 +0800
Subject: [PATCH 004/160] Update partial function example

Tested on Interactive Elixir (0.11.2-dev),the function `atom_to_binary/1`'s arity is 1, a function which arity is 2 should be used here to demonstrate the usage of partial function.
---
 getting_started/6.markdown | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index 6f047f4f2..f4a81ac00 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -177,13 +177,13 @@ iex> fun.("hello")
 A capture also allows the captured functions to be partially applied, for example:
 
 ```iex
-iex> fun = &atom_to_binary(&1, :utf8)
-#Function<6.17052888 in :erl_eval.expr/5>
-iex> fun.(:hello)
-"hello"
+iex> fun = &rem(&1, 2)                  
+#Function<6.80484245 in :erl_eval.expr/5>
+iex> fun.(4)
+0
 ```
 
-In the example above, we use `&1` as a placeholder, generating a function with one argument. The capture above is equivalent to `fn(x) -> atom_to_binary(x, :utf8) end`.
+In the example above, we use `&1` as a placeholder, generating a function with one argument. The capture above is equivalent to `fn(x) -> rem(x, 2) end`.
 
 Since operators are treated as regular function calls in Elixir, they are also supported, although they require explicit parentheses:
 

From d0fe022eb42c62608653f7b1b957a4f29d7e97bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BD=B3=E9=9F=B3?= <mikulely@gmail.com>
Date: Sat, 30 Nov 2013 20:46:09 +0800
Subject: [PATCH 005/160] Binary.Inspect now is Inspect

Tested on Interactive Elixir (0.11.2)
---
 getting_started/4.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/4.markdown b/getting_started/4.markdown
index 15a383705..20c78876e 100644
--- a/getting_started/4.markdown
+++ b/getting_started/4.markdown
@@ -239,7 +239,7 @@ iex> Enum.reduce 1..3, 0, fn(x, acc) -> x + acc end
 6
 ```
 
-* `Binary.Inspect` - this protocol is used to transform any data structure into a readable textual representation. This is what tools like IEx use to print results:
+* `Inspect` - this protocol is used to transform any data structure into a readable textual representation. This is what tools like IEx use to print results:
 
 ```iex
 iex> { 1, 2, 3 }

From 7bd4e7c6f3876804a2e55502daae9462647c5ee8 Mon Sep 17 00:00:00 2001
From: Yuki Ito <yuki@gnnk.net>
Date: Sat, 7 Dec 2013 15:35:46 +0900
Subject: [PATCH 006/160] IO.puts accepts number

---
 getting_started/3.markdown | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/getting_started/3.markdown b/getting_started/3.markdown
index 311fb3777..4a9a8b6f5 100644
--- a/getting_started/3.markdown
+++ b/getting_started/3.markdown
@@ -75,8 +75,7 @@ defmodule Math do
   end
 end
 
-# IO.puts expects a list or a binary, so we use the string representation of the sum
-IO.puts to_string(Math.sum(1, 2))
+IO.puts Math.sum(1, 2)
 ```
 
 And execute it as:

From 7767e18ef27bf5bf4171beb619664dd64aaed213 Mon Sep 17 00:00:00 2001
From: Richard Jones <rj@metabrew.com>
Date: Sun, 8 Dec 2013 12:00:05 +0000
Subject: [PATCH 007/160] Fix erlang code example

Shouldn't call a function "fun" in erlang code, update the erlang function naming to match the Elixir code.
---
 crash-course.markdown | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/crash-course.markdown b/crash-course.markdown
index 495a16a4b..d9fc22a1b 100644
--- a/crash-course.markdown
+++ b/crash-course.markdown
@@ -376,14 +376,14 @@ Each Erlang module lives in its own file which has the following structure:
 
 ```erlang
 -module(hello_module).
--export([some_fun/0, fun/1]).
+-export([some_fun/0, some_fun/1]).
 
 % A "Hello world" function
 some_fun() ->
   io:format('~s~n', ['Hello world!']).
 
 % This one works only with lists
-fun(List) when is_list(List) ->
+some_fun(List) when is_list(List) ->
   io:format('~s~n', List).
 
 % Non-exported functions are private

From b61b1fe3487fa0a5a3d2c04366ebbb5b6f521d4e Mon Sep 17 00:00:00 2001
From: Rafael Rosa Fu <rafaelrosafu@gmail.com>
Date: Thu, 12 Dec 2013 01:27:11 -0500
Subject: [PATCH 008/160] Fixing minor typo on blog post

---
 _posts/2013-08-08-elixir-design-goals.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/_posts/2013-08-08-elixir-design-goals.markdown b/_posts/2013-08-08-elixir-design-goals.markdown
index d69e5a38b..f62442ac8 100644
--- a/_posts/2013-08-08-elixir-design-goals.markdown
+++ b/_posts/2013-08-08-elixir-design-goals.markdown
@@ -88,7 +88,7 @@ This simple example illustrates how a developer can leverage macros to provide a
 
 Those examples are just scratching the surface of what can be achieved with macros in Elixir. For example, we are currently using macros to compile routes from a web application into a bunch of patterns that are highly optimizable by the VM, providing an expressive but heavily optimized routing algorithm.
 
-The macro system also caused a huge imapct on the syntax, which we will discuss briefly before moving to the last goal.
+The macro system also caused a huge impact on the syntax, which we will discuss briefly before moving to the last goal.
 
 ### Syntax
 

From 6344c2fb91a83325b4151f13790de985fb09b173 Mon Sep 17 00:00:00 2001
From: Peter Minten <peter.minten@online.nl>
Date: Wed, 11 Dec 2013 16:42:48 +0100
Subject: [PATCH 009/160] Blog post about the new enumerators

---
 ...xir-s-new-continuable-enumerators.markdown | 209 ++++++++++++++++++
 1 file changed, 209 insertions(+)
 create mode 100644 _posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown

diff --git a/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown b/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown
new file mode 100644
index 000000000..7ba92b8a1
--- /dev/null
+++ b/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown
@@ -0,0 +1,209 @@
+---
+layout: post
+title: Elixir's new continuable enumerators
+author: Peter Minten
+category: "What's New in Elixir"
+excerpt: In 0.12.0 Elixir's enumerators have gained the ability to suspend value
+         production and to terminate early.
+---
+
+As you may have heard in the upcoming 0.12.0 release Elixir's enumerators gained
+some new features. In this blog post I'll explain what's new, what it enables
+and how it works.
+
+For those of you who use the development version of Elixir these changes are
+already available. For the exact differences in code you can look at the
+[relevant pull request](https://github.com/elixir-lang/elixir/pull/1922).
+
+## A recap of enumerators, and some terminology
+
+The basic idea of enumerators is that you traverse some data structure or
+resource (lines from a file) by putting the thing that is traversed in control.
+That is if you're reading from a file you have a loop that reads lines from a
+file and for each line calls a function. Just calling a function isn't all that
+useful for most tasks as there'd be no way to remember previous lines (ugly
+hacks aside), so some accumulator value is passed to the function and a new
+accumulator is returned by it.
+
+For example here's how you can count the total length of strings in a list.
+
+```elixir
+Enumerable.reduce(l, 0, fn x, acc -> String.length(x) + acc end)
+```
+
+Often the actual call to `Enumerable.reduce/3` is hidden inside another
+function.  Say that we want to define a `sum` function. The usual way is to
+write it like this:
+
+```elixir
+def sum(coll) do
+  Enumerable.reduce(coll, 0, fn x, acc -> x + acc end)
+end
+```
+
+This could get called as `Enum.map(1..10, &(&1 * &1)) |> sum()` to get the sum of
+squares. Desugaring this means `sum(Enum.map(1..10, &(&1 * &1)))`.
+
+The general pattern is this:
+
+```elixir
+def outer_function(coll, ...) do
+  ...
+  Enumerable.reduce(coll, initial_consumer_acc, consumer)
+  ...
+end
+
+something_that_returns_an_enumerable(...) |> outer_function(...)
+```
+
+You'll notice the slightly uncommon terminology of "outer function" and
+"consumer" (normally called an "iteratee"). That's intentional, naming an
+iteratee a consumer better reflects that it consumes values.
+
+Along the same lines I call the reduce function for a specific enumerable a
+producer, it produces values which are given to a consumer.
+
+The outer function is the function to which the enumerable is passed.
+Syntactically it looks like this is the consumer, but it's really a function
+that combines the producer and the consumer. For simple consumers (say `fn x,
+acc -> length(x) + acc end`) the consumer will often be written directly in the
+source text of the outer function, but let's try to keep those concepts
+distinguished.
+
+## Two issues with classic Elixir enumerators
+
+Enumerators are great, but they have their limitations. One issue is that it's
+not possible to define a function that only returns at most 3 elements without
+traversing all elements or using ugly tricks such as `throw` (with a
+`try...catch` construct in the outer function). The `throw` trick is used in
+`Enum` and `Stream` to implement functions such as `Enum.take/2` and
+`Stream.take_while/2`. It works, but it's not what I'd call stylish.
+
+A bigger problem, that doesn't have a workaround, is that there's no way to
+interleave two enumerables. That is, it's not possible to define a function that
+for two enumerables `A` and `B` returns a list `[A1, B1, A2, B2, A3, ...]`
+(where `A1` is the first element of A) without first traversing both lists and
+then interleaving the collected values. Interleaving is important because it's
+the basis of a zip function. Without interleaving you cannot implement
+`Stream.zip/2`.
+
+The underlying problem, in both cases, is that the producer is fully in control.
+The producer simply pushes out as many elements to the consumer as it wants and
+then says "I'm done". There's no way aside from `throw`/`raise` for a consumer
+to tell a producer "stop producing". There is definitely no way to tell a
+producer "stop for now but be prepared to continue where you left off later".
+
+## Power to the consumer!
+
+At CodeMeshIO José Valim and Jessica Kerr sat down and discussed this problem.
+They came up with a solution inspired by a [Monad.Reader
+article](http://themonadreader.files.wordpress.com/2010/05/issue16.pdf) (third
+article). It's an elegant extension of the old system, based on a simple idea.
+Instead of returning only an accumulator at every step (for every produced
+value) the consumer returns a combination of an accumulator and an instruction
+to the producer. Three instructions are available:
+
+* `:cont` - Keep producing.
+* `:halt` - Stop producing.
+* `:suspend` - Temporarily stop producing.
+
+A consumer that always returns `:cont` makes the producer behave exactly the
+same as in the old system. A consumer may return `:halt` to have the producer
+terminate earlier than it normally would.
+
+The real magic is in `:suspend` though. It tells a producer to return the
+accumulator and a continuation function. 
+
+```elixir
+{ :suspended, n_, cont } = Enumerable.reduce(1..5, { :cont, 0 }, fn x, n ->
+  if x == 3 do
+    { :suspend, n }
+  else
+    { :cont, n + x }
+  end
+end)
+```
+
+After running this code `n_` will be `3` (1 + 2) and `cont` will be a
+function. We'll get back to `cont` in a minute but first take a look at some of
+the new elements here. The initial accumulator has an instruction as well, so
+you could suspend or halt a producer immediately, if you really want to. The
+value passed to the consumer (`n`) does not contain the instruction. The return
+value of the producer also has a symbol in it. Like with the instructions of
+consumers there are three possible values:
+
+* `:done` - Completed normally.
+* `:halted` - Consumer returned a `:halt` instruction.
+* `:suspended` - Consumer return a `:suspend` instruction.
+
+Together with the other values returned the possible return values from a
+producer are `{ :done, acc } | { :halted, acc } | { :suspended, acc,
+continuation }`.
+
+Back to the continuation. A continuation is a function that given an accumulator
+returns a new producer result. In other words it's a way to swap out the
+accumulator but keep the same producer in the same state.
+
+## Implementing `interleave`
+
+Using the power of suspension it is now possible to create an interleave
+function.
+
+```elixir
+def interleave(a, b) do
+  step = fn x, acc -> [x|acc] end
+  af = &Enumerable.reduce(a, &1, step)
+  bf = &Enumerable.reduce(b, &1, step)
+  do_interleave(af, bf, []) |> :lists.reverse()
+end
+
+defp do_interleave(a, b, acc) do
+  case a.({ :cont, acc }) do
+    { :suspended, acc, a } ->
+      case b.({ :cont, acc }) do
+        { :suspended, acc, b } ->
+          do_interleave(a, b, acc)
+        { :done, acc } ->
+          # Get remainder of a's entries
+          { :done, acc } = a.({ :cont, acc }, fn x, acc -> [x|acc] end)
+          acc
+      end
+    { :done, acc } ->
+      { :done, acc } = b.({ :cont, acc }, fn x, acc -> [x|acc] end)
+      acc
+  end
+end
+```
+
+Lets go through this step by step. The main `interleave` function first
+partially applies `Enumerable.reduce/3` to get function values that work just
+like the continuations. This makes things easier for `do_interleave`.
+
+The `do_interleave` function first calls `a` (`af` from `interleave`) with the
+`step` function so that the available element of `a` gets added to the
+accumulator and `a` immediately suspends afterwards. Then the same is done for
+`b`. If either producer is done all the remaining elements of the other get
+added to the accumulator list.
+
+Note that `acc` is sometimes used to mean a tuple like `{ :cont, x }` and
+sometimes the accumulator value proper. It's a bit confusing, yes.
+
+This example shows that through clever combination of an outer function
+(`do_interleave`) and an inner function `step` two producers can be interleaved.
+
+## `Enum.reduce` and `Enumerable.reduce` are now slightly different
+
+In the old system `Enum.reduce/3` simply called `Enumerable.reduce/3` with the
+same arguments. In order to keep the `Enum.reduce/3` function simple to use this
+is no longer the case in the new system. `Enum.reduce/3` now calls
+`Enumerable.reduce/3`
+with a very simple wrapper around the passed function: `fn x, acc -> { :cont,
+f.(x, acc) } end`. Thus `Enum.reduce/3` works just as it has always done, it
+calls the supplied function for every produced element without the possibility
+of halting or suspending the producer.
+
+## Conclusion
+
+The new system of enumerators certainly makes things a bit more complicated but
+also adds power. I suspect many interesting and "interesting" functions can be
+built on top of it.

From 8affba4f6e4799674a86ace0a76b80b01dbad362 Mon Sep 17 00:00:00 2001
From: Steffen Bauer <steffen@wheezy>
Date: Thu, 12 Dec 2013 10:16:18 +0100
Subject: [PATCH 010/160] Added link to Elixir GtkSourceView

---
 _includes/important-links.html | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/_includes/important-links.html b/_includes/important-links.html
index ed9f35a05..69e53e5f0 100644
--- a/_includes/important-links.html
+++ b/_includes/important-links.html
@@ -25,7 +25,8 @@ <h3 class="widget-title">Code editor support</h3>
     <li><a class="spec" href="https://github.com/elixir-lang/emacs-elixir" target="_blank">Emacs Mode</a></li>
     <li><a class="spec" href="https://github.com/elixir-lang/elixir-tmbundle" target="_blank">Textmate Bundle</a></li>
     <li><a class="spec" href="https://github.com/elixir-lang/vim-elixir" target="_blank">Vim Elixir</a></li>
+    <li><a class="spec" href="https://github.com/SteffenBauer/elixir-gtksourceview" target="_blank">GtkSourceView (gedit)</a></li>
   </ul>
 </div>
 
-{% include sponsors.html %}
\ No newline at end of file
+{% include sponsors.html %}

From 3d76e737b767df3f89a54609c5a74e0a6794ca2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Thu, 12 Dec 2013 11:33:48 +0100
Subject: [PATCH 011/160] Remove the Enum.reduce and Enumerable.reduce section

Enum.reduce/3 will always be an abstraction around Enumerable.reduce/3.
---
 ...2-11-elixir-s-new-continuable-enumerators.markdown | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown b/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown
index 7ba92b8a1..c28ca78b5 100644
--- a/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown
+++ b/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown
@@ -191,17 +191,6 @@ sometimes the accumulator value proper. It's a bit confusing, yes.
 This example shows that through clever combination of an outer function
 (`do_interleave`) and an inner function `step` two producers can be interleaved.
 
-## `Enum.reduce` and `Enumerable.reduce` are now slightly different
-
-In the old system `Enum.reduce/3` simply called `Enumerable.reduce/3` with the
-same arguments. In order to keep the `Enum.reduce/3` function simple to use this
-is no longer the case in the new system. `Enum.reduce/3` now calls
-`Enumerable.reduce/3`
-with a very simple wrapper around the passed function: `fn x, acc -> { :cont,
-f.(x, acc) } end`. Thus `Enum.reduce/3` works just as it has always done, it
-calls the supplied function for every produced element without the possibility
-of halting or suspending the producer.
-
 ## Conclusion
 
 The new system of enumerators certainly makes things a bit more complicated but

From 860111bb1ba5769a641f1b00239e3c7dfd7e5fbb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Thu, 12 Dec 2013 17:24:28 +0100
Subject: [PATCH 012/160] Ensure interleave is passing suspend, add an example
 at the end

---
 ...xir-s-new-continuable-enumerators.markdown | 55 ++++++++++++-------
 1 file changed, 35 insertions(+), 20 deletions(-)

diff --git a/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown b/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown
index c28ca78b5..97b0f86de 100644
--- a/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown
+++ b/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown
@@ -150,29 +150,44 @@ Using the power of suspension it is now possible to create an interleave
 function.
 
 ```elixir
-def interleave(a, b) do
-  step = fn x, acc -> [x|acc] end
-  af = &Enumerable.reduce(a, &1, step)
-  bf = &Enumerable.reduce(b, &1, step)
-  do_interleave(af, bf, []) |> :lists.reverse()
-end
+defmodule Interleave do
+  def interleave(a, b) do
+    step = fn x, acc -> { :suspend, [x|acc] } end
+    af = &Enumerable.reduce(a, &1, step)
+    bf = &Enumerable.reduce(b, &1, step)
+    do_interleave(af, bf, []) |> :lists.reverse()
+  end
 
-defp do_interleave(a, b, acc) do
-  case a.({ :cont, acc }) do
-    { :suspended, acc, a } ->
-      case b.({ :cont, acc }) do
-        { :suspended, acc, b } ->
-          do_interleave(a, b, acc)
-        { :done, acc } ->
-          # Get remainder of a's entries
-          { :done, acc } = a.({ :cont, acc }, fn x, acc -> [x|acc] end)
-          acc
-      end
-    { :done, acc } ->
-      { :done, acc } = b.({ :cont, acc }, fn x, acc -> [x|acc] end)
-      acc
+  defp do_interleave(a, b, acc) do
+    case a.({ :cont, acc }) do
+      { :suspended, acc, a } ->
+        case b.({ :cont, acc }) do
+          { :suspended, acc, b } ->
+            do_interleave(a, b, acc)
+          { :halt, acc } ->
+            acc
+          { :done, acc } ->
+            finish_interleave(a, acc)
+        end
+      { :halt, acc } ->
+        acc
+      { :done, acc } ->
+        finish_interleave(b, acc)
+    end
+  end
+
+  defp finish_interleave(a_or_b, acc) do
+    case a_or_b.({ :cont, acc }) do
+      { :suspended, acc, a_or_b } ->
+        finish_interleave(a_or_b, acc)
+      { _, acc } ->
+        acc
+    end
   end
 end
+
+Interleave.interleave([1,2], [:a, :b, :c, :d])
+#=> [1, :a, 2, :b, :c, :d]
 ```
 
 Lets go through this step by step. The main `interleave` function first

From fbe92d594fda5f768b4c229f107ec7e1abd4ac01 Mon Sep 17 00:00:00 2001
From: Takayuki Matsubara <takayuki.1229@gmail.com>
Date: Wed, 18 Dec 2013 21:47:34 +0900
Subject: [PATCH 013/160] remove `.git` suffix

---
 getting_started/mix/1.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/mix/1.markdown b/getting_started/mix/1.markdown
index dcf4fb6fd..6652ffe5b 100644
--- a/getting_started/mix/1.markdown
+++ b/getting_started/mix/1.markdown
@@ -63,7 +63,7 @@ defmodule MyProject.Mixfile do
   # { :foobar, git: "https://github.com/elixir-lang/foobar.git", tag: "0.1" }
   #
   # To specify particular versions, regardless of the tag, do:
-  # { :barbat, "~> 0.1", github: "elixir-lang/barbat.git" }
+  # { :barbat, "~> 0.1", github: "elixir-lang/barbat" }
   defp deps do
     []
   end

From 28e6079f645d6fc584e09b9bb002898dd2f690c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Thu, 19 Dec 2013 09:38:32 +0100
Subject: [PATCH 014/160] v0.12.0 blog post

---
 _includes/search.html                         |  2 +-
 ...013-12-15-elixir-v0-12-0-released.markdown | 52 +++++++++++++++++++
 2 files changed, 53 insertions(+), 1 deletion(-)
 create mode 100644 _posts/2013-12-15-elixir-v0-12-0-released.markdown

diff --git a/_includes/search.html b/_includes/search.html
index 494a341ae..3bd4fe69d 100644
--- a/_includes/search.html
+++ b/_includes/search.html
@@ -1,6 +1,6 @@
 <div class="widget news">
   <h3>
-    News: <a href="/blog/2013/11/05/elixir-v0-11-0-released/">Elixir v0.11.0 released</a>
+    News: <a href="/blog/2013/12/15/elixir-v0-12-0-released/">Elixir v0.12.0 released</a>
   </h3>
 </div>
 
diff --git a/_posts/2013-12-15-elixir-v0-12-0-released.markdown b/_posts/2013-12-15-elixir-v0-12-0-released.markdown
new file mode 100644
index 000000000..403f27819
--- /dev/null
+++ b/_posts/2013-12-15-elixir-v0-12-0-released.markdown
@@ -0,0 +1,52 @@
+---
+layout: post
+title: Elixir v0.12.0 released
+author: José Valim
+category: Releases
+excerpt: Elixir v0.12.0 is out with improved enumerables, build patterns and welcoming a new member to our team
+---
+
+Elixir v0.12.0 has been released with improved enumerables, build patterns and welcoming a new member to our team.
+
+## Enumerables
+
+In previous versions, the Enumerable protocol was based on reduce/fold, and while it is very efficient for operations like `map`, `reduce` and `filter`, it was sub-optimal for operations that need to halt, like `take` and `take_while`, and it made it impossible for operations like `zip` to be implemented. 
+
+In v0.12.0, Elixir's Enumerable protocol has been extended to allow suspension and halting mechanisms, making operations like `take` simpler and operations that require interleaving, like `zip`, possible.
+
+Although most users don't need to concern with the implementation of the Enumerable protocol, the side-effect is that both `Enum` and `Stream` modules have been considerably extended and improved in this release, with more than 15 new functions added to the `Stream` module.
+
+## Mix
+
+The tool that received most improvements in this release was Mix. The biggest change is that Mix no longer compiles projects in place but to the `_build` directory. For example, take the [Ecto project](https://github.com/elixir-lang/ecto) that [depends on `postgrex` and `poolboy`](https://github.com/elixir-lang/ecto/blob/master/mix.exs#L24-L25). When compiled, all the artifacts will be placed in the `_build` directory like this:
+
+```
+_build
+└── shared
+    └── lib
+        ├── ecto
+        │   └── ebin
+        |   └── priv
+        ├── poolboy
+        │   └── ebin
+        └── postgrex
+            └── ebin
+```
+
+For those familiar with Erlang's OTP, this is similar to the structure used by OTP when releasing your software. So this new structure makes our software one step close to production and guarantee it is designed correctly since day 1.
+
+This approach comes with the `:build_per_environment` option which, when set to true, creates a different build per environment (`dev`, `test`, `production` or more). Extremely useful when a project compile different artifacts depending on the compilation environment.
+
+Mix has also added support to optional dependencies and improved common patterns, like the usage of umbrella apps.
+
+## Welcome, Eric!
+
+With this release, we also want to welcome [Eric MJ](https://github.com/ericmj) to the Elixir Team. He has done a fantastic work on Elixir so far, helping us maintain the codebase and working on many of the important features from previous releases.
+
+Eric is also maintainer of both [Ecto](https://github.com/elixir-lang/ecto) and [Postgrex](https://github.com/ericmj/postgrex) projects. Which are proving to be very useful to the Elixir community too!
+
+## Tidying up
+
+There were other small changes, like additions to the `Float` module and improvements the to the typespec syntax. To see the full list, please [see the CHANGELOG](https://github.com/elixir-lang/elixir/blob/v0.12.0/CHANGELOG.md).
+
+Give Elixir a try! You can start with our [getting started guide](http://elixir-lang.org/getting_started/1.html), or check out our sidebar for other learning resources.

From 4d23e0d77645e4f7f23db9187d26d4e5c9b46602 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Thu, 19 Dec 2013 19:44:34 +0100
Subject: [PATCH 015/160] Update 2013-12-15-elixir-v0-12-0-released.markdown

---
 _posts/2013-12-15-elixir-v0-12-0-released.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/_posts/2013-12-15-elixir-v0-12-0-released.markdown b/_posts/2013-12-15-elixir-v0-12-0-released.markdown
index 403f27819..200a4a5cf 100644
--- a/_posts/2013-12-15-elixir-v0-12-0-released.markdown
+++ b/_posts/2013-12-15-elixir-v0-12-0-released.markdown
@@ -41,7 +41,7 @@ Mix has also added support to optional dependencies and improved common patterns
 
 ## Welcome, Eric!
 
-With this release, we also want to welcome [Eric MJ](https://github.com/ericmj) to the Elixir Team. He has done a fantastic work on Elixir so far, helping us maintain the codebase and working on many of the important features from previous releases.
+With this release, we also want to welcome [Eric MJ](https://github.com/ericmj) to the Elixir Team. He has done fantastic work on Elixir, helping us maintain the codebase and working on many of the important features from previous releases and now many more to come.
 
 Eric is also maintainer of both [Ecto](https://github.com/elixir-lang/ecto) and [Postgrex](https://github.com/ericmj/postgrex) projects. Which are proving to be very useful to the Elixir community too!
 

From 6fa7ed1996779aac649078e5e36b1742043d0f7e Mon Sep 17 00:00:00 2001
From: Yuki Ito <yuki@gnnk.net>
Date: Sun, 22 Dec 2013 18:09:47 +0900
Subject: [PATCH 016/160] Fix interleave example

---
 .../2013-12-11-elixir-s-new-continuable-enumerators.markdown  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown b/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown
index 97b0f86de..970004c39 100644
--- a/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown
+++ b/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown
@@ -164,12 +164,12 @@ defmodule Interleave do
         case b.({ :cont, acc }) do
           { :suspended, acc, b } ->
             do_interleave(a, b, acc)
-          { :halt, acc } ->
+          { :halted, acc } ->
             acc
           { :done, acc } ->
             finish_interleave(a, acc)
         end
-      { :halt, acc } ->
+      { :halted, acc } ->
         acc
       { :done, acc } ->
         finish_interleave(b, acc)

From af8cf4c9350c961bcb99b8821da2389aec7843a7 Mon Sep 17 00:00:00 2001
From: Ryan Coppolo <r@coppolo.com>
Date: Thu, 16 Jan 2014 14:38:56 -0800
Subject: [PATCH 017/160] Update crash course w/ send for messages instead of
 deprecated <-

---
 crash-course.markdown | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/crash-course.markdown b/crash-course.markdown
index d9fc22a1b..ead267f96 100644
--- a/crash-course.markdown
+++ b/crash-course.markdown
@@ -101,7 +101,6 @@ Some operators are spelled differently.
     | =/=            | !==            | A negative match                        |
     | /=             | !=             | Not equals                              |
     | =<             | <=             | Less than or equals                     |
-    | !              | <-             | Send messages                           |
 
 
 ### Delimiters
@@ -815,7 +814,7 @@ end.
 ```elixir
 pid = Kernel.self
 
-pid <- { :hello }
+send pid, { :hello }
 
 receive do
   { :hello } -> :ok

From f95e1798534112f2e8a4e86a7ece518628e46918 Mon Sep 17 00:00:00 2001
From: Josh Adams <josh@isotope11.com>
Date: Fri, 27 Dec 2013 09:08:31 -0600
Subject: [PATCH 018/160] Add a post on XML Parsing with an ElixirSips episode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
---
 ...013-12-27-parsing-xml-with-elixir.markdown | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 _posts/2013-12-27-parsing-xml-with-elixir.markdown

diff --git a/_posts/2013-12-27-parsing-xml-with-elixir.markdown b/_posts/2013-12-27-parsing-xml-with-elixir.markdown
new file mode 100644
index 000000000..61488ab3a
--- /dev/null
+++ b/_posts/2013-12-27-parsing-xml-with-elixir.markdown
@@ -0,0 +1,24 @@
+---
+layout: post
+title: Parsing XML With Elixir
+author: Josh Adams
+category: examples
+excerpt: An example of interoperating with Erlang's built-in `xmerl` library to parse XML.
+---
+
+In the latest free video, [ElixirSips](http://www.elixirsips.com) [Episode
+028](http://elixirsips.com/episodes/028_parsing_xml.html) provides an example of
+parsing XML via the built in `xmerl` library in Erlang.
+
+<iframe src="//fast.wistia.net/embed/iframe/pi407o195d" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="640" height="360"></iframe>
+
+[Here is the project built in this episode, for you to download.](http://elixirsips.com/downloads/028_parsing_xml.tar.gz)
+
+## Resources
+- [xmerl user guide](http://www.erlang.org/doc/apps/xmerl/xmerl_ug.html)
+- [xmerl manual](http://www.erlang.org/doc/man/xmerl_scan.html)
+- [erlsom](https://github.com/willemdj/erlsom)
+- [exml](https://github.com/paulgray/exml)
+- [Differences between Erlang and Elixir records](http://elixir-lang.org/crash-course.html#notable_differences) - See the 'Records' section.
+- [Dave Thomas on parsing XML in Erlang](http://pragdave.pragprog.com/pragdave/2007/04/a_first_erlang_.html)
+- [`xmlElement` record](https://github.com/erlang/otp/blob/maint/lib/xmerl/include/xmerl.hrl#L73-L85)

From d23cc15d00680c5ed2931d435e3387094ec486a2 Mon Sep 17 00:00:00 2001
From: Josh Adams <josh@isotope11.com>
Date: Tue, 7 Jan 2014 09:35:57 -0600
Subject: [PATCH 019/160] Add some code to the xml post, so it's not just a
 video embed
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
---
 ...013-12-27-parsing-xml-with-elixir.markdown | 58 +++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/_posts/2013-12-27-parsing-xml-with-elixir.markdown b/_posts/2013-12-27-parsing-xml-with-elixir.markdown
index 61488ab3a..78643baed 100644
--- a/_posts/2013-12-27-parsing-xml-with-elixir.markdown
+++ b/_posts/2013-12-27-parsing-xml-with-elixir.markdown
@@ -14,6 +14,64 @@ parsing XML via the built in `xmerl` library in Erlang.
 
 [Here is the project built in this episode, for you to download.](http://elixirsips.com/downloads/028_parsing_xml.tar.gz)
 
+You can watch the video for a complete rundown where we use tests to explore the
+`xmerl` library and how we can use it from Elixir.  If you just want to see the
+results, here's the test file we ended up with, commented for clarity:
+
+```elixir
+# If you want to pattern-match on a record defined in an erlang library, you
+# need to use Record.extract to turn it into an Elixir record data structure.
+# Here, we extract xmlElement and xmlText from xmerl.
+defrecord :xmlElement, Record.extract(:xmlElement, from_lib: "xmerl/include/xmerl.hrl")
+defrecord :xmlText, Record.extract(:xmlText, from_lib: "xmerl/include/xmerl.hrl")
+
+defmodule XmlParsingTest do
+  use ExUnit.Case
+
+  # Here we define some simple XML that we'll work with in our tests.
+  def sample_xml do
+    """
+    <html>
+      <head>
+        <title>XML Parsing</title>
+      </head>
+      <body>
+        <p>Neato</p>
+        <ul>
+          <li>First</li>
+          <li>Second</li>
+        </ul>
+      </body>
+    </html>
+    """
+  end
+
+  test "parsing the title out" do
+    { xml, _rest } = :xmerl_scan.string(bitstring_to_list(sample_xml))
+    [ title_element ] = :xmerl_xpath.string('/html/head/title', xml)
+    [ title_text ] = title_element.content
+    title = title_text.value
+
+    assert title == 'XML Parsing'
+  end
+
+  test "parsing the p tag" do
+    { xml, _rest } = :xmerl_scan.string(bitstring_to_list(sample_xml))
+    [ p_text ] = :xmerl_xpath.string('/html/body/p/text()', xml)
+
+    assert p_text.value == 'Neato'
+  end
+
+  test "parsing the li tags and mapping them" do
+    { xml, _rest } = :xmerl_scan.string(bitstring_to_list(sample_xml))
+    li_texts = :xmerl_xpath.string('/html/body/ul/li/text()', xml)
+    texts = li_texts |> Enum.map(fn(x) -> x.value end)
+
+    assert texts == ['First', 'Second']
+  end
+end
+```
+
 ## Resources
 - [xmerl user guide](http://www.erlang.org/doc/apps/xmerl/xmerl_ug.html)
 - [xmerl manual](http://www.erlang.org/doc/man/xmerl_scan.html)

From 8e527448d15985c2ed5096ffbfaccb280a9358cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Mon, 20 Jan 2014 14:38:26 +0100
Subject: [PATCH 020/160] Tidy up episode's post

---
 ...013-12-27-parsing-xml-with-elixir.markdown | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/_posts/2013-12-27-parsing-xml-with-elixir.markdown b/_posts/2013-12-27-parsing-xml-with-elixir.markdown
index 78643baed..c73d63867 100644
--- a/_posts/2013-12-27-parsing-xml-with-elixir.markdown
+++ b/_posts/2013-12-27-parsing-xml-with-elixir.markdown
@@ -6,17 +6,16 @@ category: examples
 excerpt: An example of interoperating with Erlang's built-in `xmerl` library to parse XML.
 ---
 
-In the latest free video, [ElixirSips](http://www.elixirsips.com) [Episode
-028](http://elixirsips.com/episodes/028_parsing_xml.html) provides an example of
-parsing XML via the built in `xmerl` library in Erlang.
+One of the latest episodes of [ElixirSips](http://elixirsips.com/episodes/028_parsing_xml.html)
+provided an example of parsing XML via the built in `xmerl` library in Erlang:
 
 <iframe src="//fast.wistia.net/embed/iframe/pi407o195d" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="640" height="360"></iframe>
 
-[Here is the project built in this episode, for you to download.](http://elixirsips.com/downloads/028_parsing_xml.tar.gz)
-
-You can watch the video for a complete rundown where we use tests to explore the
-`xmerl` library and how we can use it from Elixir.  If you just want to see the
-results, here's the test file we ended up with, commented for clarity:
+Parsing XML is a common need to different applications. The example also show cases
+how to integrate with existing Erlang libraries. You can watch the video for a complete
+rundown where we use tests to explore the `xmerl` library and how we can use it from
+Elixir. If you just want to see the results, here's the test file we ended up with,
+commented for clarity:
 
 ```elixir
 # If you want to pattern-match on a record defined in an erlang library, you
@@ -72,7 +71,11 @@ defmodule XmlParsingTest do
 end
 ```
 
+The project built in the episode is also
+[available for download](http://elixirsips.com/downloads/028_parsing_xml.tar.gz).
+
 ## Resources
+
 - [xmerl user guide](http://www.erlang.org/doc/apps/xmerl/xmerl_ug.html)
 - [xmerl manual](http://www.erlang.org/doc/man/xmerl_scan.html)
 - [erlsom](https://github.com/willemdj/erlsom)

From 90a5cbd2ad6a8f62c4a73aef228bb1735f64e0da Mon Sep 17 00:00:00 2001
From: sasa1977 <sasa.juric@gmail.com>
Date: Mon, 20 Jan 2014 20:38:04 +0100
Subject: [PATCH 021/160] Elixir in Action link

---
 _includes/learning-resources.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/_includes/learning-resources.html b/_includes/learning-resources.html
index 17e8d55f7..7471ced0c 100644
--- a/_includes/learning-resources.html
+++ b/_includes/learning-resources.html
@@ -4,5 +4,6 @@ <h3 class="widget-title">Learning resources</h3>
     <li class="image"><a href="http://pragprog.com/titles/elixir" target="_blank" title="Programming Elixir cover"><img src="http://imagery.pragprog.com/products/361/elixir_xlargebeta.jpg?1368724397" /></a></li>
     <li class="image"><a href="https://peepcode.com/products/elixir" target="_blank" title="PeepCode Meet Elixir cover"><img src="https://peepcode.com/system/uploads/2013/peepcode-elixir-lang-cover.jpg" width="190" height="228" /></a></li>
     <li class="image"><a href="http://elixirsips.com" target="_blank" title="ElixirSips cover"><img src="http://elixirsips.com/images/ElixirLangAd2_190x160.png" width="190" height="160" /></a></li>
+    <li class="image"><a href="http://manning.com/juric/" target="_blank" title="Elixir in Action"><img src="http://manning.com/juric/juric_cover150.jpg" width="190" height="238" /></a></li>
   </ul>
 </div>

From 63edfcd2699fad738da414ea902f070e2170a8a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Tue, 21 Jan 2014 12:26:07 +0100
Subject: [PATCH 022/160] Update learning resources

---
 _includes/learning-resources.html | 1 -
 1 file changed, 1 deletion(-)

diff --git a/_includes/learning-resources.html b/_includes/learning-resources.html
index 7471ced0c..a30c82f1f 100644
--- a/_includes/learning-resources.html
+++ b/_includes/learning-resources.html
@@ -2,7 +2,6 @@
   <h3 class="widget-title">Learning resources</h3>
   <ul>
     <li class="image"><a href="http://pragprog.com/titles/elixir" target="_blank" title="Programming Elixir cover"><img src="http://imagery.pragprog.com/products/361/elixir_xlargebeta.jpg?1368724397" /></a></li>
-    <li class="image"><a href="https://peepcode.com/products/elixir" target="_blank" title="PeepCode Meet Elixir cover"><img src="https://peepcode.com/system/uploads/2013/peepcode-elixir-lang-cover.jpg" width="190" height="228" /></a></li>
     <li class="image"><a href="http://elixirsips.com" target="_blank" title="ElixirSips cover"><img src="http://elixirsips.com/images/ElixirLangAd2_190x160.png" width="190" height="160" /></a></li>
     <li class="image"><a href="http://manning.com/juric/" target="_blank" title="Elixir in Action"><img src="http://manning.com/juric/juric_cover150.jpg" width="190" height="238" /></a></li>
   </ul>

From 4264427ce1e42a66393dfd01b2ea80d3016c7999 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sat, 25 Jan 2014 19:52:10 +0100
Subject: [PATCH 023/160] Fix remaining usage of <-

---
 getting_started/2.markdown | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index fe02223aa..95590e948 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -512,7 +512,7 @@ x #=> 1
 
 This next control-flow mechanism is essential to Elixir's actors. In Elixir, the code is run in separate processes that exchange messages between them. Those processes are not Operating System processes (they are actually quite light-weight) but are called so since they do not share state with each other.
 
-In order to exchange messages, each process has a mailbox where the received messages are stored. The `receive` mechanism allows us to go through this mailbox searching for a message that matches the given pattern. Here is an example that uses the arrow operator `<-` to send a message to the current process and then collects this message from its mailbox:
+In order to exchange messages, each process has a mailbox where the received messages are stored. The `receive` mechanism allows us to go through this mailbox searching for a message that matches the given pattern. Here is an example that uses the `send/2` function to send a message to the current process and then collects this message from its mailbox:
 
 ```iex
 # Get the current process id
@@ -520,7 +520,7 @@ iex> current_pid = self
 
 # Spawn another process that will send a message to current_pid
 iex> spawn fn ->
-  current_pid <- { :hello, self }
+  send current_pid, { :hello, self }
 end
 <0.36.0>
 

From fdbe84d445f6436883ca98d69fcea87c388e0f7c Mon Sep 17 00:00:00 2001
From: travishoyt <travis@beachbumstudio.com>
Date: Mon, 27 Jan 2014 19:12:26 -0500
Subject: [PATCH 024/160] Update md to correct set_elem typo

set_elem was written as setelem.
---
 crash-course.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crash-course.markdown b/crash-course.markdown
index ead267f96..2310d65ae 100644
--- a/crash-course.markdown
+++ b/crash-course.markdown
@@ -260,7 +260,7 @@ setelement(1, { a, b, c }, d) %=> { d, b, c }
 
 ```elixir
 elem({ :a, :b, :c }, 0)        #=> :a
-setelem({ :a, :b, :c }, 0, :d) #=> { :d, :b, :c }
+set_elem({ :a, :b, :c }, 0, :d) #=> { :d, :b, :c }
 ```
 
 ### Lists and Binaries

From f6aa6e9317c200d5720ab1d530ce39e5be48652d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Mon, 3 Feb 2014 11:05:37 +0100
Subject: [PATCH 025/160] Link to Riak great tutorial for installing Erlang

---
 getting_started/1.markdown | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/getting_started/1.markdown b/getting_started/1.markdown
index f4e711fca..e8a209ac7 100644
--- a/getting_started/1.markdown
+++ b/getting_started/1.markdown
@@ -17,9 +17,9 @@ Keep in mind that Elixir is still in development, so if at any point you receive
 
 ## 1.1 Installation
 
-The only prerequisite for Elixir is Erlang, version R16B or later. You can find the source code for [Erlang here](http://www.erlang.org/download.html) or use one of the [precompiled packages](https://www.erlang-solutions.com/downloads/download-erlang-otp).
+The only prerequisite for Elixir is Erlang, version R16B or later, which can be easily installed with [Precompiled packages](https://www.erlang-solutions.com/downloads/download-erlang-otp). In case you want to install it directly from source, it can be found on [the Erlang website](http://www.erlang.org/download.html) or by following the excellent tutorial available in the [Riak documentation](http://docs.basho.com/riak/1.3.0/tutorials/installation/Installing-Erlang/).
 
-For Windows developers, we recommend the precompiled package. Those on a UNIX platform can probably get Erlang installed via one of the many package management tools.
+For Windows developers, we recommend the precompiled packages. Those on a UNIX platform can probably get Erlang installed via one of the many package management tools.
 
 After Erlang is installed, you should be able to open up the command line (or command prompt) and check the Erlang version by typing `erl`. You will see some information as follows:
 
@@ -50,9 +50,13 @@ This tutorial requires Elixir v0.10.2 or later and it may be available in some d
 
 If you don't use any of the distributions above, don't worry, we also provide a precompiled package!
 
-### 1.1.2 Compiling from source (Unix and MinGW)
+### 1.1.2 Precompiled package
 
-You can download and compile Elixir in few steps. You can get the [latest stable release here](https://github.com/elixir-lang/elixir/tags), unpack it and then run `make` inside the unpacked directory. After that, you are ready to run the `elixir` and `iex` commands from the `bin` directory. It is recommended that you add Elixir's `bin` path to your PATH environment variable to ease development:
+Elixir provides a [precompiled package for every release](https://github.com/elixir-lang/elixir/releases/). After downloading and unzip-ing the package, you are ready to run the `elixir` and `iex` commands from the `bin` directory. It is recommended that you also add Elixir's `bin` path to your PATH environment variable to ease development.
+
+### 1.1.3 Compiling from source (Unix and MinGW)
+
+You can download and compile Elixir in few steps. You can get the [latest stable release here](https://github.com/elixir-lang/elixir/releases/), unpack it and then run `make` inside the unpacked directory. After that, you are ready to run the `elixir` and `iex` commands from the `bin` directory. It is recommended that you add Elixir's `bin` path to your PATH environment variable to ease development:
 
     $ export PATH="$PATH:/path/to/elixir/bin"
 
@@ -64,12 +68,6 @@ In case you are feeling a bit more adventurous, you can also compile from master
 
 If the tests pass, you are ready to go. Otherwise, feel free to open an issue [in the issues tracker on Github](https://github.com/elixir-lang/elixir).
 
-### 1.1.3 Precompiled package
-
-Elixir provides a [precompiled package for every release](https://github.com/elixir-lang/elixir/releases/). Precompiled packages are the best option if you are developing on Windows.
-
-After downloading and unzip-ing the package, you are ready to run the `elixir` and `iex` commands from the `bin` directory. It is recommended that you also add Elixir's `bin` path to your PATH environment variable to ease development.
-
 ## 1.2 Interactive mode
 
 When you install Elixir, you will have three new executables: `iex`, `elixir` and `elixirc`. If you compiled Elixir from source or are using a packaged version, you can find these inside the `bin` directory.

From 0566314316686ce8195c3ee110e14dfa21597ca6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eric=20Meadows-J=C3=B6nsson?=
 <eric.meadows.jonsson@gmail.com>
Date: Fri, 7 Feb 2014 22:01:46 +0100
Subject: [PATCH 026/160] Remove `@only` section from guide

Closes #189.
---
 getting_started/4.markdown | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/getting_started/4.markdown b/getting_started/4.markdown
index 20c78876e..516fd57b3 100644
--- a/getting_started/4.markdown
+++ b/getting_started/4.markdown
@@ -87,7 +87,7 @@ For more information on records, [check out the documentation for the `defrecord
 
 ## 4.2 Protocols
 
-Protocols are a mechanism to achieve polymorphism in Elixir. Dispatching a protocol is available to any data type as long as it implements the protocol. Let's consider a practical example.
+Protocols are a mechanism to achieve polymorphism in Elixir. Dispatching on a protocol is available to any data type as long as it implements the protocol. Lets consider a practical example.
 
 In Elixir, only `false` and `nil` are treated as false. Everything else evaluates to true. Depending on the application, it may be important to specify a `blank?` protocol that returns a boolean for other data types that should be considered blank. For instance, an empty list or an empty binary could be considered blanks.
 
@@ -174,7 +174,7 @@ Now all data types that we have not implemented the `Blank` protocol for will be
 
 ### 4.2.2 Using protocols with records
 
-The power of Elixir extensibility comes when protocols and records are mixed.
+The power of Elixir's extensibility comes when protocols and records are mixed.
 
 For instance, Elixir provides a `HashDict` implementation that is an efficient data structure to store many keys. Let's take a look at how it works:
 
@@ -207,13 +207,7 @@ Blank.blank?(dict)         #=> false
 Blank.blank?(HashDict.new) #=> true
 ```
 
-Excellent! The best of all is that we implemented the `Blank` protocol for an existing data structure (`HashDict`) without a need to wrap it or recompile it, which allows developers to easily extend previously defined protocols. Note this only worked because, when we defined the protocol, we have added `Record` to the list of types supported by the protocol:
-
-```elixir
-@only [Atom, Record, Tuple, List, BitString, Any]
-```
-
-Keep in mind that `Record` needs to come before `Tuple`, since all records are tuples (but not all tuples are records).  For this reason, in case a record does not implement a given protocol, Elixir will fall back to the tuple implementation of that protocol if one exists. So one can add a default protocol implementation for all records by simply defining a default implementation for tuples.
+Excellent! The best of all is that we implemented the `Blank` protocol for an existing data structure (`HashDict`) without a need to wrap it or recompile it, which allows developers to easily extend previously defined protocols.
 
 ### 4.2.3 Built-in protocols
 

From 819c5cefe4fd1651bdc128dfa4a56add9715c092 Mon Sep 17 00:00:00 2001
From: Peter Zsoldos <peter.zsoldos@gmail.com>
Date: Fri, 7 Feb 2014 22:17:47 +0100
Subject: [PATCH 027/160] emphasize that Inspect.inspect return values starting
 with '#' are not enforced

and that it's the responsibility of the data structure author to follow this convention
---
 getting_started/4.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/4.markdown b/getting_started/4.markdown
index 516fd57b3..ba5cc69eb 100644
--- a/getting_started/4.markdown
+++ b/getting_started/4.markdown
@@ -242,7 +242,7 @@ iex> HashDict.new
 #HashDict<[]>
 ```
 
-  Keep in mind that whenever the inspected value starts with `#`, it is representing a data structure in non-valid Elixir syntax. For those, the true representation can be retrieved by calling `inspect` directly and passing `raw` as an option:
+  Keep in mind that, by convention, whenever the inspected value starts with `#`, it is representing a data structure in non-valid Elixir syntax. For those, the true representation can be retrieved by calling `inspect` directly and passing `raw` as an option:
 
 ```iex
 iex> inspect HashDict.new, raw: true

From 2a996b7666544c53b414166a0b9eb4ad6de2e7e5 Mon Sep 17 00:00:00 2001
From: Peter Zsoldos <peter.zsoldos@gmail.com>
Date: Sat, 8 Feb 2014 14:52:29 +0100
Subject: [PATCH 028/160] generate linkable id attribtues for <hN> tags

So that they can be linked to for easier sharing (as described in by @ericmj in #157 https://github.com/elixir-lang/elixir-lang.github.com/pull/157#issuecomment-24446351)

This change only ensures that text-independent id attributes are generated in the HTML, the usability aspects (like the on-hover copyable link that github repo pages have) are not included.

Tested on Xubuntu 13.04 with

$ sudo apt-get install ruby1.9.3
$ sudo gem1.9.3 install github-pages
$ cd ~/3rdparty/elixir-lang.github.com/
$ vim _config.yml
$ git diff
diff --git a/_config.yml b/_config.yml
index 18d7dd5..78201b0 100644
--- a/_config.yml
+++ b/_config.yml
@@ -1,3 +1,5 @@
 markdown: redcarpet
 pygments: true
 permalink: /blog/:year/:month/:day/:title
+redcarpet:
+  extensions: ['with_toc_data']
$ jekyll serve --safe
---
 _config.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/_config.yml b/_config.yml
index 18d7dd5ab..78201b070 100644
--- a/_config.yml
+++ b/_config.yml
@@ -1,3 +1,5 @@
 markdown: redcarpet
 pygments: true
 permalink: /blog/:year/:month/:day/:title
+redcarpet:
+  extensions: ['with_toc_data']

From 7cd4c1c4302e0d2ca9a96a086295ee8138b90251 Mon Sep 17 00:00:00 2001
From: John Warwick <jwarwick@gmail.com>
Date: Sat, 8 Feb 2014 21:33:14 -0500
Subject: [PATCH 029/160] Updating sigil marker from % -> ~. Didn't update
 'whats new' posts.

---
 crash-course.markdown      |  4 ++--
 getting_started/6.markdown | 20 ++++++++++----------
 index.html                 |  2 +-
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/crash-course.markdown b/crash-course.markdown
index 2310d65ae..e716620cc 100644
--- a/crash-course.markdown
+++ b/crash-course.markdown
@@ -312,14 +312,14 @@ re:run("abc ", Pattern).
 **Elixir**
 
 ```elixir
-Regex.run %r/abc\s/, "abc "
+Regex.run ~r/abc\s/, "abc "
 #=> ["abc "]
 ```
 
 Regexes are also supported in heredocs, which is convenient when defining multiline regexes:
 
 ```elixir
-is_regex %r"""
+is_regex ~r"""
 This is a regex
 spawning several
 lines.
diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index f4a81ac00..7399c2b7f 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -11,27 +11,27 @@ This chapter contains different small topics that are part of Elixir's day to da
 
 ## 6.1 String sigils
 
-Elixir provides string sigils via the token `%`:
+Elixir provides string sigils via the token `~`:
 
 ```elixir
-%s(String with escape codes \x26 interpolation)
-%S(String without escape codes and without #{interpolation})
+~s(String with escape codes \x26 interpolation)
+~S(String without escape codes and without #{interpolation})
 ```
 
 Sigils starting with an uppercase letter never escape characters or do interpolation. Notice the separators are not necessarily parenthesis, but any non-alphanumeric character:
 
 ```elixir
-%s-another string-
+~s-another string-
 ```
 
-Internally, `%s` is translated as a call to `sigil_s`. For instance, the docs for `%s` are available in the macro [`sigil_s/2`](/docs/stable/Kernel.html#sigil_s/2) defined in `Kernel` module.
+Internally, `~s` is translated as a call to `sigil_s`. For instance, the docs for `~s` are available in the macro [`sigil_s/2`](/docs/stable/Kernel.html#sigil_s/2) defined in the `Kernel` module.
 
 The sigils defined in Elixir by default are:
 
-* `%c` and `%C` - Returns a char list;
-* `%r` and `%R` - Returns a regular expression;
-* `%s` and `%S` - Returns a string;
-* `%w` and `%W` - Returns a list of "words" split by whitespace;
+* `~c` and `~C` - Returns a char list;
+* `~r` and `~R` - Returns a regular expression;
+* `~s` and `~S` - Returns a string;
+* `~w` and `~W` - Returns a list of "words" split by whitespace;
 
 ## 6.2 Heredocs
 
@@ -58,7 +58,7 @@ String heredocs in Elixir use """
 Notice the sigils discussed in the previous section are also available as heredocs:
 
 ```elixir
-%S"""
+~S"""
 A heredoc without escaping or interpolation
 """
 ```
diff --git a/index.html b/index.html
index 40a89d256..da9c0aebe 100644
--- a/index.html
+++ b/index.html
@@ -82,7 +82,7 @@ <h4>Polymorphism via protocols</h4>
 
 {% highlight elixir %}
 file  = File.stream!("README.md")
-lines = Enum.map(file, fn(line) -> Regex.replace(%r/"/, line, "'") end)
+lines = Enum.map(file, fn(line) -> Regex.replace(~r/"/, line, "'") end)
 File.write("README.md", lines)
 {% endhighlight %}
     </div>

From 70e06e6b56d0bfedbbb90256c056d6aa51d85100 Mon Sep 17 00:00:00 2001
From: John Warwick <jwarwick@gmail.com>
Date: Sat, 8 Feb 2014 21:34:41 -0500
Subject: [PATCH 030/160] Removing references to __FILE__

---
 getting_started/6.markdown | 1 -
 1 file changed, 1 deletion(-)

diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index 7399c2b7f..b9560b407 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -287,7 +287,6 @@ iex> bc <<c>> inbits " hello world ", c != ?\s, do: <<c>>
 Elixir provides a set of pseudo-variables. These variables can only be read and never assigned to. They are:
 
 * `__MODULE__` - Returns an atom representing the current module or nil;
-* `__FILE__` - Returns a string representing the current file;
 * `__DIR__` - Returns a string representing the current directory;
 * `__ENV__` - Returns a [Macro.Env](/docs/stable/Macro.Env.html) record with information about the compilation environment. Here we can access the current module, function, line, file and others;
 * `__CALLER__` - Also returns a [Macro.Env](/docs/stable/Macro.Env.html) record but with information of the calling site. `__CALLER__` is available only inside macros;

From 3706929e74f2b3a7f6a692a1bcb16c54171bfdb9 Mon Sep 17 00:00:00 2001
From: John Warwick <jwarwick@gmail.com>
Date: Sat, 8 Feb 2014 21:40:37 -0500
Subject: [PATCH 031/160] Updating default argument operator

---
 crash-course.markdown      | 2 +-
 getting_started/3.markdown | 8 ++++----
 getting_started/6.markdown | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/crash-course.markdown b/crash-course.markdown
index e716620cc..340c2cf6a 100644
--- a/crash-course.markdown
+++ b/crash-course.markdown
@@ -565,7 +565,7 @@ sum "a", "b"
 In addition, Elixir allows for default values for arguments, whereas Erlang does not.
 
 ```elixir
-def mul_by(x, n // 2) do
+def mul_by(x, n \\ 2) do
   x * n
 end
 
diff --git a/getting_started/3.markdown b/getting_started/3.markdown
index 4a9a8b6f5..85ecaeb58 100644
--- a/getting_started/3.markdown
+++ b/getting_started/3.markdown
@@ -129,7 +129,7 @@ Named functions also support default arguments:
 
 ```elixir
 defmodule Concat do
-  def join(a, b, sep // " ") do
+  def join(a, b, sep \\ " ") do
     a <> sep <> b
   end
 end
@@ -142,7 +142,7 @@ Any expression is allowed to serve as a default value, but it won't be evaluated
 
 ```elixir
 defmodule DefaultTest do
-  def dowork(x // IO.puts "hello") do
+  def dowork(x \\ IO.puts "hello") do
     x
   end
 end
@@ -160,7 +160,7 @@ If a function with default values has multiple clauses, it is recommended to cre
 
 ```elixir
 defmodule Concat do
-  def join(a, b // nil, sep // " ")
+  def join(a, b \\ nil, sep \\ " ")
 
   def join(a, b, _sep) when nil?(b) do
     a
@@ -185,7 +185,7 @@ defmodule Concat do
     a <> b
   end
 
-  def join(a, b, sep // " ") do
+  def join(a, b, sep \\ " ") do
     IO.puts "***Second join"
     a <> sep <> b
   end
diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index b9560b407..d2525fef0 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -124,7 +124,7 @@ As you can see, invoking `h()` prints the documentation of `IEx.Helpers`. From t
 
 ```iex
 iex> h(c/2)
-* def c(files, path // ".")
+* def c(files, path \\ ".")
 ...
 :ok
 ```

From be3b262a63f064ad36544627c2538e19a14c9163 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Wed, 12 Feb 2014 10:48:59 +0100
Subject: [PATCH 032/160] Update Elixir dependency

---
 getting_started/1.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/1.markdown b/getting_started/1.markdown
index e8a209ac7..f352e1ba3 100644
--- a/getting_started/1.markdown
+++ b/getting_started/1.markdown
@@ -31,7 +31,7 @@ After Erlang is up and running, it is time to install Elixir. You can do that vi
 
 ### 1.1.1 Distributions
 
-This tutorial requires Elixir v0.10.2 or later and it may be available in some distributions:
+This tutorial requires Elixir v0.12.4 or later and it may be available in some distributions:
 
 * Homebrew for Mac OS X
   * Update your homebrew to latest with `brew update`

From 3bdea8cb3cea63e50ed037b5d8e5b07e406199ec Mon Sep 17 00:00:00 2001
From: Myers Carpenter <myers@maski.org>
Date: Wed, 12 Feb 2014 12:10:07 -0500
Subject: [PATCH 033/160] add title's for the docs page and the crash-course
 page.  Link crash course in the getting started index.

---
 _layouts/getting_started.html | 6 ++++++
 crash-course.markdown         | 3 ++-
 docs.html                     | 1 +
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index 11647d40a..cfcb93ce3 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -33,6 +33,12 @@ <h3 class="widget-title">ExUnit - a unit test framework</h3>
       <li><a class="spec" href="/getting_started/ex_unit/1.html">Introduction to ExUnit</a></li>
     </ol>
   </div>
+  <div class="widget">
+    <h3 class="widget-title">Other</h3>
+    <ol>
+      <li><a class="spec" href="/crash-course.html">Erlang/Elixir Syntax: A Crash Course</a></li>
+    </ol>
+  </div>
 
   {% include learning-resources.html %}
   {% include sponsors.html %}
diff --git a/crash-course.markdown b/crash-course.markdown
index 340c2cf6a..cbe62662b 100644
--- a/crash-course.markdown
+++ b/crash-course.markdown
@@ -1,9 +1,10 @@
 ---
+title: "Erlang/Elixir Syntax: A Crash Course"
 section: home
 layout: default
 ---
 
-# Erlang/Elixir Syntax: A Crash Course
+# {{ page.title }}
 
 This is a quick introduction to the Elixir syntax for Erlang developers and vice-versa. It is the absolute minimum amount of knowledge you need in order to understand Elixir/Erlang code, support interoperability, read the docs, sample code, etc.
 
diff --git a/docs.html b/docs.html
index 4c6afd2e5..73716c250 100644
--- a/docs.html
+++ b/docs.html
@@ -1,4 +1,5 @@
 ---
+title: Elixir Documentation
 section: docs
 layout: default
 ---

From 31749fbb0d989236430408399b466e6e0a02e3ca Mon Sep 17 00:00:00 2001
From: Myers Carpenter <myers@maski.org>
Date: Wed, 12 Feb 2014 12:20:25 -0500
Subject: [PATCH 034/160] Make a link from the Mix OTP docs back to recieve

---
 getting_started/2.markdown     | 2 +-
 getting_started/mix/2.markdown | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 95590e948..67175adbb 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -508,7 +508,7 @@ x = 1
 x #=> 1
 ```
 
-### 2.6.4 Receive
+### <a name="receive"></a>2.6.4 Receive
 
 This next control-flow mechanism is essential to Elixir's actors. In Elixir, the code is run in separate processes that exchange messages between them. Those processes are not Operating System processes (they are actually quite light-weight) but are called so since they do not share state with each other.
 
diff --git a/getting_started/mix/2.markdown b/getting_started/mix/2.markdown
index 0fbbce308..6976cba19 100644
--- a/getting_started/mix/2.markdown
+++ b/getting_started/mix/2.markdown
@@ -9,7 +9,7 @@ total_guides: 3
 
 Where do we keep state in Elixir?
 
-Our software needs to keep state, configuration values, data about the running system, etc. We have learned in previous sections how we can use processes/actors to keep state, receiving and responding to messages in a loop but this approach seems to be brittle. What happens if there is an error in our actor and it crashes? Even more, is it really required to create a new process when all we want to do is to keep simple configuration values?
+Our software needs to keep state, configuration values, data about the running system, etc. We have learned in [previous sections](../2.html#receive) how we can use processes/actors to keep state, receiving and responding to messages in a loop but this approach seems to be brittle. What happens if there is an error in our actor and it crashes? Even more, is it really required to create a new process when all we want to do is to keep simple configuration values?
 
 In this chapter, we will answer those questions by building an OTP application. In practice, we don't need Mix in order to build such applications, however Mix provides some conveniences that we are going to explore throughout this chapter.
 

From 9bb8de832740e6ab9a824d0114fef216e57937bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Fri, 21 Feb 2014 20:04:16 +0100
Subject: [PATCH 035/160] Remove background selection

---
 css/style.css | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/css/style.css b/css/style.css
index a499b6dd0..925855b29 100644
--- a/css/style.css
+++ b/css/style.css
@@ -42,16 +42,6 @@ body {
 #container {
   background-color: #FFF;
 }
-::-moz-selection {
-  background: #000;
-  color: #fff;
-  text-shadow: none;
-}
-::selection {
-  background: #000;
-  color: #fff;
-  text-shadow: none;
-}
 a, a:visited {
   color: #4E2A8E;
   text-decoration: underline;

From 0e756f9990464d145945f1c3bb3f3a69bc71b1b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Fri, 21 Feb 2014 20:16:17 +0100
Subject: [PATCH 036/160] Mention maps in crash-course

---
 crash-course.markdown | 80 +++++++++++++++++++++++--------------------
 1 file changed, 43 insertions(+), 37 deletions(-)

diff --git a/crash-course.markdown b/crash-course.markdown
index cbe62662b..f0e9fbd43 100644
--- a/crash-course.markdown
+++ b/crash-course.markdown
@@ -298,75 +298,81 @@ lines.
 #=> true
 ```
 
-### Regular expressions
+### Keyword list
 
-Elixir supports a literal syntax for regular expressions. Such syntax allows regexes to be compiled at compilation time instead of runtime and does not require you to double escape special regex characters:
+Elixir offers a literal syntax for creating a list of two-item tuples where the first item in the tuple is an atom and calls them keyword lists:
 
 **Erlang**
 
 ```erlang
-{ ok, Pattern } = re:compile("abc\\s").
-re:run("abc ", Pattern).
-%=> { match, ["abc "] }
+[{another_key,20},{key,10}]
 ```
 
 **Elixir**
 
 ```elixir
-Regex.run ~r/abc\s/, "abc "
-#=> ["abc "]
-```
-
-Regexes are also supported in heredocs, which is convenient when defining multiline regexes:
-
-```elixir
-is_regex ~r"""
-This is a regex
-spawning several
-lines.
-"""
+kw = [another_key: 20, key: 10]
+kw[:another_key] #=> 20
 ```
 
-### Keyword list
+### Maps
 
-Elixir offers a literal syntax for creating a list of two-item tuples where the first item in the tuple is an atom and calls them keyword lists:
+Erlang R17 introduced maps, a key-value store, with no ordering. Keys and values can be any term. Creating, updating and matching maps in both languages is shown below:
 
 **Erlang**
 
 ```erlang
-[{another_key,20},{key,10}]
+Map = #{key => 0}
+Updated = Map#{key := 1}
+#{key := Value} = Updated
+Value =:= 1
 ```
 
 **Elixir**
 
 ```elixir
-kw = [another_key: 20, key: 10]
-kw[:another_key] #=> 20
+map = %{:key => 0}
+map = %{map | :key => 1}
+#{:key => value} = map
+value === 1
 ```
 
-### Records
+If the keys are all atoms, Elixir allows developers to use `key: 0` for defining the map as well as using `.key` for accessing fields:
 
-The syntax for records differs significantly between Erlang and Elixir. Please refer to [this section][1] in the Erlang book to read a detailed introduction to records in Erlang. And [this chapter][2] from Elixir's Getting Started guide provides a description of records in Elixir.
+```elixir
+map = %{key: 0}
+map = %{map | key: 1}
+map.value === 1
+```
 
-[1]: http://learnyousomeerlang.com/a-short-visit-to-common-data-structures#records
-[2]: http://elixir-lang.org/getting_started/4.html
+### Regular expressions
 
-In order to translate Erlang records into Elixir records, use `Record.extract()`. For example, to use the `ec2_instance_spec` record from [erlcloud][8]:
+Elixir supports a literal syntax for regular expressions. Such syntax allows regexes to be compiled at compilation time instead of runtime and does not require you to double escape special regex characters:
 
-```elixir
-defrecord :ec2_instance_spec, Record.extract(:ec2_instance_spec,
-                                from: "deps/erlcloud/include/erlcloud_ec2.hrl")
+**Erlang**
+
+```erlang
+{ ok, Pattern } = re:compile("abc\\s").
+re:run("abc ", Pattern).
+%=> { match, ["abc "] }
+```
 
-new_host = :ec2_instance_spec.new(
-    image_id:          "ami-6d3f9704",
-    instance_type:     "t1.micro",
-    availability_zone: "us-east-1b"
-)
+**Elixir**
 
-IO.puts inspect(new_host)
+```elixir
+Regex.run ~r/abc\s/, "abc "
+#=> ["abc "]
 ```
 
-[8]: https://github.com/gleber/erlcloud/blob/master/include/erlcloud_ec2.hrl#L11
+Regexes are also supported in heredocs, which is convenient when defining multiline regexes:
+
+```elixir
+is_regex ~r"""
+This is a regex
+spawning several
+lines.
+"""
+```
 
 <div id="modules"></div>
 

From e3cb2e59311f8649d20ae5f88c209edceb3ebb76 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Fri, 21 Feb 2014 20:26:37 +0100
Subject: [PATCH 037/160] Remove outdated blog posts

* Get rid of the What's new in Elixir series (which is no longer maintained)
* Remove blog posts that feature records or have old/outdated code samples
---
 ...2012-04-06-what-s-new-in-elixir-1.markdown |  75 -----
 ...2012-04-13-what-s-new-in-elixir-2.markdown |  57 ----
 _posts/2012-04-21-hello-macros.markdown       | 214 -------------
 ...inside-elixir-s-parallel-compiler.markdown |  10 +-
 ...2012-04-27-what-s-new-in-elixir-3.markdown | 216 -------------
 _posts/2012-05-06-web-framework-2.markdown    | 300 ------------------
 ...2012-05-13-what-s-new-in-elixir-4.markdown | 149 ---------
 ...2012-07-05-what-s-new-in-elixir-5.markdown |  93 ------
 ...012-11-18-elixir-v0-7-1-released.markdown} |   2 +-
 ...xir-s-new-continuable-enumerators.markdown |   2 +-
 ...013-12-27-parsing-xml-with-elixir.markdown |  85 -----
 11 files changed, 7 insertions(+), 1196 deletions(-)
 delete mode 100644 _posts/2012-04-06-what-s-new-in-elixir-1.markdown
 delete mode 100644 _posts/2012-04-13-what-s-new-in-elixir-2.markdown
 delete mode 100644 _posts/2012-04-21-hello-macros.markdown
 delete mode 100644 _posts/2012-04-27-what-s-new-in-elixir-3.markdown
 delete mode 100644 _posts/2012-05-06-web-framework-2.markdown
 delete mode 100644 _posts/2012-05-13-what-s-new-in-elixir-4.markdown
 delete mode 100644 _posts/2012-07-05-what-s-new-in-elixir-5.markdown
 rename _posts/{2012-11-18-elixir-v0-7-1-released-and-the-end-of-a-journey.markdown => 2012-11-18-elixir-v0-7-1-released.markdown} (96%)
 delete mode 100644 _posts/2013-12-27-parsing-xml-with-elixir.markdown

diff --git a/_posts/2012-04-06-what-s-new-in-elixir-1.markdown b/_posts/2012-04-06-what-s-new-in-elixir-1.markdown
deleted file mode 100644
index 25ed45f3e..000000000
--- a/_posts/2012-04-06-what-s-new-in-elixir-1.markdown
+++ /dev/null
@@ -1,75 +0,0 @@
----
-layout: post
-title: What's New in Elixir  &#35;1
-author: Alexei Sholik
-category: "What's New in Elixir"
-excerpt: Last week Elixir has seen a lot of new features, improvements, and bug fixes. In this little post I'm going to highlight some of the most prominent ones.
----
-
-Last week Elixir has seen a lot of new features, improvements, and bug fixes. In this little post I'm going to highlight some of the most prominent ones.
-
-* Access protocol has been added for tuples, lists, strings, and whatnot. It allows us to easily access elements of a collection. We can also use a regex to find the first match in a string or a list. Examples follow: 
-
-        dict = [a: 1, b: 2, c: 3]
-        dict[:a]   #=> 1
-        dict[:d]   #=> nil
-
-        tuple = {5, 4, 3, 2, 1}
-        tuple[1]   #=> 5
-        tuple[0]   #=> nil
-        tuple[-1]  #=> 1
-
-        defrecord TestRec, red: 0, green: 0, blue: 0
-        r = TestRec[red: 255, blue: 80]  #=> new record
-        s = "The quick brown fox jumps over the lazy dog."
-        s[%r/[a-z]+o[a-z]+/]  #=> "brown"
-
-* Access protocol also makes it possible to pattern-match records:
-
-
-        defrecord TestRec, red: 0, green: 0, blue: 0
-        r = TestRec[red: 255, blue: 80]  #=> new record
-        case r do
-        match: TestRec[red: 0]
-          :no_match
-        match: TestRec[red: red, blue: 80]
-          :ok
-        end
-        #=> :ok
-        red === 255  #=> true
-
-* The `Orddict` module is no longer with us, it has been renamed to `Keyword`. The new module only allows atoms to be used as keys. A general purpose module for dicts will be added sooner or later. 
-
-* The [`Enum` module](https://github.com/elixir-lang/elixir/blob/6f5611317a3d3102f60dbb319f88f2ca1d561c11/lib/enum.ex) has been cleaned up a bit and got new functions, namely `drop_while`, `take_while`, and `split_with`.
-
-* The [`List` module](https://github.com/elixir-lang/elixir/blob/28eaff894e527643ba58b85fb975b5963679542b/lib/list.ex) has also seen some improvements. It now supports access protocol, the `append` function was renamed to `concat`, and a new `range` function has been implemented. 
-
-* Support for nested modules has been added.
-
-        defmodule Father do
-          defmodule Child do
-            def child_fun(str) do
-              IO.puts str
-            end
-          end
-          def fun do
-            Child.child_fun "some argument"
-          end
-        end
-        Father.Child.child_fun "hello!"
-
-* The `Regex` module has received new functions, namely, `source` and `opts`. It can also be `inspect`ed now.
-
-        reg = %r/[a-z]+o[a-z]+/im
-        Regex.source reg  #=> "[a-z]+o[a-z]+"
-        Regex.opts reg    #=> "im"
-        inspect reg       #=> "%r\"[a-z]+o[a-z]+\"im"
-
-* A new `read_info` function has been added to the [`File` module](https://github.com/elixir-lang/elixir/blob/35b22c598defd8be07d46d2e7e8fc0ddf9ec4e80/lib/file.ex) allowing 
-users to query for file attributes.
-
----
-
-That's it for this week. I think it's been a great one! If anyone of you has something in the works in a separate fork or branch, please let me know so that I can highlight your contributions too.
-
-Thank you all and see you next week.
diff --git a/_posts/2012-04-13-what-s-new-in-elixir-2.markdown b/_posts/2012-04-13-what-s-new-in-elixir-2.markdown
deleted file mode 100644
index 74ad3e504..000000000
--- a/_posts/2012-04-13-what-s-new-in-elixir-2.markdown
+++ /dev/null
@@ -1,57 +0,0 @@
----
-layout: post
-title: What's New in Elixir  &#35;2
-author: Alexei Sholik
-category: "What's New in Elixir"
-excerpt: This week has not seen as many prominent new features as the previous one. Still, more bugs have been fixed and a number of small improvements has been made here and there, so the overall progress is quite noticeable.
----
-This week has not seen as many prominent new features as the previous one. Still, more bugs have been fixed and a number of small improvements has been made here and there, so the overall progress is quite noticeable.
-
-Let's get started with our usual overview. I'm using the latest master (`2851da4186a7e4c8e94c6ddd4e78dc7e883a31e9`) to compile and run the code snippets in this post.
-
-* Literal support for hexadecimal, octal and binary numbers has been added.
-
-        0xFF    #=> 255
-        0o10    #=> 8
-        0b1010  #=> 10
-
-* New functions in the [List module](https://github.com/elixir-lang/elixir/blob/master/lib/list.ex): `sort`, `zip`, `unzip`.
-
-        # Charlists are sorted in lexicographic order
-        List.sort ['10', '2', '4', '1', '21']
-        #=> ['1', '10', '2', '21', '4']
-
-        # Numerical sort for charlists using a custom function
-        List.sort ['10', '2', '4', '1', '21'], fn(a, b) ->
-          {na, _} = :string.to_integer a
-          {nb, _} = :string.to_integer b
-          na <= nb
-        end
-        #=> ['1', '2', '4', '10', '21']
-
-        List.zip [[1, 2], [:a, :b], ["one", "two"]]
-        #=> [{1,:a,"one"},{2,:b,"two"}]
-
-* The [System module](https://github.com/elixir-lang/elixir/blob/master/lib/system.ex) has been merged into master. It provides functions for communicating with OS environment, running external commands, getting the stacktrace, etc.
-
-        System.pwd
-        #=> "/Users/alco/Documents/git/elixir"
-
-        System.get_env "PAGER"
-        #=> "less"
-
-        System.cmd 'date'
-        #=> "Fri Apr 13 19:35:13 EEST 2012\n"
-
-        System.stacktrace
-        #=> (usually long output)
-
-* In other news, we're getting closer to having a dedicated site for documentation, JSON parsing/serialization is currently in the works, and there's also work being done on bringing dicts back into Elixir.
-
-* We're also seeing new faces on the list and on the IRC channel. If you haven't already, come join us at #elixir-lang on irc.freenode.net. More fun stuff is coming in the nearest future, including new language features, projects and demos.
-
----
-
-That's it for this week. Don't forget that if you have something related to Elixir cooking, be it a language feature or a project, or a demo, or whatever, please let me know so that I can highlight your thing too. I will soon start featuring the most active projects in this digest. If you prefer to pitch the thing you're working on yourself, you are welcome to do so.
-
-Thank you all and see you next week!
diff --git a/_posts/2012-04-21-hello-macros.markdown b/_posts/2012-04-21-hello-macros.markdown
deleted file mode 100644
index bc00ce5d5..000000000
--- a/_posts/2012-04-21-hello-macros.markdown
+++ /dev/null
@@ -1,214 +0,0 @@
----
-layout: post
-title: Building a Web Framework. Part I
-author: Alexei Sholik
-category: "Web dev"
-excerpt: Since we haven't seen much new stuff in the Elixir land this week, I've decided to do something a little different. We'll build our own web framework to get a feel of the Elixir power. In this first part we'll take a closer look at macros and we'll see how they can be useful when it comes to building a friendly syntax for our users.
----
-Since we haven't seen much new stuff in the Elixir land this week, I've decided to do something a little different. We'll build our own web framework to get a feel of the Elixir power. In this first part we'll take a closer look at macros and we'll see how they can be useful when it comes to building a friendly syntax for our users.
-
-Here's an example of what we are aiming at:
-
-    defmodule HelloServer do
-      use Feb, root: "assets"
-
-      get "/" do
-        { :ok, "Hello world!" }
-      end
-
-      get "/demo", file: "demo.html"
-
-      post "/" do
-        { :ok, "You're posted!\nYour data: #{inspect _data}" }
-      end
-    end
-
-## The Foundation ##
-
-To keep this post short and simple, we won't cover every single aspect of web framework development right away. Instead, we'll first focus on one specific task — defining a domain specific language (DSL) using Elixir macros. Let's start by stepping through the code above, one piece at a time.
-
-You might remember from the [Getting Started guide][1] that `use` is just a syntactic sugar that expands into a call to the `__using__` macro. In our case, the expansion will look like this
-
-    require Feb
-    Feb.__using__(__MODULE, [root: "assets"])
-
-Let's forget about the `root` option for now, we'll deal with it later. Here's how our `__using__` macro is going to be defined:
-
-    defmodule Feb do
-      defmacro __using__(module, _opts) do
-        quote do
-          import Feb, only: [get: 2, post: 2]
-
-          def start do
-            Feb.start unquote(module)
-          end
-        end
-      end
-    end
-
-One important thing to understand here is that this macro is called inside the module which invokes the `use` directive (**HelloServer** in our case). When the macro is called, its return value is then evaluated inside the calling module. Thus, our **HelloServer** ends up with a definition for the `start` function which will in turn call `Feb.start`. Too see this in action, let's first define the `start` function in **Feb**:
-
-    def start(_) do
-      IO.puts "Executing Feb.start"
-    end
-
-And here's the code for our **HelloServer** so far:
-
-    defmodule HelloServer do
-      use Feb
-    end
-
-Now let's try this out in the shell. I'm using a Makefile to simplify the compilation-related tasks. You can grab a copy from the project's [GitHub repo][2]. Notice also how the project directory is organized.
-
-    $ make
-    $ elixir -e 'HelloServer.start'
-    Executing Feb.start
-
-Everything is working as expected. Now let's move to the fun part.
-
-  [1]: http://elixir-lang.org/getting_started/6.html
-  [2]: https://github.com/alco/web-framework/blob/master/1-macros/Makefile
-
-## Writing Method Macros ##
-
-Let's look at the first `get` definition and think a bit about its meaning.
-
-    get "/" do
-      { :ok, "Hello world!" }
-    end
-
-The important thing to know about Elixir definitions is that they are executable. The Elixir compiler does not compile the code in the strict sense of the word, it is executing the code. So when you put `IO.puts "Hello"` inside a module definition, you'll see `Hello` printed in the shell when the code is compiled.
-
-So, in this case, it's just a call to the `get` macro defined in **Feb**. In fact, we could write it as
-
-    Feb.get("/", do: { :ok, "Hello world!" })
-
-and would be exactly the same thing. The reason we are allowed to omit the `Feb.` part is because we have imported the `get` macro earlier, see the definition of `__using__`.
-
-OK, so now that when we understand what's actually going on, let's look at the definition:
-
-    defmacro get(path, [do: code]) do
-      quote do
-        def handle(:get, unquote(path), _data) do
-          unquote(code)
-        end
-      end
-    end
-
-Our `get` macro accepts two arguments, the second one is pattern-matched to extract the block of code between `do` and `end`. The macro produces a definition of the `handle` function with three arguments. The `_data` argument is not used here, it will be used in the `post` macro later. So, basically, instead of calling `get` we could write the following definition in **HelloServer** to achieve the same effect:
-
-    def handle(:get, "/", _data) do
-      { :ok, "Hello world!" }
-    end
-
-That's all there is to it. We can check this in the shell.
-
-    $ make
-    $ iex
-    iex> HelloServer.handle :get, "/", nil
-    {:ok,"Hello world!"}
-
-The code for the `post` macro is pretty straightforward as well:
-
-    defmacro post(path, [do: code]) do
-      quote hygiene: false do
-        def handle(:post, unquote(path), _data) do
-          unquote(code)
-        end
-      end
-    end
-
-One new thing here is `hygiene: false`. What this does is it allows us to define variables that will be accessible by the caller. We do this here so that we can then reference the `_data` variable in our **HelloServer** implementation:
-
-    post "/" do
-      { :ok, "You're posted!\nYour data: #{inspect _data}" }
-    end
-
-Check that it works as expected:
-
-    $ make
-    $ iex
-    iex> HelloServer.handle :post, "/", "abc"
-    {:ok,"You're posted!\nYour data: \"abc\""}
-
-Good. We're almost done with the basics. I haven't covered the second `get` definition yet. Let's recall what it looked like:
-
-    get "/demo", file: "demo.html"
-
-By using this macro we're letting the framework know that we want to send the contents of the _demo.html_ file back to the client. In order to support this second form we need to define another clause for our `get` macro:
-
-    defmacro get(path, [file: bin]) when is_binary(bin) do
-      quote do
-        def handle(:get, unquote(path), _data) do
-          full_path = File.join([static_root(), unquote(bin)])
-          case File.read(full_path) do
-            { :ok, data } -> { :ok, data }
-            _ -> { :error, "404 Not Found" }
-          end
-        end
-      end
-    end
-
-Having written the code for reading from a file in the framework, we free our users from the need to do so themselves.
-
-## Wrapping Up ##
-
-I haven't yet provided the definition for `static_root`, let me fix this. It has to do with the `root` option mentioned at the beginning of the post. Remember what our first invocation of `use` looked liked
-
-    # In module HelloServer
-    use Feb, root: "assets"
-
-The `[root: "assets"]` Keyword is what ends up in the `_opts` argument of our `__using__` macro. So let's rewrite that macro to include the definition for the `static_root` function.
-
-    # In module Feb
-    defmacro __using__(module, opts) do
-      root_val = Keyword.get(opts, :root, ".")
-
-      quote do
-        import Feb, only: [get: 2, post: 2]
-
-        def start do
-          Feb.start unquote(module)
-        end
-
-        defp static_root, do: unquote(root_val)
-      end
-    end
-
-We read the value of the `root` key from the `opts` Keyword. If it's nil, the current directory becomes the root.
-
-The post is already getting quite long, so let's wrap up and do the final test drive to make sure everything works as expected.
-
-    $ make
-    $ iex
-    iex> import HelloServer
-    []
-    iex> handle :get, "/", nil
-    {:ok,"Hello world!"}
-    iex> handle :post, "/", :data
-    {:ok,"You're posted!\nYour data: :data"}
-    iex> handle :get, "/demo", nil
-    {:error,"404 Not Found"}
-
-Oops, looks like I've forgotten to create the _demo.html_ file. Let's do this real quick. Create the file in the _assets_ directory and paste the following contents into it:
-
-    <html>
-      <head>
-        <title>Demo</title>
-      </head>
-      <body>
-        <h1>Hello world!</h1>
-      </body>
-    </html>
-
-Now let's try that again:
-
-    iex> handle :get, "/demo", nil
-    {:ok,"<html>\n<head>\n  <title>Demo</title>\n</head>\n<body>\n  <h1>Hello world!</h1>\n</body>\n</html>\n\n\n"}
-
-Awesome! This concludes the first part in the series. Don't forget to grab the code [from GitHub][3]. If you have any questions or corrections, send a message to the [mailing list][4] or stop by the **#elixir-lang** channel on **irc.freenode.net**.
-
-See you there.
-
-  [3]: https://github.com/alco/web-framework/tree/master/1-macros
-  [4]: http://groups.google.com/group/elixir-lang-talk
diff --git a/_posts/2012-04-24-a-peek-inside-elixir-s-parallel-compiler.markdown b/_posts/2012-04-24-a-peek-inside-elixir-s-parallel-compiler.markdown
index bc1c64b55..82b076aee 100644
--- a/_posts/2012-04-24-a-peek-inside-elixir-s-parallel-compiler.markdown
+++ b/_posts/2012-04-24-a-peek-inside-elixir-s-parallel-compiler.markdown
@@ -18,7 +18,7 @@ In Elixir, we could write this code as follows:
       parent = Process.self()
       child  = spawn_link(fn ->
         :elixir_compiler.file_to_path(current, output)
-        parent <- { :compiled, Process.self() }
+        send parent, { :compiled, Process.self() }
       end)
       receive do
         { :compiled, ^child } ->
@@ -95,7 +95,7 @@ As discussed in the previous section, we want to extend the error handler to act
             []
           { :error, _ } ->
             parent = Process.get(:elixir_parent_compiler)
-            parent <- { :waiting, Process.self, module }
+            send parent, { :waiting, Process.self, module }
             receive do
               { :release, ^parent } -> ensure_loaded(module)
             end
@@ -114,7 +114,7 @@ With our error handler code in place, the first thing we need to do is to change
       Process.flag(:error_handler, Elixir.ErrorHandler)
 
       :elixir_compiler.file_to_path(current, output)
-      parent <- { :compiled, Process.self() }
+      send parent, { :compiled, Process.self() }
     end)
 
 Notice that we have two small additions. First we store the `:elixir_parent_compiler` PID in the process dictionary so we are able to read it from the error handler and then we proceed to configure a flag in our process so our new error handler is invoked whenever a module or function cannot be found.
@@ -125,7 +125,7 @@ Second, our main process can now receive a new `{ :waiting, child, module }` mes
       parent = Process.self()
       child  = spawn_link(fn ->
         :elixir_compiler.file_to_path(current, output)
-        parent <- { :compiled, Process.self() }
+        send parent, { :compiled, Process.self() }
       end)
       wait_for_messages(files, output, [child|stack])
     end
@@ -147,7 +147,7 @@ Notice we added an extra clause to `spawn_compilers` so we can properly handle t
         { :compiled, child } ->
           new_stack = List.delete(stack, child)
           Enum.each new_stack, fn(pid) ->
-            pid <- { :release, Process.self }
+            send pid, { :release, Process.self }
           end
           spawn_compilers(files, output, new_stack)
         { :waiting, _child, _module } ->
diff --git a/_posts/2012-04-27-what-s-new-in-elixir-3.markdown b/_posts/2012-04-27-what-s-new-in-elixir-3.markdown
deleted file mode 100644
index 2f9185888..000000000
--- a/_posts/2012-04-27-what-s-new-in-elixir-3.markdown
+++ /dev/null
@@ -1,216 +0,0 @@
----
-layout: post
-title: What's New in Elixir  &#35;3
-author: Alexei Sholik
-category: "What's New in Elixir"
-excerpt: It's been two weeks since the last edition of the series, so this one is going to be packed with information.
----
-
-It's been two weeks since the last edition of the series, so this one is going to be packed with information.
-
-As usual, I'm using the latest available master (`b4cc71a8351222721b0e1dce130843d7e683863e`) to compile and run the code snippets in this post.
-
-You might have noticed that the version number has been downgraded to 0.5.0 recently. This doesn't mean that half of the features have been removed from Elixir. It simply indicates that there's still plenty of work to be done, but we're sure we're moving in the right direction.
-
-Without further ado, let's get to it.
-
-
-## Highlights ##
-
-José has written an awesome blog post describing how the new parallel compiler allows Elixir to seamlessly resolve dependencies and improve the speed of ~~light~~ compilation by doing only the work that needs to be done. Read all about it [here][1].
-
-  [1]: http://elixir-lang.org/blog/2012/04/24/a-peek-inside-elixir-s-parallel-compiler/
-
-
-## API Changes ##
-
-
-### Keyword ###
-
-Keywords can have duplicate entries. When you `get` a value for a key from a keyword, the first entry with that key is returned. When you `put` a new value, it replaces all values for the given key:
-
-    kv = [a: 1, a: 2, b: 3]
-    #=> [{:a,1},{:a,2},{:b,3}]
-
-    Keyword.get kv, :a
-    #=> 1
-
-    Keyword.put kv, :a, 10
-    #=> [{:a,10},{:b,3}]
-
-### New syntax for protocol declarations ###
-
-Protocol declarations now look more like module definitions. This allows us to document each function and increases their overall visual appeal (in my view).
-
-    defprotocol ProtoName do
-      @only [Record, List]
-
-      @doc """
-      This is a doc string.
-      """
-      def function(arg)
-
-      @doc """
-      Another function
-      """
-      def another_function(list)
-    end
-
-As before, functions are only declared inside the `defprotocol` body. Their implementation is defined separately (in a `defimpl` block) for each type that wishes to support the protocol. More info can be found in the [Getting Started guide][2] (_Section 4.2_).
-
-  [2]: http://elixir-lang.org/getting_started/4.html
-
-### Declarations for default arguments ###
-
-Default arguments in Elixir are shared between different clauses of the functions with the same name. This recent addition allows this fact to be expressed more clearly in the code.
-
-    defmodule DefaultTest do
-      def function(a, b // "world")
-
-      def function(a, b) when is_binary(a) do
-        a <> b
-      end
-
-      def function(a, b) when is_list(a) do
-        a ++ to_char_list(b)
-      end
-    end
-
-    ###
-
-    iex> DefaultTest.function "Hello "
-    "Hello world"
-
-    iex> DefaultTest.function 'Hello '
-    'Hello world'
-
-Notice how the first declaration does not have a body, its only purpose is to define the default argument that will be used in the remaining two clauses.
-
-### Revamped assert with smart guessing ###
-
-Our good old `assert` macro has become a tad smarter and can be now be used in places where we had to use `assert_equal`, `assert_operator`, and `assert_access` before.
-
-    # Replaces assert_equal
-    assert "abc" == to_binary('abc')
-
-    # Replaces assert_operator
-    assert 11 < 13
-
-    # Replaces assert_access. Checks that the regexp can access/match the string.
-    assert "foo"[%r(o)]
-
-### Enum ###
-
-The `Enum` module has been reworked slightly in order to add support for dicts (described below). It's still working with lists as before, but now you can also use most of its functions with dicts too.
-
-
-## New Modules & Protocols ##
-
-### Meet the new Dict protocol along with it's buddies HashDict and Orddict ###
-
-This change has been cooking for quite a while. Now it's finally merged into master. Let's have a look:
-
-    dict = HashDict.new [a: 1, b: 2, c: 3]
-    Dict.keys dict
-    #=> [:a,:b,:c]
-
-    Dict.values dict
-    #=> [1,2,3]
-
-    dict = Dict.put dict, "hello", "world"
-    Dict.get dict, "hello"
-    #=> "world"
-
-    ord = Orddict.new [{"a", []}, {"b", [1, 2, 3]}, {[nil], "cool"}]
-    Dict.get ord, [nil]
-    #=> "cool"
-
-    ord = Dict.merge ord, Orddict.new([key: 'value'])
-    Dict.get ord, :key
-    #=> 'value'
-
-Notice, that `Dict` is a protocol and it works with both hash dicts and orddicts. Take a look at the [source code][3] for the new modules. The protocol declaration in _common.ex_ has extensive documentation for the functions it defines.
-
-  [3]: https://github.com/elixir-lang/elixir/tree/master/lib/dict
-
-
-Let's look at how we can use `Enum` with the new dict modules.
-
-    # ord is our orddict from the previous snippet
-
-    # Swap keys and values
-    Enum.map ord, fn({k, v}) -> {v, k} end
-    #=> [{'value',:key},{"cool",[nil]},{[],"a"},{[1,2,3],"b"}]
-
-Notice that `Enum` always returns a list even when passed a dictionary.
-
-Some functions in `Enum` expect an ordered collection to be passed in. Since `HashDict` does not define a meaningful order for its contents, you'll get a runtime error if you try to use one of those functions with this dict. `Orddict`, on the other hand, keeps its entries sorted by keys:
-
-    ord = Orddict.new [{'value',:key},{"cool",[nil]},{[],"a"},{[1,2,3],"b"}]
-    #=> {Orddict.Record,[{[],"a"},{[1,2,3],"b"},{'value',:key},{"cool",[nil]}]}
-
-    Enum.drop_while ord, fn({k, v}) -> is_list(k) end
-    #=> [{"cool",[nil]}]
-
-Take a look at the [source code][4] for the detailed descriptions of all the functions defined in `Enum`. Those functions that expect an ordered collection are explicitly marked as such.
-
-  [4]: https://github.com/elixir-lang/elixir/blob/master/lib/enum.ex
-
-
-## Technical Stuff ##
-
-### Macros can now be invoked locally ###
-
-You can also define private macros with `defmacrop`. Example:
-
-    defmodule Obnoxious do
-      defmacro swap({:*, line, args}) do
-        {:+, line, args}
-      end
-
-      defmacrop priv_swap({:+, line, args}) do
-        {:*, line, args}
-      end
-
-      def mul(a, b) do
-        swap(a * b)
-      end
-
-      def add(a, b) do
-        priv_swap(a + b)
-      end
-    end
-
-    ###
-
-    iex> Obnoxious.mul 3, 4
-    7
-
-    iex> Obnoxious.add 6, 6
-    36
-
-
-### Extended module info available at runtime ###
-
-Given the definition of `Obnoxious` above, we can query some of its attributes at run time:
-
-    # Functions exported by the module
-    iex> Obnoxious.__info__(:functions)
-    [{:__info__,1},{:add,2},{:mul,2}]
-
-    # Macros exported by the module
-    iex> Obnoxious.__info__(:macros)
-    [{:swap,1}]
-
-As you can see, the private macro `priv_swap` is not available outside of the module it is defined in, the same goes for private functions. They could even have been inlined by the compiler, who knows.
-
-And don't forget that Erlang compiler provide the `module_info` function for each compiled module:
-
-    iex> Obnoxious.module_info
-    [{:exports,[{:__info__,1},{:MACRO_swap,1},{:mul,2},{:add,2},{:module_info,0},{:module_info,1}]}, ...]
-
----
-
-That's it for this week. It's exciting to see Elixir evolving each day. Join the community if you don't want to end up lagging behind!
-
-Thank you all and see you next week!
diff --git a/_posts/2012-05-06-web-framework-2.markdown b/_posts/2012-05-06-web-framework-2.markdown
deleted file mode 100644
index 524de0991..000000000
--- a/_posts/2012-05-06-web-framework-2.markdown
+++ /dev/null
@@ -1,300 +0,0 @@
----
-layout: post
-title: Building a Web Framework. Part II
-author: Alexei Sholik
-category: "Web dev"
-excerpt: Last time we learned how to write macros that provide a useful abstraction for building a web server on top of the language. The server we built was able to serve static files and handle user's GET and POST requests. This week we're going to further extend our web framework, fix a couple of rough edges, and experiment with networking.
----
-
-[Last time][1] we learned how to write macros that provide a useful abstraction on top of the language which we used for building a web server. The server we built was able to serve static files and handle user's GET and POST requests. Here's what it looked like:
-
-    defmodule HelloServer do
-      use Feb, root: "assets"
-
-      get "/" do
-        { :ok, "Hello world!" }
-      end
-
-      get "/demo", file: "demo.html"
-
-      post "/" do
-        { :ok, "You're posted!\nYour data: #{inspect _data}" }
-      end
-    end
-
-If you missed the previous post, I encourage you to [go back][1] to it and make sure you understand the concepts explained there.
-
-In this post we're going to fix a couple of rough edges and further extend our web framework. Specifically, we're going to implement URL query parsing and add a generic `multi_handle` macro that will complete our syntactic abstraction. From that point on we'll start looking at how to add networking to the framework to eventually be able to build a real website. This is what the code for our `HelloServer` is going to turn into by the end of this post:
-
-    defmodule HelloServer do
-      use Feb, root: "assets"
-
-      get "/" do
-        { :ok, "Hello world!" }
-      end
-
-      get "/demo", file: "demo.html"
-
-      post "/" do
-        { :ok, "You're posted!\nYour data: #{inspect _data}" }
-      end
-
-      ## New stuff below this line ##
-
-      multi_handle "/kvstore" do
-        :post ->
-          IO.puts "Got a POST request with data: #{inspect _data}"
-          :ok
-
-        :get ->
-          IO.puts "Got a GET request with query: #{inspect _query}"
-          :ok
-      end
-
-      get "/search", query do
-        search = Dict.get query, "q"
-        if search do
-          { :ok, "No items found for the query '#{search}'" }
-        else
-          { :ok, "No query" }
-        end
-      end
-    end
-
-The entire source code for this and the past articles is available over at [GitHub][2]. To recap, we have two files in the _src_ directory: _feb.ex_ which contains the code for our `Feb` framework and _server.ex_ which is a simple server implementation (named `HelloServer`) based on the framework. To follow along with the post, I recommend keeping the code from the _1-macros_ directory open in a side window. I will be explaining the new stuff based on the code we have seen so far.
-
-  [1]: http://elixir-lang.org/blog/2012/04/21/hello-macros/
-  [2]: https://github.com/alco/web-framework
-
-
-## Unexpected Requests ##
-
-Our server can currently handle only those requests that are explicitly coded. If we try to send it a different kind of request, it'll crash:
-
-    iex> HelloServer.handle :oops, "/", nil
-    ** (FunctionClauseError) no function clause matching: HelloServer.handle(:oops, "/", nil)
-
-To avoid this, we'll add a catch-all default handler to _feb.ex_:
-
-    defmacro default_handle(_) do
-      quote do
-        def handle(method, path, data // "")
-        def handle(method, path, data) do
-          cond do
-            # Allow only the listed methods
-            not (method in [:get, :post]) -> format_error(400)
-            
-            # Path should always start with a slash (/)
-            not match?("/" <> _, path) -> format_error(400)
-            
-            # Otherwise, the request is assumed to be valid but the requested
-            # resource cannot be found
-            _ -> format_error(404)
-        end
-      end
-    end
-
-I'll explain the ignored argument to this macro shortly. I've also introduced a new function that automates error reporting a bit. Here's how it's implemented in _feb.ex_:
-
-    # Return a { :error, <binary> } tuple with error description
-    def format_error(code) do
-      { :error, case code do
-        400 -> "400 Bad Request"
-        404 -> "404 Not Found"
-        _   -> "503 Internal Server Error"
-      end }
-    end
-
-Lastly, I've changed the `import` statement in the `__using__` macro (again in _feb.ex_) to the following one:
-
-    import Feb
-    # was
-    # import Feb, only: [get: 2, post: 2]
-
-This will allow us to add new functions and macros and make them available to the client code automatically.
-
-To include the `default_handle` function in `HelloServer` we can add a call to it at the end of the module definition. But there is a better way, an automatic one. Elixir provides the function `Module.add_compile_callback/1` which is exactly what we need to set up our default handler and ensure that it is going to be invoked only after every other clause was tried and failed to match the arguments.
-
-We'll add the following line at the beginning the `__using__` macro definition in _feb.ex_:
-
-    defmacro __using__(module, opts) do
-      Module.add_compile_callback module, __MODULE__, :default_handle
-
-Elixir will call the `default_handle` macro as if it were placed right at the end of `HelloServer` definition and it will pass the module name as an argument (which we're not using here, so we're simply ignoring it).
-
-Now let's test the new handler.
-
-    $ make
-    $ iex
-    iex> HelloServer.handle :oops, "/"
-    {:error,"400 Bad Request"}
-
-    iex> HelloServer.handle :get, "wrong_path"
-    {:error,"400 Bad Request"}
-
-    iex> HelloServer.handle :get, "/404"
-    {:error,"404 Not Found"}
-
-That's better.
-
-
-## Generic Handle ##
-
-Let's add one more piece of sugar to our framework by allowing the users to write one function that will handle several HTTP methods, useful for defining various interactions with a single path spec. For instance:
-
-    multi_handle "/kvstore" do
-      :post ->
-        IO.puts "Got a POST request with data: #{_data}"
-        :ok
-      :get ->
-        IO.puts "Got a GET request with query: #{_query}"
-        :ok
-    end
-
-You can see how this approach allows us to express the fact that "/kvstore" provides some kind of service with support for multiple methods. This skeleton could be used to build a REST API, for example. This time around we'll be using implicit variables for POST data and GET query.
-
-Let's think for a moment what the `multi_handle` macro should expand to. So far we've been expanding our `post` and `get` macros into one `handle` function that uses pattern-matching to dispatch to the appropriate handler based on the incoming request. There's no reason not to use the same approach for `multi_handle`. So here's what its implementation looks like:
-
-    defmacro multi_handle(path, [do: { :"->", _line, blocks }]) do
-      # Iterate over each block in `blocks` and
-      # produce a separate `handle` clause for it
-      Enum.map blocks, fn ->
-        { [:get], code } ->
-          quote hygiene: false do
-            def handle(:get, unquote(path), _query) do
-              unquote(code)
-            end
-          end
-        { [:post], code } ->
-          quote hygiene: false do
-            def handle(:post, unquote(path), _data) do
-              unquote(code)
-            end
-          end
-      end
-    end
-
-When the macro is called, we receive all clauses under the `do` key with each HTTP verb and its implementation inside the syntax node `->`, in the order they are specified. Each clause is a tuple with two elements, the first one is a list of parameters given on the left side and the second one is the implementation, for example:
-
-    { :"->", line, [{[:get], <user code>}, {[:post], <user code>}] }
-
-In our `multi_handle` macro signature, we pattern match against the expression above and get a list with the blocks of code. Then we loop through this list emitting a function definition with the corresponding arguments. The code for each of the code blocks is similar to the GET and POST handlers we have defined earlier.
-
-Finally, let's test it in `iex`:
-
-    $ make
-    $ iex
-    iex> import HelloServer
-    []
-
-    iex> handle :get, "/kvstore"
-    Got a GET request with query: ""
-    :ok
-
-    iex> handle :post, "/kvstore"
-    Got a POST request with data: ""
-    :ok
-
-    iex> handle :post, "/kvstore", "secret"
-    Got a POST request with data: "secret"
-    :ok
-
-So far so good. Now let's add the ability to get the query from a URL.
-
-
-## URL Queries ##
-
-We'd like our server to be able to handle queries of the form `/search?q=donut`. The `URI` module which ships with Elixir has the right tools for the task: `parse` and `decode_query`. The first one parses a URI and stores it in a `URI.Info` record. The second one accepts a query string and returns a dict.
-
-We'll implement a `split_path` function in `Feb` that will return a tuple of the form `{ path, query }` where `query` is going to be an orddict. If the path does not contain a query, an empty orddict will be returned.
-
-    # Return { path, query } where `query` is an orddict.
-    def split_path(path_with_query) do
-      uri_info = URI.parse path_with_query
-      { uri_info.path, URI.decode_query(uri_info.query || "") }
-    end
-
-The code is pretty straightforward. Let's make sure that it works:
-
-    $ make
-    $ iex
-    iex> Feb.split_path "/search"
-    {"/search",{Orddict.Record,[]}}
-
-    iex> Feb.split_path "/search?q=hello&find=chuck%20norris"
-    {"/search",{Orddict.Record,[{"find","chuck norris"},{"q","hello"}]}}
-
-OK, so that's done. But we have no way of passing the query to the server. This is solved by adding another clause to the `get` macro as follows:
-
-    # feb.ex
-
-    # A 2-argument handler that also receives a query along with the path
-    defmacro get(path, query, [do: code]) do
-      quote do
-        def handle(:get, unquote(path), unquote(query)) do
-          unquote(code)
-        end
-      end
-    end
-
-The only difference between this handler and the basic query-less GET handler is that we include the `query` argument provided by the user in the generated function definition. Remember that in our [POST handler](https://github.com/alco/web-framework/blob/master/1-macros/src/feb.ex#L49) we used a `quote` form with hygiene turned off in order to define an implicit `_data` variable. Our GET handlers could also receive such implicit argument if we turned the hygiene off for them. The reason I've chosen to handle the query explicitly in this case is to show you that there are multiple options available. You may choose whichever you like most.
-
-With this new clause in place we can add another `get` request definition in the `HelloServer` module:
-
-    # server.ex
-
-    get "/search", query do
-      search = Dict.get query, "q"
-      if search do
-        { :ok, "No items found for the query '#{search}'" }
-      else
-        { :ok, "No query" }
-      end
-    end
-
-Let's take a step back and look again at the definition for this `get` macro in _feb.ex_. It takes its second argument (the `query`) and puts it in place of the third argument in the definition of `handle`. The reason we're unquoting it (instead of simply writing `query`) is to allow the user to choose an arbitrary name for this argument. So, for instance, the following definition in `HelloServer` will work the same way:
-
-    get "/search", my_query do
-      # the query dict is now stored in `my_query`
-      IO.inspect my_query
-    end
-
-All that's left is to test the code:
-
-    $ make
-    $ iex
-    iex> { path, query } = Feb.split_path "/search?q=donut"
-    {"/search",{Orddict.Record,[{"q","donut"}]}}
-
-    iex> import HelloServer
-    []
-
-    iex> handle :get, path, query
-    {:ok,"No items found for the query 'donut'"}
-
-    iex> handle :get, "/search", Orddict.new
-    {:ok,"No query"}
-
-    # Let's also test our generic handler with a query
-    iex> handle :get, "/kvstore", URI.decode_query("key=value")
-    Got a GET request with query: {Orddict.Record,[{"key","value"}]}
-    :ok
-
-Great! With this we have completed the implementation of our simplistic DSL. Let's wrap up for this week and do a quick review of what we have learned.
-
-
-## Conclusion ##
-
-By this time you know how to use macros to your advantage by defining appropriate abstractions that allow writing code that's easy to grasp. Another benefit of this approach is that it hides implementation details so that they can be changed without touching the application-level code. We'll see an example of this in a future post.
-
-Next time, we'll implement a basic networking layer for our framework. It will serve as a basis for testing and adding support for the real HTTP protocol later on.
-
----
-
-This concludes the second part in the series. Don't forget to grab the code [from GitHub][2]. I'd like to thank [@rafaelfranca][4] and [@josevalim][5] for their valuable suggestions. If you have any questions or corrections, send a message to the [mailing list][3] or join the the **#elixir-lang** channel on **irc.freenode.net**.
-
-See you there.
-
-  [3]: http://groups.google.com/group/elixir-lang-talk
-  [4]: https://github.com/rafaelfranca
-  [5]: https://github.com/josevalim
diff --git a/_posts/2012-05-13-what-s-new-in-elixir-4.markdown b/_posts/2012-05-13-what-s-new-in-elixir-4.markdown
deleted file mode 100644
index 1f6be3b91..000000000
--- a/_posts/2012-05-13-what-s-new-in-elixir-4.markdown
+++ /dev/null
@@ -1,149 +0,0 @@
----
-layout: post
-title: What's New in Elixir  &#35;4
-author: Alexei Sholik
-category: "What's New in Elixir"
-excerpt: Welcome to the new edition of our biweekly series. Elixir development has been progressing at a steady pace and there are quite a few new things we're going to have a look at today.
----
-Welcome to the new edition of our biweekly series. Elixir development has been progressing at a steady pace and there are quite a few new things we're going to have a look at today.
-
-As always, I'm using the latest master (`d28d716de0f2892e31b4bcc9f87549b125075fa5`) to compile and run the code snippets in this post.
-
-## Highlights ##
-
-The [online docs][1] are finally up! This means easier navigation and integrated search. The docs are generated directly from the source, so it's very easy for you to contribute. Simply hit the _Source_ link, author your patch and send a pull request to the main Elixir repo. With GitHub you can do this all without leaving the browser. Any changes improving the documentation are welcome.
-
-The docs are generated with the help of the [ExDoc][0] utility which is itself written in Elixir.
-
-  [0]: https://github.com/elixir-lang/ex_doc
-  [1]: http://elixir-lang.org/docs.html
-
-
-## API Changes ##
-
-### Overridable ###
-
-Overridable is no longer a data attribute, but a macro. This makes it more straightforward to define an overridable function that has multiple clauses of the same arity.
-
-    defmodule DefaultMod do
-      defmacro __using__(_module, _opts) do
-        quote do
-          def test(:x) do
-            IO.puts "This is X"
-          end
-
-          def test(:y) do
-            IO.puts "This is Y"
-          end
-
-          defoverridable [test: 1]
-        end
-      end
-    end
-
-    defmodule InheritMod do
-      use DefaultMod
-
-      def test(:z) do
-        IO.puts "This is Z"
-      end
-    end
-
-    ###
-
-    InheritMod.test :x
-    #=> ** (FunctionClauseError) no function clause matching: InheritMod.test(:x)
-
-    InheritMod.test :y
-    #=> ** (FunctionClauseError) no function clause matching: InheritMod.test(:y)
-
-    InheritMod.test :z
-    #=> This is Z
-
-As you can see, all clauses are being overriden with one new clause. If you want to keep the default clauses, you can use the `super` keyword that is available inside an overriden function definition. So, if we add the following definition
-
-    def test(_) do
-      super
-    end
-
-at the end of `InheritMod`, it would result in the following:
-
-    InheritMod.test :x
-    #=> This is X
-
-    InheritMod.test :y
-    #=> This is Y
-
-    InheritMod.test :z
-    #=> This is Z
-
-Alternatively, if you wanted to keep your function extensible but not overridable, you would do away with the `defoverridable` line altogether. In this case, any new clause defined in `InheritMod` would be just that -- a new clause for the function that already has some number of clauses defined.
-
-## Misc. Stuff ##
-
-* The new `in` keyword has been added to simplify some common patterns. For instance, if you wanted to check for a falsey value, you had to write
-
-      case val do
-        nil ->   # code
-        false -> # code
-        other -> # other_code
-      end
-
-      # or
-
-      case val do
-        x when x == nil or x == false -> # code
-        other -> # other_code
-      end
-
-  Now you can write
-
-      case val do
-        x in [nil, false] -> # code
-        other -> # other_code
-      end
-
-  This new syntax can be used in guards, ordinary conditions, and pattern matching.
-
-* The new [File.exists?][2] function allows you to check if a file object exists in the file system. It can be a regular file, a directory, a socket, etc. If want to check for existence of a regular file, use [File.regular?][3] instead.
-
-  [2]: http://elixir-lang.org/docs/stable/File.html#exists?/1
-  [3]: http://elixir-lang.org/docs/stable/File.html#regular?/1
-
-* The [URI][4] module has got a new function for URL query parsing: [decode_query][5].
-
-      URI.decode_query "key=value&login=password"
-      #=> {Orddict.Record,[{"key","value"},{"login","password"}]}
-
-    Orddict is used by default. You can also pass your own dict
-
-      d = URI.decode_query "key=value&login=password", HashDict.new
-      Dict.get d, "login"
-      #=> "password"
-
-    This function also does percent-decoding for you
-
-      d = URI.decode_query "find=a%20place%20to%20live"
-      Dict.get d, "find"
-      #=> "a place to live"
-
-  [4]: http://elixir-lang.org/docs/stable/URI.html
-  [5]: http://elixir-lang.org/docs/stable/URI.html#decode_query/2
-
-* [OptionParser][6] now supports argument aliases:
-
-      OptionParser.Simple.parse(["-d"], [d: :debug])
-      #=> { [debug: true], [] }
-
-  [6]: http://elixir-lang.org/docs/stable/OptionParser.Simple.html
-
-* Node names are now valid atoms:
-
-      iex> :foo@bar
-      :"foo@bar"
-
----
-
-That's it for this edition. Don't forget to go [read the docs][1] and help us improve them :)
-
-Thank you all and see you next time!
diff --git a/_posts/2012-07-05-what-s-new-in-elixir-5.markdown b/_posts/2012-07-05-what-s-new-in-elixir-5.markdown
deleted file mode 100644
index e4ef398ae..000000000
--- a/_posts/2012-07-05-what-s-new-in-elixir-5.markdown
+++ /dev/null
@@ -1,93 +0,0 @@
----
-layout: post
-title: What's New in Elixir  &#35;5
-author: José Valim
-category: "What's New in Elixir"
-excerpt: The series is back after the first, official 0.5.0 release and we are packed with information!
----
-
-This is our first post from the What's New in Elixir series after [Elixir v0.5.0 was released](http://elixir-lang.org/blog/2012/05/25/elixir-v0-5-0-released/) and we have great improvements to share with you.
-
-Many of these improvements are related to how Elixir handles macros, but we also have the addition of ranges, some performance improvements and other minor changes.
-
-## API Changes ##
-
-### List and bit comprehensions ###
-
-The syntax for list and bit comprehensions was changed slightly to be more explicit and allow a developer to mix generators and filters:
-
-    lc x inlist [1,2,3], rem(x, 2) == 0, y inlist [4,5,6], do: x * y
-    #=> [8,10,12]
-
-### The `__ENV__` pseudo-variable ###
-
-Elixir provides many pseudo-variables that allow you to get information from the source code. For example, with `__MODULE__` you can get the current module name.
-
-In Elixir master, two pseudo-variables were deprecated (`__LINE__` and `__FUNCTION__`) in favor of the `__ENV__` variable. The `__ENV__` variable returns a [`Macro.Env` record](http://elixir-lang.org/docs/master/Macro.Env.html) that contains not only the current line and function but extra information such as the aliases set, macros imported and modules required:
-
-    iex> __ENV__.aliases
-    []
-    iex> alias List, as: L
-    []
-    iex> L.flatten([1,[2],3])
-    [1,2,3]
-    iex> __ENV__.aliases
-    [{L,List}]
-
-Besides the `__ENV__` variable, all macros can also access a `__CALLER__` pseudo-variable that contains the environment information about the caller. With such information, Elixir programmers can create more robust macros, as showed [in this commit which rewrites the `access` macro from Erlang to Elixir](https://github.com/elixir-lang/elixir/commit/088eff4c19614101cea55dfef9966d4de89181e3).
-
-## Performance improvements ##
-
-Regular expressions defined with the macros `%r` and `%R` are now compiled at compilation time instead of runtime, [as seen in this commit](https://github.com/elixir-lang/elixir/commit/646ee5f125601760bcd263105470545e0b7aa7f2). Our benchmarks showed that matching against [the regular expression defined in the URI module](https://github.com/elixir-lang/elixir/blob/ab61e6f95c37a8c0538f349a59be63ca00341b98/lib/uri.ex#L123) got twice faster:
-
-    Regex.match? %r/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/, "http://foo.com/"
-    #=> true
-
-The `Enum` module was also optimized when handling lists. Micro benchmarks show improvements from 1.5 to 4x. Such work was done over many commits throughout the month, but here is [an example of how `Enum.all?` and `Enum.any?` were optimized](https://github.com/elixir-lang/elixir/commit/058f0f66965323ca9e792b5143929ffd7819ed9d).
-
-## New features ##
-
-### Type specifications ###
-
-Elixir master also has shiny new features. Thanks to [Yurii Rashkovskii](https://github.com/yrashk), we now support [Erlang's type specification](http://www.erlang.org/doc/reference_manual/typespec.html):
-
-    @spec add(integer, integer), do: integer
-    def add(a, b), do: a + b
-
-Many tools in the Erlang community, as [dialyzer](http://www.erlang.org/doc/man/dialyzer.html) and [PropEr](https://github.com/manopapad/proper/), use type specifications to give feedback and point out inconsistencies, tests and improvements to your codebase. Supporting type specification is an important milestone which allows Elixir to integrate better with the existing Erlang community.
-
-### Ranges ###
-
-Elixir master has initial support for ranges. Ranges can be created with the operator `..` and integrate nicely with guard clauses. For example, a function that converts a student score to a message could be written as:
-
-    def score_to_message(x) when x in 0..40,   do: "Fail"
-    def score_to_message(x) when x in 41..60,  do: "Pass"
-    def score_to_message(x) when x in 61..70,  do: "Pass with Merit"
-    def score_to_message(x) when x in 71..100, do: "Pass with Distinction"
-
-Ranges can be extended via the range protocol, so developers can use their custom types in ranges and guard clauses too!
-
-### Other improvements ###
-
-There are many other improvements for the upcoming v0.6.0 release, including more robust and complete `IO` and `File` modules, more compilation callbacks with the `@before_compilation` and `@after_compilation` attributes and convenient helpers to work with macros, like `Macro.expand` that expands macros and `Macro.to_binary`, that receives a tree and converts it to its original source code:
-
-    iex> tree = Macro.expand(quote(do: !foo), __ENV__)
-    iex> IO.puts Macro.to_binary(tree)
-    case(foo) do
-      false ->
-        true
-      nil ->
-        true
-      _ ->
-        false
-    end
-
-In the example above, we use `Macro.expand` to expand the expression `!foo` and then print it using `Macro.to_binary`. We can see that the operator `!` is simply a macro that translates the expression to a `case` expression.
-
-## Community ##
-
-Besides improvements to Elixir itself, Elixir's community is also working on tools to make their day-to-day life easier. One of such examples is [genx](https://github.com/yrashk/genx), which provides helpers to work with Erlang OTP behaviors such as `application`, `gen_event` and others.
-
-More importantly, [rebar_elixir_plugin](https://github.com/yrashk/rebar_elixir_plugin) was also released to allow existing Erlang developers to compile Elixir source code using [Rebar](https://github.com/basho/rebar). For those not familar with Rebar, it is a build tool for Erlang projects created by [the good folks at Basho, from Riak fame](http://basho.com/).
-
-Finally, our documentation generation tool [ExDoc](https://github.com/elixir-lang/ex_doc) was improved to include the function signatures and arguments, making it more friendly to developers. [The documentation for Elixir master with those improvements is available here](http://elixir-lang.org/docs/master/). Enjoy!
diff --git a/_posts/2012-11-18-elixir-v0-7-1-released-and-the-end-of-a-journey.markdown b/_posts/2012-11-18-elixir-v0-7-1-released.markdown
similarity index 96%
rename from _posts/2012-11-18-elixir-v0-7-1-released-and-the-end-of-a-journey.markdown
rename to _posts/2012-11-18-elixir-v0-7-1-released.markdown
index 6a5b60ce7..bfe465b6d 100644
--- a/_posts/2012-11-18-elixir-v0-7-1-released-and-the-end-of-a-journey.markdown
+++ b/_posts/2012-11-18-elixir-v0-7-1-released.markdown
@@ -1,6 +1,6 @@
 ---
 layout: post
-title: Elixir v0.7.1 released and the end of a journey
+title: Elixir v0.7.1 released
 author: José Valim
 category: Releases
 excerpt: Elixir v0.7.1 was released to celebrate the end of a two months journey traveling around Europe, United States and Brazil talking about Elixir.
diff --git a/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown b/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown
index 970004c39..717e04aeb 100644
--- a/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown
+++ b/_posts/2013-12-11-elixir-s-new-continuable-enumerators.markdown
@@ -2,7 +2,7 @@
 layout: post
 title: Elixir's new continuable enumerators
 author: Peter Minten
-category: "What's New in Elixir"
+category: Internals
 excerpt: In 0.12.0 Elixir's enumerators have gained the ability to suspend value
          production and to terminate early.
 ---
diff --git a/_posts/2013-12-27-parsing-xml-with-elixir.markdown b/_posts/2013-12-27-parsing-xml-with-elixir.markdown
deleted file mode 100644
index c73d63867..000000000
--- a/_posts/2013-12-27-parsing-xml-with-elixir.markdown
+++ /dev/null
@@ -1,85 +0,0 @@
----
-layout: post
-title: Parsing XML With Elixir
-author: Josh Adams
-category: examples
-excerpt: An example of interoperating with Erlang's built-in `xmerl` library to parse XML.
----
-
-One of the latest episodes of [ElixirSips](http://elixirsips.com/episodes/028_parsing_xml.html)
-provided an example of parsing XML via the built in `xmerl` library in Erlang:
-
-<iframe src="//fast.wistia.net/embed/iframe/pi407o195d" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="640" height="360"></iframe>
-
-Parsing XML is a common need to different applications. The example also show cases
-how to integrate with existing Erlang libraries. You can watch the video for a complete
-rundown where we use tests to explore the `xmerl` library and how we can use it from
-Elixir. If you just want to see the results, here's the test file we ended up with,
-commented for clarity:
-
-```elixir
-# If you want to pattern-match on a record defined in an erlang library, you
-# need to use Record.extract to turn it into an Elixir record data structure.
-# Here, we extract xmlElement and xmlText from xmerl.
-defrecord :xmlElement, Record.extract(:xmlElement, from_lib: "xmerl/include/xmerl.hrl")
-defrecord :xmlText, Record.extract(:xmlText, from_lib: "xmerl/include/xmerl.hrl")
-
-defmodule XmlParsingTest do
-  use ExUnit.Case
-
-  # Here we define some simple XML that we'll work with in our tests.
-  def sample_xml do
-    """
-    <html>
-      <head>
-        <title>XML Parsing</title>
-      </head>
-      <body>
-        <p>Neato</p>
-        <ul>
-          <li>First</li>
-          <li>Second</li>
-        </ul>
-      </body>
-    </html>
-    """
-  end
-
-  test "parsing the title out" do
-    { xml, _rest } = :xmerl_scan.string(bitstring_to_list(sample_xml))
-    [ title_element ] = :xmerl_xpath.string('/html/head/title', xml)
-    [ title_text ] = title_element.content
-    title = title_text.value
-
-    assert title == 'XML Parsing'
-  end
-
-  test "parsing the p tag" do
-    { xml, _rest } = :xmerl_scan.string(bitstring_to_list(sample_xml))
-    [ p_text ] = :xmerl_xpath.string('/html/body/p/text()', xml)
-
-    assert p_text.value == 'Neato'
-  end
-
-  test "parsing the li tags and mapping them" do
-    { xml, _rest } = :xmerl_scan.string(bitstring_to_list(sample_xml))
-    li_texts = :xmerl_xpath.string('/html/body/ul/li/text()', xml)
-    texts = li_texts |> Enum.map(fn(x) -> x.value end)
-
-    assert texts == ['First', 'Second']
-  end
-end
-```
-
-The project built in the episode is also
-[available for download](http://elixirsips.com/downloads/028_parsing_xml.tar.gz).
-
-## Resources
-
-- [xmerl user guide](http://www.erlang.org/doc/apps/xmerl/xmerl_ug.html)
-- [xmerl manual](http://www.erlang.org/doc/man/xmerl_scan.html)
-- [erlsom](https://github.com/willemdj/erlsom)
-- [exml](https://github.com/paulgray/exml)
-- [Differences between Erlang and Elixir records](http://elixir-lang.org/crash-course.html#notable_differences) - See the 'Records' section.
-- [Dave Thomas on parsing XML in Erlang](http://pragdave.pragprog.com/pragdave/2007/04/a_first_erlang_.html)
-- [`xmlElement` record](https://github.com/erlang/otp/blob/maint/lib/xmerl/include/xmerl.hrl#L73-L85)

From 732656f8b07cd3f69122bb73d6e82a86ab3626f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Fri, 21 Feb 2014 20:35:37 +0100
Subject: [PATCH 038/160] Cut the gibberish in the introduction

---
 index.html | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/index.html b/index.html
index da9c0aebe..27488467d 100644
--- a/index.html
+++ b/index.html
@@ -9,16 +9,10 @@
 
     <div class="entry-summary">
       <p>Elixir is a functional, meta-programming aware language built on top of the Erlang VM. It is a dynamic language with flexible syntax and macro support that leverages Erlang's abilities to build concurrent, distributed and fault-tolerant applications with hot code upgrades.</p>
-      <p>Elixir also provides first-class support for pattern matching, polymorphism via protocols (similar to Clojure's), aliases and associative data structures (usually known as dicts or hashes in other programming languages).</p>
-      <p>Finally, Elixir and Erlang share the same bytecode and data types. This means you can invoke Erlang code from Elixir (and vice-versa) without any conversion or performance hit. This allows a developer to mix the expressiveness of Elixir with the robustness and performance of Erlang.</p>
-      <p>To install Elixir or learn more about it, check our <a href="/getting_started/1.html">getting started guide</a>. We also have <a href="/docs.html">online documentation available</a> and a <a href="/crash-course.html">Crash Course for Erlang developers</a>.</p>
+      <p>To install Elixir or learn more about it, check our <a href="/getting_started/1.html">getting started guide</a>. We also have <a href="/docs.html">online documentation available</a> and a <a href="/crash-course.html">Crash Course for Erlang developers</a>. Or you can just keep on reading for a few code samples!</p>
     </div>
   </div>
 
-  <div class="hentry post">
-    <h3>Highlights</h3>
-  </div>
-
   <div class="hentry post">
     <h4>Everything is an expression</h4>
     <div class="entry-summary">

From 80866559cb86b6d6143b27018e5abeac9f1c2e26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Fri, 21 Feb 2014 20:54:23 +0100
Subject: [PATCH 039/160] Let's talk about the tooling too

---
 index.html | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/index.html b/index.html
index 27488467d..b1026cbee 100644
--- a/index.html
+++ b/index.html
@@ -142,6 +142,45 @@ <h4>Pattern matching</h4>
     </div>
   </div>
 
+  <div class="hentry post">
+    <h4>Tooling included</h4>
+
+    <div class="entry-summary">
+      <p>Elixir ships with a great set of tools to ease development. Mix allows you to easily create your new project, manage tasks and dependencies:</p>
+
+{% highlight text %}
+$ mix new my_app
+$ cd my_app
+$ mix test
+.
+
+Finished in 0.04 seconds (0.04s on load, 0.00s on tests)
+1 tests, 0 failures
+{% endhighlight %}
+
+      <p>In the example above, we have created a new project and ran its initial test suite powered by the ExUnit test framework.</p>
+
+      <p>Elixir also ships with an Interactive Shell, called IEx, which provides a great set of helpers for writing code, like easy access to documentation (shown above), code reloading and so on. It is also great companion for production, as it allows, for example, connecting to remote nodes. Here is a quick example you can try locally. In one terminal, do:</p>
+
+{% highlight text %}
+$ iex --name hello
+iex(hello@machine)1> defmodule Hello do
+...(hello@machine)1>   def world, do: IO.puts "Distributed hello world"
+...(hello@machine)1> end
+{% endhighlight %}
+
+      <p>See the name in between parenthesis starting with hello? Copy that, open up another terminal and pass it to <code>--remsh</code> (short for remote shell):</p>
+
+{% highlight text %}
+$ iex --name world --remsh "hello@machine"
+iex(hello@machine)1> Hello.world
+"Distributed hello world"
+{% endhighlight %}
+
+      <p>Notice we were able to invoke a function from a module defined in the other terminal! Even the node names are the same. This will work in between machines in the same network as long as they have the same value in the <code>~/.erlang.cookie</code> file!</p>
+    </div>
+  </div>
+
   <div class="hentry post">
     <h4>Erlang all the way down</h4>
 

From 8b5b197847e1e1d0e50a3b5dff3c752210dd078b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Fri, 21 Feb 2014 20:35:37 +0100
Subject: [PATCH 040/160] Cut the gibberish in the introduction

---
 index.html | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/index.html b/index.html
index da9c0aebe..27488467d 100644
--- a/index.html
+++ b/index.html
@@ -9,16 +9,10 @@
 
     <div class="entry-summary">
       <p>Elixir is a functional, meta-programming aware language built on top of the Erlang VM. It is a dynamic language with flexible syntax and macro support that leverages Erlang's abilities to build concurrent, distributed and fault-tolerant applications with hot code upgrades.</p>
-      <p>Elixir also provides first-class support for pattern matching, polymorphism via protocols (similar to Clojure's), aliases and associative data structures (usually known as dicts or hashes in other programming languages).</p>
-      <p>Finally, Elixir and Erlang share the same bytecode and data types. This means you can invoke Erlang code from Elixir (and vice-versa) without any conversion or performance hit. This allows a developer to mix the expressiveness of Elixir with the robustness and performance of Erlang.</p>
-      <p>To install Elixir or learn more about it, check our <a href="/getting_started/1.html">getting started guide</a>. We also have <a href="/docs.html">online documentation available</a> and a <a href="/crash-course.html">Crash Course for Erlang developers</a>.</p>
+      <p>To install Elixir or learn more about it, check our <a href="/getting_started/1.html">getting started guide</a>. We also have <a href="/docs.html">online documentation available</a> and a <a href="/crash-course.html">Crash Course for Erlang developers</a>. Or you can just keep on reading for a few code samples!</p>
     </div>
   </div>
 
-  <div class="hentry post">
-    <h3>Highlights</h3>
-  </div>
-
   <div class="hentry post">
     <h4>Everything is an expression</h4>
     <div class="entry-summary">

From 617776a60a2544df4016798322464230384f25aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Fri, 21 Feb 2014 20:54:23 +0100
Subject: [PATCH 041/160] Let's talk about the tooling too

---
 index.html | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/index.html b/index.html
index 27488467d..b1026cbee 100644
--- a/index.html
+++ b/index.html
@@ -142,6 +142,45 @@ <h4>Pattern matching</h4>
     </div>
   </div>
 
+  <div class="hentry post">
+    <h4>Tooling included</h4>
+
+    <div class="entry-summary">
+      <p>Elixir ships with a great set of tools to ease development. Mix allows you to easily create your new project, manage tasks and dependencies:</p>
+
+{% highlight text %}
+$ mix new my_app
+$ cd my_app
+$ mix test
+.
+
+Finished in 0.04 seconds (0.04s on load, 0.00s on tests)
+1 tests, 0 failures
+{% endhighlight %}
+
+      <p>In the example above, we have created a new project and ran its initial test suite powered by the ExUnit test framework.</p>
+
+      <p>Elixir also ships with an Interactive Shell, called IEx, which provides a great set of helpers for writing code, like easy access to documentation (shown above), code reloading and so on. It is also great companion for production, as it allows, for example, connecting to remote nodes. Here is a quick example you can try locally. In one terminal, do:</p>
+
+{% highlight text %}
+$ iex --name hello
+iex(hello@machine)1> defmodule Hello do
+...(hello@machine)1>   def world, do: IO.puts "Distributed hello world"
+...(hello@machine)1> end
+{% endhighlight %}
+
+      <p>See the name in between parenthesis starting with hello? Copy that, open up another terminal and pass it to <code>--remsh</code> (short for remote shell):</p>
+
+{% highlight text %}
+$ iex --name world --remsh "hello@machine"
+iex(hello@machine)1> Hello.world
+"Distributed hello world"
+{% endhighlight %}
+
+      <p>Notice we were able to invoke a function from a module defined in the other terminal! Even the node names are the same. This will work in between machines in the same network as long as they have the same value in the <code>~/.erlang.cookie</code> file!</p>
+    </div>
+  </div>
+
   <div class="hentry post">
     <h4>Erlang all the way down</h4>
 

From b4c625cd1c54db5ac424509c722779eacf455bc4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Fri, 21 Feb 2014 21:08:59 +0100
Subject: [PATCH 042/160] Have a specific section for remote shells

---
 css/style.css |  2 +-
 index.html    | 16 +++++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/css/style.css b/css/style.css
index 925855b29..62d7c699e 100644
--- a/css/style.css
+++ b/css/style.css
@@ -404,7 +404,6 @@ a:hover img, #slider-nav li a:hover img { opacity: 0.85; }
   border: 1px solid #e5e5e5;
 }
 .rss-button { margin-bottom: 25px; }
-img.no-border { border: 0 };
 
 /* Layout
 -------------------------------------------------------------- */
@@ -568,6 +567,7 @@ body.source           div.menu li.source          a {
   height: 150px;
   margin: 3px 25px 20px 0;
 }
+.no-border { border: 0 };
 
 /* Post titles
 -------------------------------------------------------------- */
diff --git a/index.html b/index.html
index b1026cbee..439cbb969 100644
--- a/index.html
+++ b/index.html
@@ -4,7 +4,7 @@
 ---
 
 <div class="hfeed">
-  <div class="hentry post">
+  <div class="hentry post no-border">
     <img src="/images/contents/home-code.png" alt="Elixir Sample" class="archive-thumbnail" />
 
     <div class="entry-summary">
@@ -13,6 +13,10 @@
     </div>
   </div>
 
+  <div class="hentry post">
+    <h3>Language highlights</h3>
+  </div>
+
   <div class="hentry post">
     <h4>Everything is an expression</h4>
     <div class="entry-summary">
@@ -159,8 +163,14 @@ <h4>Tooling included</h4>
 {% endhighlight %}
 
       <p>In the example above, we have created a new project and ran its initial test suite powered by the ExUnit test framework.</p>
+    </div>
+  </div>
+
+  <div class="hentry post">
+    <h4>Interactive (and remote) shells</h4>
 
-      <p>Elixir also ships with an Interactive Shell, called IEx, which provides a great set of helpers for writing code, like easy access to documentation (shown above), code reloading and so on. It is also great companion for production, as it allows, for example, connecting to remote nodes. Here is a quick example you can try locally. In one terminal, do:</p>
+    <div class="entry-summary">
+      <p>Elixir also ships with an Interactive Shell, called IEx, which provides a great set of helpers for writing code, like easy access to documentation (shown above), code reloading and so on. It is also a great companion for production, as it allows for example connecting to remote nodes. Here is a quick example you can try locally. In one terminal, do:</p>
 
 {% highlight text %}
 $ iex --name hello
@@ -185,7 +195,7 @@ <h4>Tooling included</h4>
     <h4>Erlang all the way down</h4>
 
     <div class="entry-summary">
-      <p>After all, Elixir is still Erlang. An Elixir programmer can invoke any Erlang function with no runtime cost:</p>
+      <p>After all, Elixir runs in the Erlang VM. An Elixir programmer can invoke any Erlang function with no runtime cost:</p>
 
 {% highlight elixir %}
 :application.start(:crypto)

From 3e9b4c4e3aa6dface1f8491417ad7e489b2ab812 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Fri, 21 Feb 2014 21:08:59 +0100
Subject: [PATCH 043/160] Have a specific section for remote shells

---
 css/style.css |  2 +-
 index.html    | 16 +++++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/css/style.css b/css/style.css
index 925855b29..62d7c699e 100644
--- a/css/style.css
+++ b/css/style.css
@@ -404,7 +404,6 @@ a:hover img, #slider-nav li a:hover img { opacity: 0.85; }
   border: 1px solid #e5e5e5;
 }
 .rss-button { margin-bottom: 25px; }
-img.no-border { border: 0 };
 
 /* Layout
 -------------------------------------------------------------- */
@@ -568,6 +567,7 @@ body.source           div.menu li.source          a {
   height: 150px;
   margin: 3px 25px 20px 0;
 }
+.no-border { border: 0 };
 
 /* Post titles
 -------------------------------------------------------------- */
diff --git a/index.html b/index.html
index b1026cbee..439cbb969 100644
--- a/index.html
+++ b/index.html
@@ -4,7 +4,7 @@
 ---
 
 <div class="hfeed">
-  <div class="hentry post">
+  <div class="hentry post no-border">
     <img src="/images/contents/home-code.png" alt="Elixir Sample" class="archive-thumbnail" />
 
     <div class="entry-summary">
@@ -13,6 +13,10 @@
     </div>
   </div>
 
+  <div class="hentry post">
+    <h3>Language highlights</h3>
+  </div>
+
   <div class="hentry post">
     <h4>Everything is an expression</h4>
     <div class="entry-summary">
@@ -159,8 +163,14 @@ <h4>Tooling included</h4>
 {% endhighlight %}
 
       <p>In the example above, we have created a new project and ran its initial test suite powered by the ExUnit test framework.</p>
+    </div>
+  </div>
+
+  <div class="hentry post">
+    <h4>Interactive (and remote) shells</h4>
 
-      <p>Elixir also ships with an Interactive Shell, called IEx, which provides a great set of helpers for writing code, like easy access to documentation (shown above), code reloading and so on. It is also great companion for production, as it allows, for example, connecting to remote nodes. Here is a quick example you can try locally. In one terminal, do:</p>
+    <div class="entry-summary">
+      <p>Elixir also ships with an Interactive Shell, called IEx, which provides a great set of helpers for writing code, like easy access to documentation (shown above), code reloading and so on. It is also a great companion for production, as it allows for example connecting to remote nodes. Here is a quick example you can try locally. In one terminal, do:</p>
 
 {% highlight text %}
 $ iex --name hello
@@ -185,7 +195,7 @@ <h4>Tooling included</h4>
     <h4>Erlang all the way down</h4>
 
     <div class="entry-summary">
-      <p>After all, Elixir is still Erlang. An Elixir programmer can invoke any Erlang function with no runtime cost:</p>
+      <p>After all, Elixir runs in the Erlang VM. An Elixir programmer can invoke any Erlang function with no runtime cost:</p>
 
 {% highlight elixir %}
 :application.start(:crypto)

From 32dd1c1f51cf1a10c264a9e87fae3e82056a3c66 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Fri, 21 Feb 2014 21:12:55 +0100
Subject: [PATCH 044/160] Add img.no-border back

---
 css/style.css | 1 +
 1 file changed, 1 insertion(+)

diff --git a/css/style.css b/css/style.css
index 62d7c699e..b5013362f 100644
--- a/css/style.css
+++ b/css/style.css
@@ -404,6 +404,7 @@ a:hover img, #slider-nav li a:hover img { opacity: 0.85; }
   border: 1px solid #e5e5e5;
 }
 .rss-button { margin-bottom: 25px; }
+img.no-border { border: 0 };
 
 /* Layout
 -------------------------------------------------------------- */

From aee050da35afcd95bf5a44a0be833b43d8715647 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Fri, 21 Feb 2014 21:12:55 +0100
Subject: [PATCH 045/160] Add img.no-border back

---
 css/style.css | 1 +
 1 file changed, 1 insertion(+)

diff --git a/css/style.css b/css/style.css
index 62d7c699e..b5013362f 100644
--- a/css/style.css
+++ b/css/style.css
@@ -404,6 +404,7 @@ a:hover img, #slider-nav li a:hover img { opacity: 0.85; }
   border: 1px solid #e5e5e5;
 }
 .rss-button { margin-bottom: 25px; }
+img.no-border { border: 0 };
 
 /* Layout
 -------------------------------------------------------------- */

From a164ccc7fc8c0d9c578aacceb73b1f6328f36fd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sat, 22 Feb 2014 13:35:52 +0100
Subject: [PATCH 046/160] Start getting started guide rewrite

---
 _layouts/getting_started.html |  18 +-
 getting_started/1.markdown    | 258 +-----------
 getting_started/2.markdown    | 711 +++++++---------------------------
 getting_started/3.markdown    | 492 ++++-------------------
 getting_started/4.markdown    | 378 ++++--------------
 getting_started/5.markdown    | 300 --------------
 getting_started/6.markdown    | 292 --------------
 getting_started/7.markdown    |  51 ---
 8 files changed, 327 insertions(+), 2173 deletions(-)
 delete mode 100644 getting_started/5.markdown
 delete mode 100644 getting_started/6.markdown
 delete mode 100644 getting_started/7.markdown

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index cfcb93ce3..db79a77a6 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -1,5 +1,6 @@
 ---
 section: getting_started
+total_guides: 4
 ---
 
 {% include top.html %}
@@ -10,13 +11,10 @@
   <div class="widget">
     <h3 class="widget-title">Index</h3>
     <ol>
-      <li><a class="spec" href="/getting_started/1.html">Introduction</a></li>
-      <li><a class="spec" href="/getting_started/2.html">Diving in</a></li>
-      <li><a class="spec" href="/getting_started/3.html">Modules</a></li>
-      <li><a class="spec" href="/getting_started/4.html">Records, Protocols &amp; Exceptions</a></li>
-      <li><a class="spec" href="/getting_started/5.html">Macros</a></li>
-      <li><a class="spec" href="/getting_started/6.html">Other topics</a></li>
-      <li><a class="spec" href="/getting_started/7.html">Where to go next</a></li>
+      <li><a class="spec" href="/getting_started/1.html">Interactive Elixir (IEx)</a></li>
+      <li><a class="spec" href="/getting_started/2.html">Basic types</a></li>
+      <li><a class="spec" href="/getting_started/3.html">Basic operators</a></li>
+      <li><a class="spec" href="/getting_started/4.html">Pattern matching</a></li>
     </ol>
   </div>
   <div class="widget">
@@ -33,12 +31,6 @@ <h3 class="widget-title">ExUnit - a unit test framework</h3>
       <li><a class="spec" href="/getting_started/ex_unit/1.html">Introduction to ExUnit</a></li>
     </ol>
   </div>
-  <div class="widget">
-    <h3 class="widget-title">Other</h3>
-    <ol>
-      <li><a class="spec" href="/crash-course.html">Erlang/Elixir Syntax: A Crash Course</a></li>
-    </ol>
-  </div>
 
   {% include learning-resources.html %}
   {% include sponsors.html %}
diff --git a/getting_started/1.markdown b/getting_started/1.markdown
index f352e1ba3..3040b6b6c 100644
--- a/getting_started/1.markdown
+++ b/getting_started/1.markdown
@@ -1,35 +1,34 @@
 ---
 layout: getting_started
-title: 1 Introduction
+title: 1 Interactive Elixir
 guide: 1
-total_guides: 7
 ---
 
 # {{ page.title }}
 
-Welcome! In this tutorial we are going to show you how to get started with Elixir. We will start with how to install Elixir, how to use its interactive shell, basic data types and operators. In later chapters, we are going to discuss more advanced subjects such as macros, protocols and other features provided by Elixir.
+Welcome!
 
-To see Elixir in action, check out these introductory screencasts by Dave Thomas. The first one, [Nine Minutes of Elixir](http://www.youtube.com/watch?v=hht9s6nAAx8), provides a brief tour of the language. The second one is a 30-minute [introduction to Elixir](http://www.youtube.com/watch?v=a-off4Vznjs) that'll help you get started writing your first functions and creating your first processes in Elixir. Be sure to follow the next section of this guide to install Elixir on your machine and then follow along with the videos.
+In this tutorial we are going to show you how to get started with Elixir. This chapter will cover installation and how to get started with the Interactive Elixir shell called IEx.
 
-PeepCode also has a two hour video with Jos&eacute; Valim called [Meet Elixir](https://peepcode.com/products/elixir).
+If you find any errors in the tutorial or in the website, [please report a bug or send a pull request to our issues tracker](https://github.com/elixir-lang/elixir-lang.github.com). If you suspect it is a language bug, [please let us know in the language issues tracker](https://github.com/elixir-lang/elixir/issues).
 
-Keep in mind that Elixir is still in development, so if at any point you receive an error message and you are not sure how to proceed, [please let us know in the issues tracker](https://github.com/elixir-lang/elixir/issues). Having explanative and consistent error messages is one of the many features we aim for in Elixir.
+Let's get started!
 
-## 1.1 Installation
+## 1.1 Installing Erlang
 
-The only prerequisite for Elixir is Erlang, version R16B or later, which can be easily installed with [Precompiled packages](https://www.erlang-solutions.com/downloads/download-erlang-otp). In case you want to install it directly from source, it can be found on [the Erlang website](http://www.erlang.org/download.html) or by following the excellent tutorial available in the [Riak documentation](http://docs.basho.com/riak/1.3.0/tutorials/installation/Installing-Erlang/).
+The only prerequisite for Elixir is Erlang, version 17.0 or later, which can be easily installed with [Precompiled packages](https://www.erlang-solutions.com/downloads/download-erlang-otp). In case you want to install it directly from source, it can be found on [the Erlang website](http://www.erlang.org/download.html) or by following the excellent tutorial available in the [Riak documentation](http://docs.basho.com/riak/1.3.0/tutorials/installation/Installing-Erlang/).
 
 For Windows developers, we recommend the precompiled packages. Those on a UNIX platform can probably get Erlang installed via one of the many package management tools.
 
 After Erlang is installed, you should be able to open up the command line (or command prompt) and check the Erlang version by typing `erl`. You will see some information as follows:
 
-    Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
+    Erlang/OTP 17 (erts-6) [64-bit] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]
 
-Notice that depending on how you installed Erlang, it will not add Erlang binaries to your environment. Be sure to have Erlang binaries in your [PATH](http://en.wikipedia.org/wiki/Environment_variable), otherwise Elixir won't work!
+Notice that depending on how you installed Erlang, Erlang binaries won't be available in your PATH. Be sure to have Erlang binaries in your [PATH](http://en.wikipedia.org/wiki/Environment_variable), otherwise Elixir won't work!
 
 After Erlang is up and running, it is time to install Elixir. You can do that via Distributions, Precompiled package or Compiling from Source.
 
-### 1.1.1 Distributions
+### 1.2 Distributions
 
 This tutorial requires Elixir v0.12.4 or later and it may be available in some distributions:
 
@@ -50,11 +49,11 @@ This tutorial requires Elixir v0.12.4 or later and it may be available in some d
 
 If you don't use any of the distributions above, don't worry, we also provide a precompiled package!
 
-### 1.1.2 Precompiled package
+### 1.3 Precompiled package
 
 Elixir provides a [precompiled package for every release](https://github.com/elixir-lang/elixir/releases/). After downloading and unzip-ing the package, you are ready to run the `elixir` and `iex` commands from the `bin` directory. It is recommended that you also add Elixir's `bin` path to your PATH environment variable to ease development.
 
-### 1.1.3 Compiling from source (Unix and MinGW)
+### 1.4 Compiling from source (Unix and MinGW)
 
 You can download and compile Elixir in few steps. You can get the [latest stable release here](https://github.com/elixir-lang/elixir/releases/), unpack it and then run `make` inside the unpacked directory. After that, you are ready to run the `elixir` and `iex` commands from the `bin` directory. It is recommended that you add Elixir's `bin` path to your PATH environment variable to ease development:
 
@@ -68,240 +67,17 @@ In case you are feeling a bit more adventurous, you can also compile from master
 
 If the tests pass, you are ready to go. Otherwise, feel free to open an issue [in the issues tracker on Github](https://github.com/elixir-lang/elixir).
 
-## 1.2 Interactive mode
+## 1.5 Interactive mode
 
 When you install Elixir, you will have three new executables: `iex`, `elixir` and `elixirc`. If you compiled Elixir from source or are using a packaged version, you can find these inside the `bin` directory.
 
 For now, let's start by running `iex` which stands for Interactive Elixir. In interactive mode, we can type any Elixir expression and get its result straight away. Let's warm up with some basic arithmetic expressions:
 
-```iex
-iex> 1 + 1
-2
-iex> 10 - 5
-5
-iex> 10 / 2
-5.0
-```
-
-Notice `10 / 2` returned a float `5.0` instead of an integer. This is expected. In Elixir the operator `/` always returns a float. If you want to do integer division or get the division remainder, you can invoke the `div` and `rem` functions:
-
-```iex
-iex> div(10, 2)
-5
-iex> div 10, 2
-5
-iex> rem 10, 3
-1
-```
-
-In the example above, we called two functions called `div` and `rem`. Notice that parentheses are not required in order to invoke a function. We are going to discuss more about this later. Let's move forward and see what other data types we have in Elixir.
-
-## 1.3 Basic types
-
-Some basic types are:
-
-```iex
-iex> 1          # integer
-iex> 0x1F       # integer
-iex> 1.0        # float
-iex> :atom      # atom / symbol
-iex> {1,2,3}    # tuple
-iex> [1,2,3]    # list
-iex> <<1,2,3>>  # bitstring
-```
-
-Elixir by default imports many functions to work on these types:
+```text
+Interactive Elixir - press Ctrl+C to exit (type h() ENTER for help)
 
-```iex
-iex> size { 1, 2, 3 }
-3
-
-iex> length [ 1, 2, 3 ]
-3
-```
-
-Elixir also supports UTF-8 encoded strings:
-
-```iex
-iex> "hellö"
-"hellö"
-```
-
-Strings support interpolation, too:
-
-```iex
-iex> name = "world"
-iex> "hello #{name}"
+iex> "hello" <> " world"
 "hello world"
 ```
 
-At the end of the day, strings are nothing more than a bunch of bytes packed together. We can verify this using the `is_binary` function:
-
-```iex
-iex> is_binary("hello")
-true
-iex> byte_size("hello")
-5
-```
-
-And a binary is nothing more than a bunch of bits packed together:
-
-```iex
-iex> is_bitstring("hello")
-true
-iex> bit_size("hello")
-40
-```
-
-Elixir allows you to create "raw" binaries too. Let's create a binary with three null bytes:
-
-```iex
-iex> is_binary <<0, 0, 0>>
-true
-```
-
-Note that a single-quoted expression in Elixir is a char list and is not the same as a double-quoted one:
-
-```iex
-iex> is_binary('hello')
-false
-iex> is_list('hello')
-true
-```
-
-We will go into more details about char lists in the next chapter. Elixir also provides `true` and `false` as booleans:
-
-```iex
-iex> true
-true
-iex> is_boolean false
-true
-```
-
-Booleans are represented internally as atoms:
-
-```iex
-iex> is_atom(true)
-true
-```
-
-Elixir also provides anonymous functions (note the dot between the variable and arguments when calling an anonymous function):
-
-```iex
-# function
-iex> x = fn(a, b) -> a + b end
-#Fun<erl_eval.12.111823515>
-iex> x.(1, 2)
-3
-```
-
-Elixir also provides `Port`, `Reference`s and `PID`s as data types (usually used in process communication), but they are out of the scope of a getting started tutorial. For now, let's take a look at the basic operators in Elixir before we move on to the next chapter.
-
-## 1.4 Operators
-
-As we saw earlier, Elixir provides `+`, `-`, `*`, `/` as arithmetic operators.
-
-Elixir also provides `++` and `--` to manipulate lists:
-
-```iex
-iex> [1,2,3] ++ [4,5,6]
-[1,2,3,4,5,6]
-iex> [1,2,3] -- [2]
-[1,3]
-```
-
-String concatenation is done via `<>`:
-
-```iex
-iex> "foo" <> "bar"
-"foobar"
-```
-
-Elixir also provides three boolean operators: `or`, `and` and `not`. These operators are strict in the sense that they expect a boolean (`true` or `false`) as their first argument:
-
-```iex
-iex> true and true
-true
-iex> false or is_atom(:example)
-true
-```
-
-Providing a non-boolean will raise an exception:
-
-```iex
-iex> 1 and true
-** (ArgumentError) argument error
-```
-
-`or` and `and` are short-circuit operators. They only execute the right side if the left side is not enough to determine the result:
-
-```iex
-iex> false and error("This error will never be raised")
-false
-
-iex> true or error("This error will never be raised")
-true
-```
-
-> Note: If you are an Erlang developer, `and` and `or` in Elixir actually map to the `andalso` and `orelse` operators in Erlang.
-
-Besides these boolean operators, Elixir also provides `||`, `&&` and `!` which accept arguments of any type. For these operators, all values except `false` and `nil` will evaluate to true:
-
-```iex
-# or
-iex> 1 || true
-1
-iex> false || 11
-11
-
-# and
-iex> nil && 13
-nil
-iex> true && 17
-17
-
-# !
-iex> !true
-false
-iex> !1
-false
-iex> !nil
-true
-```
-
-As a rule of thumb, use `and`, `or` and `not` when you are expecting booleans. If any of the arguments are non-boolean, use `&&`, `||` and `!`.
-
-Elixir also provides `==`, `!=`, `===`, `!==`, `<=`, `>=`, `<` and `>` as comparison operators:
-
-```iex
-iex> 1 == 1
-true
-iex> 1 != 2
-true
-iex> 1 < 2
-true
-```
-
-The difference between `==` and `===` is that the latter is more strict when comparing integers and floats:
-
-```iex
-iex> 1 == 1.0
-true
-iex> 1 === 1.0
-false
-```
-
-In Elixir, we can compare two different data types:
-
-```iex
-iex> 1 < :atom
-true
-```
-
-The reason we can compare different data types is for pragmatism. Sorting algorithms don't need to worry about different data types in order to sort. The overall sorting order is defined below:
-
-    number < atom < reference < functions < port < pid < tuple < list < bitstring
-
-You don't actually need to memorize this ordering, but it is important just to know an order exists.
-
-Well, that is it for the introduction. In the next chapter, we are going to discuss some basic functions, data types conversions and a bit of control-flow.
+It seems we are ready to go! We will use the interactive shell quite a lot in the next chapters to get a bit more familiar with the language constructs and basic types, starting in the next chapter.
diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 67175adbb..c0d76d4d0 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -1,697 +1,286 @@
 ---
 layout: getting_started
-title: 2 Diving in
+title: 2 Basic types
 guide: 2
-total_guides: 7
 ---
 
 # {{ page.title }}
 
-In this chapter we'll go a bit deeper into the basic data-types, learn some control flow mechanisms and talk about anonymous functions.
-
-## 2.1 Lists and tuples
-
-Elixir provides both lists and tuples:
-
- ```iex
-iex> is_list [1,2,3]
-true
-iex> is_tuple {1,2,3}
-true
-```
-
-While both are used to store items, they differ on how those items are stored in memory. Lists are implemented as linked lists (where each item in the list points to the next item) while tuples are stored contiguously in memory.
-
-This means that accessing a tuple element is very fast (constant time) and can be achieved using the `elem` function:
-
- ```iex
-iex> elem { :a, :b, :c }, 0
-:a
- ```
-
-On the other hand, updating a tuple is expensive as it needs to duplicate the tuple contents in memory. Updating a tuple can be done with the `set_elem` function:
+In this chapter we will learn more about Elixir basic types: integers, floats, atoms, lists and strings. Some basic types are:
 
 ```iex
-iex> set_elem { :a, :b, :c }, 0, :d
-{:d,:b,:c}
- ```
+iex> 1          # integer
+iex> 0x1F       # integer
+iex> 1.0        # float
+iex> :atom      # atom / symbol
+iex> "elixir"   # string
+iex> [1, 2, 3]  # list
+iex> {1, 2, 3}  # tuple
+```
 
-> Note: If you are an Erlang developer, you will notice that we used the `elem` and `set_elem` functions instead of Erlang's `element` and `setelement`. The reason for this choice is that Elixir attempts to normalize Erlang API's to always receive the "subject" of the function as the first argument and employ zero-based access.
+## 2.1 Basic arithmetic
 
-Since updating a tuple is expensive, when we want to add or remove elements, we use lists. Since lists are linked, it means accessing the first element of the list is very cheap. Accessing the n-th element, however, will require the algorithm to pass through n-1 nodes before reaching the n-th. We can access the `head` of the list as follows:
+Open up `iex`  and type the following expressions:
 
 ```iex
-# Match the head and tail of the list
-iex> [head | tail] = [1,2,3]
-[1,2,3]
-iex> head
-1
-iex> tail
-[2,3]
-
-# Put the head and the tail back together
-iex> [head | tail]
-[1,2,3]
-iex> length [head | tail]
+iex> 1 + 2
 3
+iex> 5 * 5
+25
+iex> 10 / 2
+5.0
 ```
 
-In the example above, we have matched the head of the list to the variable `head` and the tail of the list to the variable `tail`. This is called **pattern matching**. We can also pattern match tuples:
+Notice `10 / 2` returned a float `5.0` instead of an integer. This is expected. In Elixir the operator `/` always returns a float. If you want to do integer division or get the division remainder, you can invoke the `div` and `rem` functions:
 
 ```iex
-iex> { a, b, c } = { :hello, "world", 42 }
-{ :hello, "world", 42 }
-iex> a
-:hello
-iex> b
-"world"
+iex> div(10, 2)
+5
+iex> div 10, 2
+5
+iex> rem 10, 3
+1
 ```
 
-A pattern match will error in case the sides can't match. This is, for example, the case when the tuples have different sizes:
+Notice that parentheses are not required in order to invoke a function.
+
+Elixir also supports shorcut notations for entering binaries, octals and hexadecimal numbers:
 
 ```iex
-iex> { a, b, c } = { :hello, "world" }
-** (MatchError) no match of right hand side value: {:hello,"world"}
+iex> 0x1F
+31
+iex> 0777
+511
+iex> 0b1010
+10
 ```
 
-And also when comparing different types:
+Float numbers require a dot followed by at least one digit and also support `e` for the exponent number:
 
 ```iex
-iex> { a, b, c } = [:hello, "world", '!']
-** (MatchError) no match of right hand side value: [:hello,"world",'!']
+iex> 1.0
+1.0
+iex> 1.0e-10
+1.0e-10
 ```
 
-More interestingly, we can match on specific values. The example below asserts that the left side will only match the right side in case that the right side is a tuple that starts with the atom `:ok` as a key:
+Floats in Elixir are double precision, accurate up to 16 digits.
 
-```iex
-iex> { :ok, result } = { :ok, 13 }
-{:ok,13}
-iex> result
-13
-
-iex> { :ok, result } = { :error, :oops }
-** (MatchError) no match of right hand side value: {:error,:oops}
-```
+## 2.2 Booleans
 
-Pattern matching allows developers to easily destruct data types such as tuples and lists. As we will see in following chapters, it is one of the foundations of recursion in Elixir. However, in case you can't wait to iterate through and manipulate your lists, the [`Enum` module](/docs/stable/Enum.html) provides several helpers to manipulate lists (and other enumerables in general) while the [`List` module](/docs/stable/List.html) provides several helpers specific to lists:
+Elixir supports `true` and `false` as booleans.
 
 ```iex
-iex> Enum.at [1,2,3], 0
-1
-iex> List.flatten [1,[2],3]
-[1,2,3]
+iex> true
+true
+iex> true == false
+false
 ```
 
-## 2.2 Keyword lists
-
-Elixir also provides a special syntax to create a list of keywords. They can be created as follows:
+Elixir provides a bunch of predicate functions to check for a value type. For example, the `is_boolean/1` function can be used to check if a value is a boolean or not:
 
 ```iex
-iex> [a: 1, b: 2]
-[a: 1, b: 2]
+iex> is_boolean(true)
+true
+iex> is_boolean(1)
+false
 ```
 
-Keyword lists are nothing more than a list of two element tuples where the first element of the tuple is an atom:
+Throughout this tutorial and in Elixir documentation, you will see functions mentioned in the format `is_boolean/1`. The first part is the function name and the number is its arity, i.e. the number of arguments the function expects.
 
- ```iex
-iex> [head | tail] = [a: 1, b: 2]
-[a: 1, b: 2]
-iex> head
-{ :a, 1 }
-```
+You can also use `is_integer/1`, `is_float/1` or `is_number/1` to check if an argument is an integer, float or any of them.
 
-The [`Keyword` module](/docs/stable/Keyword.html) contains several functions that allow you to manipulate a keyword list ignoring duplicated entries or not. For example:
+## 2.3 Atoms
 
- ```iex
-iex> keywords = [foo: 1, bar: 2, foo: 3]
-iex> Keyword.get keywords, :foo
-1
-iex> Keyword.get_values keywords, :foo
-[1,3]
-```
-
-Since keyword lists are very frequently passed as arguments, they do not require brackets when given as the last argument in a function call. For instance, the examples below are valid and equivalent:
+Atoms are constants where their name is their own value. Some other languages call them symbols.
 
 ```iex
-iex> if(2 + 2 == 4, [do: "OK"])
-"OK"
-iex> if(2 + 2 == 4, do: "OK")
-"OK"
-iex> if 2 + 2 == 4, do: "OK"
-"OK"
+iex> :hello
+:hello
+iex> :hello == :world
+false
 ```
 
-## 2.3 Strings (binaries) and char lists (lists)
-
-In Elixir, a double-quoted value is not the same as a single-quoted one:
+The booleans `true` and `false` are, in fact, atoms:
 
 ```iex
-iex> "hello" == 'hello'
-false
-iex> is_binary "hello"
+iex> true == :true
 true
-iex> is_list 'hello'
+iex> is_atom(false)
 true
 ```
 
-We say a double-quoted value is a **string**, which is represented by a binary. A single-quoted value is a **char list**, which is represented by a list.
+## 2.4 Strings
 
-In fact, both double-quoted and single-quoted representations are just a shorter representation of binaries and lists respectively. Given that `?a` in Elixir returns the ASCII integer for the letter `a`, we could also write:
+Strings in Elixir are inserted in between double quotes and they are encoded in UTF-8:
 
 ```iex
-iex> is_integer ?a
-true
-iex> <<?a, ?b, ?c>>
-"abc"
-iex> [?a, ?b, ?c]
-'abc'
+iex> "hellö"
+"hellö"
 ```
 
-In such cases, Elixir detects that all characters in the binary and in the list are printable and returns the quoted representation. However, adding a non-printable character forces them to be printed differently:
+Elixir also supports string interpolation:
 
 ```iex
-iex> <<?a, ?b, ?c, 1>>
-<<97,98,99,1>>
-
-iex> [?a, ?b, ?c, 1]
-[97,98,99,1]
+iex> "hellö #{:world}"
+"hellö world"
 ```
 
-In Elixir, strings (double-quoted) are preferred unless you want to explicitly iterate over a char list (which is sometimes common when interfacing with Erlang code from Elixir). As lists, binaries also support pattern matching:
+Strings can have line breaks in them or introduce them using escape sequences:
 
 ```iex
-iex> <<a, b, c>> = "foo"
-"foo"
-iex> a
-102
+iex> "hello
+...> world"
+"hello\nworld"
+iex> "hello\nworld"
+"hello\nworld"
 ```
 
-It is also possible to match on the "tail" of a binary, extracting the first bytes and matching the rest into a binary:
+You can print a string using the `IO.puts/1` function from the `IO` module:
 
 ```iex
-iex> <<f :: integer, rest :: binary>> = "foo"
-"foo"
-iex> f
-102
-iex> rest
-"oo"
+iex> IO.puts "hello\nworld"
+hello
+world
+:ok
 ```
 
-In the example above, we tagged each segment in the binary. The first segment has integer type (the default), which captures the ascii code for the letter "f". The remaining bytes "oo" are assigned into the binary `rest`.
-
-The binary/bitstring syntax in Elixir is very powerful, allowing you to match on bytes, bits, utf8 codepoints and much more. You can find more about it [in Elixir docs](http://elixir-lang.org/docs/master/Kernel.SpecialForms.html#<<>>/1). Meanwhile, let's talk more about Unicode.
-
-## 2.4 Unicode support
+Notice the `IO.puts/1` function returns the atom `:ok` as result after printing.
 
-A string in Elixir is a binary which is encoded in UTF-8. For example, the string "é" is a UTF-8 binary containing two bytes:
+Strings in Elixir are represented internally by binaries (i.e. a bunch of bytes). We usually check if a value is a string or not by using the `is_binary/1` function:
 
 ```iex
-iex> string = "é"
-"é"
-iex> size(string)
-2
+iex> is_binary("hellö")
+true
 ```
 
-In order to easily manipulate strings, Elixir provides a [`String` module](http://elixir-lang.org/docs/stable/String.html):
+We can also get the number of bytes in a string:
 
 ```iex
-# returns the number of bytes
-iex> size "héllò"
-7
-
-# returns the number of characters as perceived by humans
-iex> String.length "héllò"
-5
+iex> byte_size("hellö")
+6
 ```
 
-> Note: to retrieve the number of elements in a data structure, you will use a function named `length` or `size`. Their usage is not arbitrary. The first is used when the number of elements needs to be calculated. For example, calling `length(list)` will iterate the whole list to find the number of elements in that list. `size` is the opposite, it means the value is pre-calculated and stored somewhere and therefore retrieving its value is a cheap operation. That said, we use `size` to get the size of a binary, which is cheap, but retrieving the number of unicode characters uses `String.length`, since the whole string needs to be iterated.
-
-Each character in the string "héllò" above is an Unicode codepoint. One may use `String.codepoints` to split a string into smaller strings representing its codepoints:
+Notice the number of bytes in that string is 6, even though it has 5 characters. That's because the character "ö" takes 2 bytes to be represented in UTF-8. We can get the actual length of the string, based on the number of characters, by using the `String.length/1` function:
 
 ```iex
-iex> String.codepoints "héllò"
-["h", "é", "l", "l", "ó"]
+iex> String.length("hellö")
+5
 ```
 
-The Unicode standard assigns an integer value to each character. Elixir allows a developer to retrieve or insert a character based on its integer codepoint value as well:
+The [String module](http://elixir-lang.org/docs/stable/String.html) contains a bunch of functions that operate on strings as defined in the Unicode standard:
 
 ```iex
-# Getting the integer codepoint
-iex> ?h
-104
-iex> ?é
-233
-
-# Inserting a codepoint based on its hexadecimal value
-iex> "h\xE9ll\xF2"
-"héllò"
+iex> String.upcase("hellö")
+"HELLÖ"
 ```
 
-UTF-8 also plays nicely with pattern matching. In the example below, we are extracting the first UTF-8 codepoint of a String and assigning the rest of the string to the variable `rest`:
+Keep in mind `single-quoted` and `double-quoted` strings are not equivalent in Elixir as they are represented by different types:
 
 ```iex
-iex> << eacute :: utf8, rest :: binary >> = "épa"
-"épa"
-iex> eacute
-233
-iex> << eacute :: utf8 >>
-"é"
-iex> rest
-"pa"
+iex> 'hellö' == "hellö"
+true
 ```
 
-In general, you will find working with binaries and strings in Elixir a breeze. Whenever you want to work with raw binaries, one can use [Erlang's binary module](http://www.erlang.org/doc/man/binary.html), and use [Elixir's String module](http://elixir-lang.org/docs/stable/String.html) when you want to work on strings, which are simply UTF-8 encoded binaries.
+We will talk more about Unicode support and the difference in between single and double-quoted strings in the "Binaries, strings and char lists" chapter.
 
-## 2.5 Blocks
+## 2.5 Lists
 
-One of the first control flow constructs we usually learn is the conditional `if`. In Elixir, we could write `if` as follow:
+Elixir uses square brackets to specify a list of values. Values can be of any type:
 
 ```iex
-iex> if true, do: 1 + 2
+iex> [1, 2, true, 3]
+[1, 2, true, 3]
+iex> length [1, 2, 3]
 3
 ```
 
-The `if` expression can also be written using the block syntax:
+Two lists can be concatenated and subtracted using the `++/2` operator:
 
 ```iex
-iex> if true do
-...>   a = 1 + 2
-...>   a + 10
-...> end
-13
+iex> [1, 2, 3] ++ [4, 5, 6]
+[1, 2, 3, 4, 5, 6]
+iex> [1, true, 2, false, 3, true] -- [true, false]
+[1, 2, 3, true]
 ```
 
-You can think of `do`/`end` blocks as a convenience for passing a group of expressions to `do:`. It is exactly the same as:
+Throughout the tutorial, we will talk a lot about head and tail of a list. A head is the first element of a list and tail is the remaining of a list. They can be retrieved with the functions `hd/1` and `tl/1`. Let's assign a list to a variable and retrieve its head and tail:
 
 ```iex
-iex> if true, do: (
-...>   a = 1 + 2
-...>   a + 10
-...> )
-13
-```
-
-We can pass an `else` clause in the block syntax:
-
-```elixir
-if false do
-  :this
-else
-  :that
-end
-```
-
-It is important to notice that `do`/`end` always binds to the farthest function call. For example, the following expression:
-
-```elixir
-is_number if true do
-  1 + 2
-end
-```
-
-Would be parsed as:
-
-```elixir
-is_number(if true) do
-  1 + 2
-end
-```
-
-Which is not what we want since `do` is binding to the farthest function call, in this case `is_number`. Adding explicit parenthesis is enough to resolve the ambiguity:
-
-```elixir
-is_number(if true do
-  1 + 2
-end)
-```
-
-## 2.6 Control flow structures
-
-In this section we'll describe Elixir's main control flow structures.
-
-### 2.6.1 Revisiting pattern matching
-
-At the beginning of this chapter we have seen some pattern matching examples:
-
-```iex
-iex> [h | t] = [1,2,3]
-[1, 2, 3]
-iex> h
+iex> list = [1,2,3]
+iex> hd(list)
 1
-iex> t
+iex> tl(list)
 [2, 3]
 ```
 
-In Elixir, `=` is not an assignment operator as in programming languages like Java, Ruby, Python, etc. `=` is actually a match operator which will check if the expressions on both left and right side match.
-
-Many control-flow structures in Elixir rely extensively on pattern matching and the ability for different clauses to match. In some cases, you may want to match against the value of a variable, which can be achieved with the `^` operator:
+Asking a head or a tail of an empty list leads to an error:
 
 ```iex
-iex> x = 1
-1
-iex> ^x = 1
-1
-iex> ^x = 2
-** (MatchError) no match of right hand side value: 2
-iex> x = 2
-2
+iex> hd []
+** (ArgumentError) argument error
 ```
 
-In Elixir, it is a common practice to assign a value to underscore `_` if we don't intend to use it. For example, if only the head of the list matters to us, we can assign the tail to underscore:
+Oops!
 
-```iex
-iex> [h | _] = [1,2,3]
-[1, 2, 3]
-iex> h
-1
-```
-
-The variable `_` in Elixir is special in that it can never be read from. Trying to read from it gives an unbound variable error:
-
-```iex
-iex> _
-** (ErlangError) erlang error {:unbound_var, :_}
-```
-
-Although pattern matching allows us to build powerful constructs, its usage is limited. For instance, you cannot make function calls on the left side of a match. The following example is invalid:
-
-```iex
-iex> length([1,[2],3]) = 3
-** (ErlangError) erlang error :illegal_pattern
-```
-
-### 2.6.2 Case
-
-A `case` allows us to compare a value against many patterns until we find a matching one:
-
-```elixir
-case { 1, 2, 3 } do
-  { 4, 5, 6 } ->
-    "This won't match"
-  { 1, x, 3 } ->
-    "This will match and assign x to 2"
-  _ ->
-    "This will match any value"
-end
-```
-
-As in the `=` operator, any assigned variable will be overridden in the match clause. If you want to pattern match against a variable, you need to use the `^` operator:
-
-```elixir
-x = 1
-case 10 do
-  ^x -> "Won't match"
-  _  -> "Will match"
-end
-```
-
-Each match clause also supports special conditions specified via guards:
-
-```elixir
-case { 1, 2, 3 } do
-  { 4, 5, 6 } ->
-    "This won't match"
-  { 1, x, 3 } when x > 0 ->
-    "This will match and assign x"
-  _ ->
-    "No match"
-end
-```
-
-In the example above, the second clause will only match when x is positive. The Erlang VM only allows a limited set of expressions as guards:
-
-* comparison operators (`==`, `!=`, `===`, `!==`, `>`, `<`, `<=`, `>=`);
-* boolean operators (`and`, `or`) and negation operators (`not`, `!`);
-* arithmetic operators (`+`, `-`, `*`, `/`);
-* `<>` and `++` as long as the left side is a literal;
-* the `in` operator;
-* all the following type check functions (the number preceded by slash represents number of arguments):
-
-    * is_atom/1
-    * is_binary/1
-    * is_bitstring/1
-    * is_boolean/1
-    * is_float/1
-    * is_function/1
-    * is_function/2
-    * is_integer/1
-    * is_list/1
-    * is_number/1
-    * is_pid/1
-    * is_port/1
-    * is_record/1
-    * is_record/2
-    * is_reference/1
-    * is_tuple/1
-    * is_exception/1
-
-* plus these functions:
-
-    * abs(Number)
-    * bit_size(Bitstring)
-    * byte_size(Bitstring)
-    * div(Number, Number)
-    * elem(Tuple, n)
-    * float(Term)
-    * hd(List)
-    * length(List)
-    * node()
-    * node(Pid|Ref|Port)
-    * rem(Number, Number)
-    * round(Number)
-    * self()
-    * size(Tuple|Bitstring)
-    * tl(List)
-    * trunc(Number)
-    * tuple_size(Tuple)
-
-Many independent guard clauses can also be given at the same time. For example, consider a function that checks if the first element of a tuple or a list is zero. It could be written as:
-
-```elixir
-def first_is_zero?(tuple_or_list) when
-  elem(tuple_or_list, 0) == 0 or hd(tuple_or_list) == 0 do
-  true
-end
-```
-
-However, the example above will always fail. If the argument is a list, calling `elem` on a list will raise an error. If the element is a tuple, calling `hd` on a tuple will also raise an error. To fix this, we can rewrite it to become two different clauses:
-
-```elixir
-def first_is_zero?(tuple_or_list)
-    when elem(tuple_or_list, 0) == 0
-    when hd(tuple_or_list) == 0 do
-  true
-end
-```
-
-In such cases, if there is an error in one of the guards, it won't affect the next one.
-
-### 2.6.3 Functions
-
-In Elixir, anonymous functions can accept many clauses and guards, similar to the `case` mechanism we have just seen:
-
-```elixir
-f = fn
-  x, y when x > 0 -> x + y
-  x, y -> x * y
-end
-
-f.(1, 3)  #=> 4
-f.(-1, 3) #=> -3
-```
-
-As Elixir is an immutable language, the binding of the function is also immutable. This means that setting a variable inside the function does not affect its outer scope:
-
-```elixir
-x = 1
-(fn -> x = 2 end).()
-x #=> 1
-```
-
-### <a name="receive"></a>2.6.4 Receive
-
-This next control-flow mechanism is essential to Elixir's actors. In Elixir, the code is run in separate processes that exchange messages between them. Those processes are not Operating System processes (they are actually quite light-weight) but are called so since they do not share state with each other.
-
-In order to exchange messages, each process has a mailbox where the received messages are stored. The `receive` mechanism allows us to go through this mailbox searching for a message that matches the given pattern. Here is an example that uses the `send/2` function to send a message to the current process and then collects this message from its mailbox:
+We will revisit lists a couple times in the following chapters. If you want to look ahead, the "Pattern matching", "Key-value types", "Binaries, strings and char lists" and "Enumerables" chapters are particularly interesting.
 
-```iex
-# Get the current process id
-iex> current_pid = self
-
-# Spawn another process that will send a message to current_pid
-iex> spawn fn ->
-  send current_pid, { :hello, self }
-end
-<0.36.0>
-
-
-# Collect the message
-iex> receive do
-...>   { :hello, pid } ->
-...>     IO.puts "Hello from #{inspect(pid)}"
-...> end
-Hello from <0.36.0>
-```
-
-You may not see exactly `<0.36.0>` back, but something similar. If there are no messages in the mailbox, the current process will hang until a matching message arrives unless an after clause is given:
-
-```iex
-iex> receive do
-...>   :waiting ->
-...>     IO.puts "This may never come"
-...> after
-...>   1000 -> # 1 second
-...>     IO.puts "Too late"
-...> end
-Too late
-```
-
-Notice we spawned a new process using the `spawn` function passing another function as argument. We will talk more about those processes and even how to exchange messages in between different nodes in a later chapter.
-
-### 2.6.5 Try
-
-`try` in Elixir is used to catch values that are thrown. Let's start with an example:
+## 2.6 Tuples
 
-```iex
-iex> try do
-...>   throw 13
-...> catch
-...>   number -> number
-...> end
-13
-```
-
-`try/catch` is a control-flow mechanism, useful in rare situations where your code has complex exit strategies and it is easier to `throw` a value back up in the stack. `try` also supports guards in `catch` and an `after` clause that is invoked regardless of whether or not the value was caught:
+Elixir uses curly brackets to define tuples. As lists, tuples can hold any value:
 
 ```iex
-iex> try do
-...>   throw 13
-...> catch
-...>   nan when not is_number(nan) -> nan
-...> after
-...>   IO.puts "Didn't catch"
-...> end
-Didn't catch
-** throw 13
-    erl_eval:expr/3
+iex> {:ok, "hello"}
+{:ok, "hello"}
+iex> size {:ok, "hello"}
+2
 ```
 
-Notice that a thrown value which hasn't been caught halts the software. For this reason, Elixir considers such clauses unsafe (since they may or may not fail) and does not allow variables defined inside `try/catch/after` to be accessed from the outer scope:
+The `elem/2` and `set_elem/3` functions can be used to read or set a value in a tuple:
 
 ```iex
-iex> try do
-...>   new_var = 1
-...> catch
-...>   value -> value
-...> end
-1
-iex> new_var
-** (UndefinedFunctionError) undefined function: IEx.Helpers.new_var/0
+iex> tuple = {:ok, "hello"}
+{:ok, "hello"}
+iex> elem(tuple, 1)
+"hello"
+iex> set_elem(tuple, 1, "world")
+{:ok, "world"}
+iex> tuple
+{:ok, "hello"}
 ```
 
-The common strategy is to explicitly return all arguments from `try`:
+Notice that `set_elem/3` returned a new tuple. The original tuple stored in the `tuple` variable was not modified. This is true for all language data types because Elixir is an immutable language. By being immutable, Elixir reduces the amount mutable shared state in your code, which eliminates many problems when writing code concurrently or when building fault-tolerant applications.
 
-```elixir
-{ x, y } = try do
-  x = calculate_some_value()
-  y = some_other_value()
-  { x, y }
-catch
-  _ -> { nil, nil }
-end
+## 2.7 Lists or tuples?
 
-x #=> returns the value of x or nil for failures
-```
+You are probably wondering: what is the difference in between a list and a tuple?
 
-### 2.6.6 If and Unless
+That's an excellent question. Tuples are useful when you have a fixed number of fields or when you usually access those items by position. Lists, on the other hand, are useful when the items need to be enumerated.
 
-Besides the four main control-flow structures above, Elixir provides some extra control-flow structures to help on our daily work. For example, `if` and `unless`:
+One very common use case for tuples is to use them to return extra information from a function. For example, we can use the `File.read/1` function to read a file:
 
 ```iex
-iex> if true do
-iex>   "This works!"
-iex> end
-"This works!"
-
-iex> unless true do
-iex>   "This will never be seen"
-iex> end
-nil
+iex> File.read("path/to/existing/file")
+{:ok, "... contents ..."}
+iex> File.read("path/to/unknown/file")
+{:error, :enoent}
 ```
 
-Remember that `do/end` blocks in Elixir are simply a shortcut to the keyword notation. So one could also write:
-
-```iex
-iex> if true, do: "This works!"
-"This works!"
-```
+If the path given to `File.read/1` exists, it returns a tuple with the atom `:ok` as first element and the contents as second. Otherwise, it returns `:error` and the error reason.
 
-Or even more complex examples like:
-
-```elixir
-# This is equivalent...
-if false, do: 1 + 2, else: 10 + 3
-
-# ... to this
-if false do
-  1 + 2
-else
-  10 + 3
-end
-```
-
-In Elixir, all values except `false` and `nil` evaluate to true. Therefore there is no need to explicitly convert the `if` argument to a boolean. If you want to check if one of many conditions are true, you can use the `cond` macro.
-
-### 2.6.7 Cond
-
-Whenever you want to check for many conditions at the same time, Elixir allows developers to use `cond` instead of nesting many `if` expressions:
-
-```elixir
-cond do
-  2 + 2 == 5 ->
-    "This will never match"
-  2 * 2 == 3 ->
-    "Nor this"
-  1 + 1 == 2 ->
-    "But this will"
-end
-```
-
-If none of the conditions return true, an error will be raised. For this reason, it is common to see a last condition equal to `true`, which will always match:
-
-```elixir
-cond do
-  2 + 2 == 5 ->
-    "This will never match"
-  2 * 2 == 3 ->
-    "Nor this"
-  true ->
-    "This will always match (equivalent to else)"
-end
-```
-
-## 2.7 Built-in functions
-
-Elixir ships with many built-in functions automatically available in the current scope. In addition to the control flow expressions seen above, Elixir also adds: `elem` and `set_elem` to read and set values in tuples, `inspect` that returns the representation of a given data type as a binary, and many others. All of these functions imported by default are available in [`Kernel`](/docs/stable/Kernel.html) and [Elixir special forms are available in `Kernel.SpecialForms`](/docs/stable/Kernel.SpecialForms.html).
-
-All of these functions and control flow expressions are essential for building Elixir programs. In some cases though, one may need to use functions available from Erlang, let's see how.
-
-## 2.8 Calling Erlang functions
-
-One of Elixir's assets is easy integration with the existing Erlang ecosystem. Erlang ships with a group of libraries called OTP (Open Telecom Platform). Besides being a standard library, OTP provides several facilities to build OTP applications with supervisors that are robust, distributed and fault-tolerant.
-
-Since an Erlang module is nothing more than an atom, invoking those libraries from Elixir is quite straight-forward. For example, we can call the [function `flatten` from the module `lists`](http://www.erlang.org/doc/man/lists.html#flatten-1) or interact with [the `math` module](http://www.erlang.org/doc/man/math.html) as follows:
+The difference in between tuples and lists is important because it reflects on the operations you will perform on them. Tuples are fast when you need to get its size or access one element in a particular position. On the other hand, those operations are linear on lists: if you need to access the nth-item in a list, Elixir needs to go item by item until we retrieve the desired one. For this reason, we provide a `elem/2` function to access a tuple item but there is no builtin equivalent for lists:
 
 ```iex
-iex> :lists.flatten [1,[2],3]
-[1,2,3]
-iex> :math.sin :math.pi
-1.2246467991473532e-16
+iex> tuple = {:ok, "hello"}
+{:ok, "hello"}
+iex> size(tuple)
+2
+iex> elem(tuple, 1)
+"hello"
 ```
 
-Erlang's OTP is very well documented and we will learn more about building OTP applications in the Mix chapters:
+Finally, notice we have used 4 counting functions so far: `byte_size/1` (for the number of bytes in a string), `size/1` (for the tuple size), `length/1` (for the list length) and `String.length/1` (for the number of characters in a string). Their naming is not arbitrary.
 
-* [OTP docs](http://www.erlang.org/doc/)
-* [Standard library docs](http://www.erlang.org/doc/man/STDLIB_app.html)
+`length` is used when the number of elements needs to be calculated. For example, calling `length` will iterate the whole list to find the number of elements in that list. `size` is the opposite, it means the value is pre-calculated and stored somewhere and therefore retrieving its value is a cheap operation. That said, we use `byte_size` to get the number of bytes in a string, which is cheap, but retrieving the number of unicode characters uses `String.length`, since the whole string needs to be iterated.
 
-That's all for now. The next chapter will discuss how to organize our code into modules so it can be easily reused between different applications.
+Elixir also provides `Port`, `Reference`s and `PID`s as data types (usually used in process communication), and we will take a quick look at them when talking about processes. For now, let's take a look at some of the basic operator to use with our basic types.
diff --git a/getting_started/3.markdown b/getting_started/3.markdown
index 85ecaeb58..403f2c341 100644
--- a/getting_started/3.markdown
+++ b/getting_started/3.markdown
@@ -1,468 +1,114 @@
 ---
 layout: getting_started
-title: 3 Modules
+title: 3 Basic operators
 guide: 3
-total_guides: 7
 ---
 
 # {{ page.title }}
 
-In Elixir, you can group several functions into a module. In the previous chapter, for example, we invoked functions from the [module `List`](/docs/stable/List.html):
+In the previous chapter, we saw Elixir provides `+`, `-`, `*`, `/` as arithmetic operators. Plus the functions `div/2` and `rem/2` for integer division and remainder.
 
-```iex
-iex> List.flatten [1,[2],3]
-[1, 2, 3]
-```
-
-In order to create our own modules in Elixir, all we have to do is to call the `defmodule` function and use `def` to define our functions:
+Elixir also provides `++` and `--` to manipulate lists:
 
 ```iex
-iex> defmodule Math do
-...>   def sum(a, b) do
-...>     a + b
-...>   end
-...> end
-
-iex> Math.sum(1, 2)
-3
-```
-
-Before diving into modules, let's first have a brief overview about compilation.
-
-## 3.1 Compilation
-
-Most of the time it is convenient to write modules into files so they can be compiled and reused. Let's assume we have a file named `math.ex` with the following contents:
-
-```elixir
-defmodule Math do
-  def sum(a, b) do
-    a + b
-  end
-end
+iex> [1,2,3] ++ [4,5,6]
+[1,2,3,4,5,6]
+iex> [1,2,3] -- [2]
+[1,3]
 ```
 
-This file can be compiled using `elixirc` (remember, if you installed Elixir from a package or compiled it, `elixirc` will be inside the bin directory):
-
-    elixirc math.ex
-
-This will generate a file named `Elixir.Math.beam` containing the bytecode for the defined module. Now, if we start `iex` again, our module definition will be available (considering `iex` is being started in the same directory the bytecode file is):
+String concatenation is done via `<>`:
 
 ```iex
-iex> Math.sum(1, 2)
-3
-```
-
-Elixir projects are usually organized into three directories:
-
-* ebin - contains the compiled bytecode
-* lib - contains elixir code (usually `.ex` files)
-* test - contains tests (usually `.exs` files)
-
-Whenever interacting with an existing library, you may need to explicitly tell Elixir to look for bytecode in the `ebin` directory:
-
-    iex -pa ebin
-
-Where `-pa` stands for `path append`. The same option can also be passed to `elixir` and `elixirc` executables. You can execute `elixir` and `elixirc` without arguments to get a list of options.
-
-## 3.2 Scripted mode
-
-In addition to the Elixir file `.ex`, Elixir also supports `.exs` files for scripting. Elixir treats both files exactly the same way, the only difference is in intention. `.ex` files are meant to be compiled while `.exs` files are used for scripting, without the need for compilation. For instance, one can create a file called `math.exs`:
-
-```elixir
-defmodule Math do
-  def sum(a, b) do
-    a + b
-  end
-end
-
-IO.puts Math.sum(1, 2)
+iex> "foo" <> "bar"
+"foobar"
 ```
 
-And execute it as:
-
-    elixir math.exs
-
-The file will be compiled in memory and executed, printing "3" as the result. No bytecode file will be created.
-
-## 3.3 Functions and private functions
-
-Inside a module, we can define functions with `def` and private functions with `defp`. A function defined with `def` is available to be invoked from other modules while a private function can only be invoked locally.
-
-```elixir
-defmodule Math do
-  def sum(a, b) do
-    do_sum(a, b)
-  end
-
-  defp do_sum(a, b) do
-    a + b
-  end
-end
-
-Math.sum(1, 2)    #=> 3
-Math.do_sum(1, 2) #=> ** (UndefinedFunctionError)
-```
-
-Function declarations also support guards and multiple clauses. If a function has several clauses, Elixir will try each clause until it finds one that matches. Here is the implementation of a function that checks if the given number is zero or not:
-
-```elixir
-defmodule Math do
-  def zero?(0) do
-    true
-  end
-
-  def zero?(x) when is_number(x) do
-    false
-  end
-end
-
-Math.zero?(0)  #=> true
-Math.zero?(1)  #=> false
-
-Math.zero?([1,2,3])
-#=> ** (FunctionClauseError)
-```
-
-Giving an argument that does not match any of the clauses raises an error.
-
-Named functions also support default arguments:
-
-```elixir
-defmodule Concat do
-  def join(a, b, sep \\ " ") do
-    a <> sep <> b
-  end
-end
-
-IO.puts Concat.join("Hello", "world")      #=> Hello world
-IO.puts Concat.join("Hello", "world", "_") #=> Hello_world
-```
-
-Any expression is allowed to serve as a default value, but it won't be evaluated during the function definition; it will simply be stored for later use. Every time the function is invoked and any of its default values have to be used, the expression for that default value will be evaluated:
-
-```elixir
-defmodule DefaultTest do
-  def dowork(x \\ IO.puts "hello") do
-    x
-  end
-end
-```
+Elixir also provides three boolean operators: `or`, `and` and `not`. These operators are strict in the sense that they expect a boolean (`true` or `false`) as their first argument:
 
 ```iex
-iex> DefaultTest.dowork 123
-123
-iex> DefaultTest.dowork
-hello
-:ok
-```
-
-If a function with default values has multiple clauses, it is recommended to create a separate clause without an actual body, just for declaring defaults:
-
-```elixir
-defmodule Concat do
-  def join(a, b \\ nil, sep \\ " ")
-
-  def join(a, b, _sep) when nil?(b) do
-    a
-  end
-
-  def join(a, b, sep) do
-    a <> sep <> b
-  end
-end
-
-IO.puts Concat.join("Hello", "world")      #=> Hello world
-IO.puts Concat.join("Hello", "world", "_") #=> Hello_world
-IO.puts Concat.join("Hello")               #=> Hello
-```
-
-When using default values, one must be careful to avoid overlapping function definitions. Consider the following example:
-
-```elixir
-defmodule Concat do
-  def join(a, b) do
-    IO.puts "***First join"
-    a <> b
-  end
-
-  def join(a, b, sep \\ " ") do
-    IO.puts "***Second join"
-    a <> sep <> b
-  end
-end
+iex> true and true
+true
+iex> false or is_atom(:example)
+true
 ```
 
-If we save the code above in a file named "concat.ex" and compile it, Elixir will emit the following warning:
-
-    concat.ex:7: this clause cannot match because a previous clause at line 2 always matches
-
-The compiler is telling us that invoking the `join` function with two arguments will always choose the first definition of `join` whereas the second one will only be invoked when three arguments are passed:
-
-    $ iex concat.ex
+Providing a non-boolean will raise an exception:
 
 ```iex
-iex> Concat.join "Hello", "world"
-***First join
-"Helloworld"
-```
-
-```iex
-iex> Concat.join "Hello", "world", "_"
-***Second join
-"Hello_world"
-```
-
-### 3.4 Recursion
-
-Due to immutability, loops in Elixir (and in functional programming languages) are written differently from conventional imperative languages. For example, in an imperative language, one would write:
-
-```c
-for(i = 0; i < array.length; i++) {
-  array[i] = array[i] * 2
-}
-```
-
-In the example above, we are mutating the array which is not possible in Elixir. Therefore, functional languages rely on recursion: a function is called recursively until a condition is reached. Consider the example below that manually sums all the items in the list:
-
-```elixir
-defmodule Math do
-  def sum_list([h|t], acc) do
-    sum_list(t, h + acc)
-  end
-
-  def sum_list([], acc) do
-    acc
-  end
-end
-
-Math.sum_list([1,2,3], 0) #=> 6
+iex> 1 and true
+** (ArgumentError) argument error
 ```
 
-In the example above, we invoke `sum_list` giving a list `[1,2,3]` and the initial value `0` as arguments. When a function has many clauses, we will try each clause until we find one that matches according to the pattern matching rules. In this case, the list `[1,2,3]` matches against `[h|t]` which assigns `h = 1` and `t = [2,3]` while `acc` is set to 0.
-
-Then, we add the head of the list to the accumulator `h + acc` and call `sum_list` again, recursively, passing the tail of the list as argument. The tail will once again match `[h|t]` until the list is empty, as seen below:
-
-```elixir
-sum_list [1,2,3], 0
-sum_list [2,3], 1
-sum_list [3], 3
-sum_list [], 6
-```
-
-When the list is empty, it will match the final clause which returns the final result of `6`. In imperative languages, such implementation would usually fail for large lists because the stack (in which our execution path is kept) would grow until it reaches a limit. Elixir, however, does tail call optimization in which the stack does not grow when a function exits by calling another function.
-
-Recursion and tail call optimization are an important part of Elixir and are commonly used to create loops, especially in cases where a process needs to wait and respond to messages (using the `receive` macro we saw in the previous chapter). However, recursion as above is rarely used to manipulate lists, since [the `Enum` module](/docs/stable/Enum.html) already abstracts such use cases. For instance, the example above could be simply written as:
+`or` and `and` are short-circuit operators. They only execute the right side if the left side is not enough to determine the result:
 
-```elixir
-Enum.reduce([1,2,3], 0, fn(x, acc) -> x + acc end)
-```
-
-## 3.5 Directives
-
-In order to facilitate software reuse, Elixir supports three directives. As we are going to see below, they are called directives because they have **lexical scope**.
-
-### 3.5.1 alias
-
-`alias` allows you to setup aliases for any given module name. Imagine our `Math` module has a special list for doing math specific operations:
-
-```elixir
-defmodule Math do
-  alias Math.List, as: List
-end
-```
-
-From now on, any reference to `List` will automatically expand to `Math.List`. In case one wants to access the original `List`, it can be done by accessing the module via `Elixir`:
-
-```elixir
-List.values             #=> uses Math.List.values
-Elixir.List.values      #=> uses List.values
-Elixir.Math.List.values #=> uses Math.List.values
-```
-
-> Note: All modules defined in Elixir are defined inside a main Elixir namespace. However, for convenience, you can omit the Elixir main namespace.
-
-Calling `alias` without an `as` option sets the alias automatically to the last part of the module name, for example:
-
-```elixir
-alias Math.List
-```
-
-Is the same as:
-
-```elixir
-alias Math.List, as: List
-```
-
-Notice that `alias` is **lexically scoped**, which allows you to set aliases inside specific functions:
-
-```elixir
-defmodule Math do
-  def add(a, b) do
-    alias Math.List
-    # ...
-  end
-
-  def minus(a, b) do
-    # ...
-  end
-end
-```
-
-In the example above, since we are invoking `alias` inside the function `add`, the alias will just be valid inside the function `add`. `minus` won't be affected at all.
-
-### 3.5.2 require
-
-In general, a module does not need to be required before usage, except if we want to use the macros available in that module. For instance, suppose we created our own `my_if` implementation in a module named `MyMacros`. If we want to invoke it, we need to first explicitly require `MyMacros`:
-
-```elixir
-defmodule Math do
-  require MyMacros
-  MyMacros.my_if do_something, it_works
-end
-```
-
-An attempt to call a macro that was not loaded will raise an error. Note that like the `alias` directive, `require` is also lexically scoped. We will talk more about macros in chapter 5.
-
-### 3.5.3 import
-
-We use `import` whenever we want to easily access functions or macros from other modules without using the qualified name. For instance, if we want to use the `duplicate` function from `List` several times in a module and we don't want to always type `List.duplicate`, we can simply import it:
-
-```elixir
-defmodule Math do
-  import List, only: [duplicate: 2]
-
-  def some_function do
-    # call duplicate
-  end
-end
-```
-
-In this case, we are importing only the function `duplicate` (with arity 2) from `List`. Although `only:` is optional, its usage is recommended. `except` could also be given as an option.
-
-`import` also supports selectors, to filter what you want to import. We have four selectors:
-
-* `:default` - imports all functions and macros, except the ones starting by underscore;
-* `:all` - imports all functions and macros;
-* `:functions` - imports all functions;
-* `:macros` - imports all macros;
-
-For example, to import all macros, one could write:
-
-```elixir
-import MyMacros, only: :macros
-```
-
-Or to import all functions, you could write:
-
-```elixir
-import MyFunctions, only: :functions
-```
-
-Note that `import` is also **lexically scoped**, this means we can import specific macros inside specific functions:
-
-```elixir
-defmodule Math do
-  def some_function do
-    import List, only: [duplicate: 2]
-    # call duplicate
-  end
-end
-```
-
-In the example above, the imported `List.duplicate` is only visible within that specific function. `duplicate` won't be available in any other function in that module (or any other module for that matter).
-
-Note that importing a module automatically requires it. Furthermore, `import` also accepts the `as:` option which is automatically passed to `alias` in order to create an alias.
-
-## 3.6 Module attributes
-
-Elixir brings the concept of module attributes from Erlang. For example:
+```iex
+iex> false and error("This error will never be raised")
+false
 
-```elixir
-defmodule MyServer do
-  @vsn 2
-end
+iex> true or error("This error will never be raised")
+true
 ```
 
-In the example above, we are explicitly setting the version attribute for that module. `@vsn` is used by the code reloading mechanism in the Erlang VM to check if a module has been updated or not. If no version is specified, the version is set to the MD5 checksum of the module functions.
-
-Elixir has a handful of reserved attributes. Here are just a few of them, the most commonly used ones. Take a look at the docs for [Module](http://elixir-lang.org/docs/stable/Module.html) for a complete list of supported attributes.
-
-* `@moduledoc` - provides documentation for the current module;
-* `@doc` - provides documentation for the function or macro that follows the attribute;
-* `@behaviour` - (notice the British spelling) used for specifying an OTP or user-defined behaviour;
-* `@before_compile` - provides a hook that will be invoked before the module is compiled. This makes it possible to inject functions inside the module exactly before compilation;
+> Note: If you are an Erlang developer, `and` and `or` in Elixir actually map to the `andalso` and `orelse` operators in Erlang.
 
-The following attributes are part of [typespecs](http://www.erlang.org/doc/reference_manual/typespec.html) and are also supported by Elixir:
+Besides these boolean operators, Elixir also provides `||`, `&&` and `!` which accept arguments of any type. For these operators, all values except `false` and `nil` will evaluate to true:
 
-* `@spec` - provides a specification for a function;
-* `@callback` - provides a specification for the behavior callback;
-* `@type` - defines a type to be used in `@spec`;
-* `@typep` - defines a private type to be used in `@spec`;
-* `@opaque` - defines an opaque type to be used in `@spec`;
-
-In addition to the built-in attributes outlined above, custom attributes may also be added:
-
-```elixir
-defmodule MyServer do
-  @my_data 13
-  IO.inspect @my_data #=> 13
-end
+```iex
+# or
+iex> 1 || true
+1
+iex> false || 11
+11
+
+# and
+iex> nil && 13
+nil
+iex> true && 17
+17
+
+# !
+iex> !true
+false
+iex> !1
+false
+iex> !nil
+true
 ```
 
-Unlike Erlang, user defined attributes are not stored in the module by default since it is common in Elixir to use such attributes to store temporary data. A developer can configure an attribute to behave closer to Erlang by calling [`Module.register_attribute/3`](/docs/stable/Module.html#register_attribute/3).
+As a rule of thumb, use `and`, `or` and `not` when you are expecting booleans. If any of the arguments are non-boolean, use `&&`, `||` and `!`.
 
-Finally, notice that attributes can also be read inside functions:
+Elixir also provides `==`, `!=`, `===`, `!==`, `<=`, `>=`, `<` and `>` as comparison operators:
 
-```elixir
-defmodule MyServer do
-  @my_data 11
-  def first_data, do: @my_data
-  @my_data 13
-  def second_data, do: @my_data
-end
-
-MyServer.first_data #=> 11
-MyServer.second_data #=> 13
+```iex
+iex> 1 == 1
+true
+iex> 1 != 2
+true
+iex> 1 < 2
+true
 ```
 
-Notice that reading an attribute inside a function takes a snapshot of its current value. In other words, the value is read at compilation time and not at runtime. Check [the documentation for the module `Module` documentation](/docs/stable/Module.html) for other functions to manipulate module attributes.
+The difference between `==` and `===` is that the latter is more strict when comparing integers and floats:
 
-## 3.7 Nesting
-
-Modules in Elixir can be nested too:
-
-```elixir
-defmodule Foo do
-  defmodule Bar do
-  end
-end
+```iex
+iex> 1 == 1.0
+true
+iex> 1 === 1.0
+false
 ```
 
-The example above will define two modules `Foo` and `Foo.Bar`. The second can be accessed as `Bar` inside `Foo` as long as they are in the same scope. If later the developer decides to move `Bar` to another file, it will need to be referenced by its full name (`Foo.Bar`) or an alias needs to be set using the `alias` directive discussed above.
+In Elixir, we can compare two different data types:
 
-## 3.8 Aliases
-
-In Erlang (and consequently in the Erlang VM), modules and functions are represented by atoms. For instance, this is valid Erlang code:
-
-```elixir
-Mod = lists,
-Mod:flatten([1,[2],3]).
+```iex
+iex> 1 < :atom
+true
 ```
 
-In the example above, we store the atom `lists` in the variable `Mod` and then invoke the function `flatten` in it. In Elixir, the same idiom is allowed:
+The reason we can compare different data types is pragmatism. Sorting algorithms don't need to worry about different data types in order to sort. The overall sorting order is defined below:
 
-```iex
-iex> mod = :lists
-:lists
-iex> mod.flatten([1,[2],3])
-[1,2,3]
-```
+    number < atom < reference < functions < port < pid < tuple < maps < list < bitstring
 
-In other words, we are simply calling the function `flatten` on the atom `:lists`. This mechanism is exactly what empowers Elixir aliases. An alias in Elixir is a capitalized identifier (like `List`, `Keyword`, etc) which is converted to an atom representing a module during compilation. For instance, the `List` alias translates by default to the atom `Elixir.List`:
+You don't actually need to memorize this ordering, but it is important just to know an order exists.
 
-```iex
-iex> is_atom(List)
-true
-iex> to_string(List)
-"Elixir.List"
-```
+Well, that is it for the introduction. In the next chapter, we are going to discuss some basic functions, data types conversions and a bit of control-flow.
diff --git a/getting_started/4.markdown b/getting_started/4.markdown
index ba5cc69eb..dae46ea92 100644
--- a/getting_started/4.markdown
+++ b/getting_started/4.markdown
@@ -1,358 +1,152 @@
 ---
 layout: getting_started
-title: 4 Records, Protocols & Exceptions
+title: 4 Pattern matching
 guide: 4
-total_guides: 7
 ---
 
 # {{ page.title }}
 
-Elixir provides both records and protocols. This chapter will outline the main features of both and provide some examples. More specifically, we will learn how to use `defrecord`, `defprotocol` and `defimpl`. At the end, we will briefly talk about exceptions in Elixir.
+In this chapter, we will show how the `=` operator in Elixir is actually a match operator and how to use it to pattern match inside data structures. Finally, we will learn about the pin operator `^` used to access previously bound values.
 
-## 4.1 Records
+## 4.1 The match operator
 
-Records are simple structures that hold values. For example, we can define a `FileInfo` record that is supposed to store information about files as follows:
-
-```elixir
-defrecord FileInfo, atime: nil, accesses: 0
-```
-
-The line above will define a module named `FileInfo` which contains a function named `new` that returns a new record and other functions to read and set the values:
+We have used the `=` operator a couple times to "assign" variables in Elixir.
 
 ```iex
-iex> file_info = FileInfo.new(atime: { 2010, 4, 17 }, accesses: 42)
-iex> file_info.atime
-{2010, 4, 17}
-iex> file_info.atime({ 2012, 10, 13 }) #=> Returns a new FileInfo
-FileInfo[atime: {2012, 10, 13}, accesses: 42]
-iex> file_info.atime
-{2010, 4, 17}
-```
-
-Notice that when we change the `atime` field of the record, we re-store the record in the `file_info` variable. This is because as almost everything else in Elixir, records are immutable. So changing the `atime` field does not update the record in place. Instead, it returns a new record with the new value set.
-
-A record is simply a tuple where the first element is the record module name. We can get the record raw representation as follows:
-
-```elixir
-inspect FileInfo.new, raw: true
-#=> "{ FileInfo, nil, 0 }"
-```
-
-Besides defining readers and writers for each attribute, Elixir records also define an `update_#{attribute}` function to update values. Such functions expect a function as argument that receives the current value and must return the new one. For example, every time the file is accessed, the accesses counter can be incremented with:
-
-```elixir
-file_info = FileInfo.new(accesses: 10)
-file_info = file_info.update_accesses(fn(x) -> x + 1 end)
-file_info.accesses #=> 11
-```
-
-### 4.1.1 Pattern matching
-
-Elixir also allows one to pattern match against records. For example, imagine we want to check if a file was accessed or not based on the `FileInfo` record above, we could implement it as follows:
-
-```elixir
-defmodule FileAccess do
-  def was_accessed?(FileInfo[accesses: 0]), do: false
-  def was_accessed?(FileInfo[]),            do: true
-end
-```
-
-The first clause will only match if a `FileInfo` record is given and its `accesses` field is equal to zero. The second clause will match any `FileInfo` record and nothing more. We can also link the value of `accesses` to a variable as follows:
-
-```elixir
-def was_accessed?(FileInfo[accesses: accesses]), do: accesses > 0
-```
-
-The pattern matching syntax can also be used to create new records:
-
-```elixir
-file_info = FileInfo[accesses: 0]
-```
-
-Whenever using the bracket syntax above, Elixir expands the record to a tuple at compilation time. That said, the clause above:
-
-```elixir
-def was_accessed?(FileInfo[accesses: 0]), do: false
-```
-
-Is effectively the same as:
-
-```elixir
-def was_accessed?({ FileInfo, _, 0 }), do: false
+iex> x = 1
+1
+iex> x
+1
 ```
 
-Using the bracket syntax is a powerful mechanism not only due to pattern matching but also regarding performance, since it provides faster times compared to `FileInfo.new` and `file_info.accesses`. The downside is that we hardcode the record name. For this reason, Elixir allows you to mix and match both styles as you may find fit.
-
-For more information on records, [check out the documentation for the `defrecord` macro](http://elixir-lang.org/docs/master/Kernel.html#defrecord/3)
+However, the `=` operator is actually called *the match operator*. Let's see why:
 
-## 4.2 Protocols
-
-Protocols are a mechanism to achieve polymorphism in Elixir. Dispatching on a protocol is available to any data type as long as it implements the protocol. Lets consider a practical example.
-
-In Elixir, only `false` and `nil` are treated as false. Everything else evaluates to true. Depending on the application, it may be important to specify a `blank?` protocol that returns a boolean for other data types that should be considered blank. For instance, an empty list or an empty binary could be considered blanks.
-
-We could define this protocol as follows:
-
-```elixir
-defprotocol Blank do
-  @doc "Returns true if data is considered blank/empty"
-  def blank?(data)
-end
-```
-
-The protocol expects a function called `blank?` that receives one argument to be implemented. We can implement this protocol for some Elixir data types in the following way:
-
-```elixir
-# Integers are never blank
-defimpl Blank, for: Integer do
-  def blank?(_), do: false
-end
-
-# Just empty list is blank
-defimpl Blank, for: List do
-  def blank?([]), do: true
-  def blank?(_),  do: false
-end
-
-# Just the atoms false and nil are blank
-defimpl Blank, for: Atom do
-  def blank?(false), do: true
-  def blank?(nil),   do: true
-  def blank?(_),     do: false
-end
+```iex
+iex> 1 = x
+1
+iex> 2 = x
+** (MatchError) no match of right hand side value: 1
 ```
 
-And we would do so for all native data types. The types available are:
-
-* `Record`
-* `Tuple`
-* `Atom`
-* `List`
-* `BitString`
-* `Integer`
-* `Float`
-* `Function`
-* `PID`
-* `Port`
-* `Reference`
-* `Any`
-
-Now, with the protocol defined and implementations in hand, we can invoke it:
-
-```elixir
-Blank.blank?(0)       #=> false
-Blank.blank?([])      #=> true
-Blank.blank?([1,2,3]) #=> false
-```
+Notice we `1 = x` is a valid expression and it matched because both the left and right side are equal to 1. When the sides do not match, a `MatchError` is reported.
 
-Notice however that passing a data type that does not implement the protocol raises an error:
+Also, in Elixir parlance, we don't say a variable is assigned. We say a variable is bound or not. A variable can only be bound while on the left side:
 
 ```iex
-iex> Blank.blank?("hello")
-** (UndefinedFunctionError) undefined function: Blank.BitString.blank?/1
-```
-
-### 4.2.1 Fallback to any
+iex> 1 = unknown
+** (RuntimeError) undefined function: unknown/0
+````
 
-In some cases, it may be convenient to provide a default implementation for all types. This can be achieved by setting `@fallback_to_any` to `true` in the protocol definition:
+Since there is no variable unknown previously defined, Elixir imagined you were trying to call a function named `unknown/0`, but there isn't such function.
 
-```elixir
-defprotocol Blank do
-  @fallback_to_any true
-  def blank?(data)
-end
-```
+## 4.2 Pattern matching
 
-Which can now be implemented as:
+The match operator cannot only be used to match against direct values but they are also useful for destructuring more complex data types. For example, we can pattern match on tuples:
 
-```elixir
-defimpl Blank, for: Any do
-  def blank?(_), do: false
-end
+```iex
+iex> {a, b, c} = {:hello, "world", 42}
+{:hello, "world", 42}
+iex> a
+:hello
+iex> b
+"world"
 ```
-Now all data types that we have not implemented the `Blank` protocol for will be considered non-blank.
-
-### 4.2.2 Using protocols with records
 
-The power of Elixir's extensibility comes when protocols and records are mixed.
+A pattern match will error in case the sides can't match. This is, for example, the case when the tuples have different sizes:
 
-For instance, Elixir provides a `HashDict` implementation that is an efficient data structure to store many keys. Let's take a look at how it works:
-
-```elixir
-dict = HashDict.new
-dict = HashDict.put(dict, :hello, "world")
-HashDict.get(dict, :hello) #=> "world"
+```iex
+iex> {a, b, c} = {:hello, "world"}
+** (MatchError) no match of right hand side value: {:hello, "world"}
 ```
 
-If we inspect our `HashDict`, we can see it is a simple tuple:
+And also when comparing different types:
 
-```elixir
-inspect(dict, raw: true)
-#=> "{HashDict, 1, [[:hello | \"world\"]]}"
+```iex
+iex> {a, b, c} = [:hello, "world", "!"]
+** (MatchError) no match of right hand side value: [:hello, "world", "!"]
 ```
 
-Since `HashDict` is a data structure that contains values, it would be convenient to implement the `Blank` protocol for it too:
-
-```elixir
-defimpl Blank, for: HashDict do
-  def blank?(dict), do: HashDict.size(dict) == 0
-end
-```
+More interestingly, we can match on specific values. The example below asserts that the left side will only match the right side in case the right side is a tuple that starts with the atom `:ok`:
 
-And now we can test it:
+```iex
+iex> {:ok, result} = {:ok, 13}
+{:ok, 13}
+iex> result
+13
 
-```elixir
-dict = HashDict.new(hello: "world")
-Blank.blank?(dict)         #=> false
-Blank.blank?(HashDict.new) #=> true
+iex> {:ok, result} = {:error, :oops}
+** (MatchError) no match of right hand side value: {:error, :oops}
 ```
 
-Excellent! The best of all is that we implemented the `Blank` protocol for an existing data structure (`HashDict`) without a need to wrap it or recompile it, which allows developers to easily extend previously defined protocols.
-
-### 4.2.3 Built-in protocols
-
-Elixir ships with some built-in protocols. Here are a couple of them:
-
-* `Access` - specifies how to access an element. This is the protocol that empowers bracket access in Elixir. For example:
+We can also pattern match on lists:
 
 ```iex
-iex> x = [a: 1, b: 2]
-[{:a, 1}, {:b, 2}]
-iex> x[:a]
+iex> [a, b, c] = [1, 2, 3]
+[1, 2, 3]
+iex> a
 1
-iex> x[:b]
-2
-```
-
-* `Enumerable` - any data structures that can be enumerated must implement this protocol. This protocol is consumed by the `Enum` module which provides functions like `map`, `reduce` and others:
-
-```iex
-iex> Enum.map [1,2,3], fn(x) -> x * 2 end
-[2,4,6]
-iex> Enum.reduce 1..3, 0, fn(x, acc) -> x + acc end
-6
 ```
 
-* `Inspect` - this protocol is used to transform any data structure into a readable textual representation. This is what tools like IEx use to print results:
+Lists also supporting matching on its head and tail:
 
 ```iex
-iex> { 1, 2, 3 }
-{1,2,3}
-iex> HashDict.new
-#HashDict<[]>
+iex> [head | tail] = [1, 2, 3]
+[1, 2, 3]
+iex> head
+1
+iex> tail
+[2, 3]
 ```
 
-  Keep in mind that, by convention, whenever the inspected value starts with `#`, it is representing a data structure in non-valid Elixir syntax. For those, the true representation can be retrieved by calling `inspect` directly and passing `raw` as an option:
+Similar to the `hd/1` and `tl/1` functions, we can't match an empty list with a head and tail pattern:
 
 ```iex
-iex> inspect HashDict.new, raw: true
-"{HashDict,0,[]}"
+iex> [h|t] = []
+** (MatchError) no match of right hand side value: []
 ```
 
-* `String.Chars` - specifies how to convert a data structure with characters to a string. It's exposed via the `to_string` function:
+The `[head | tail]` format is not only used on pattern matching but also for prepending items to a list:
 
 ```iex
-iex> to_string :hello
-"hello"
+iex> list = [1, 2, 3]
+[1, 2, 3]
+iex> [0|list]
+[0, 1, 2, 3]
 ```
 
-  Notice that string interpolation in Elixir calls the `to_string` function:
+Pattern matching allows developers to easily destruct data types such as tuples and lists. As we will see in following chapters, it is one of the foundations of recursion in Elixir and applies to other types as well, like maps and binaries.
 
-```iex
-iex> "age: #{25}"
-"age: 25"
-```
+## 4.3 The pin operator
 
-  The example above only works because numbers implement the `String.Chars` protocol. Passing a tuple, for example, will lead to an error:
+Variables in Elixir can be rebound:
 
 ```iex
-iex> tuple = {1, 2, 3}
-{1, 2, 3}
-iex> "tuple: #{tuple}"
-** (Protocol.UndefinedError) protocol String.Chars not implemented for {1, 2, 3}
+iex> x = 1
+1
+iex> x = 2
+2
 ```
 
-  When there is a need to "print" a more complex data structure, one can simply use the `inspect` function:
+The pin operator `^` can be used when there is no interest in rebinding a variable but rather matching against its value (prior to the match):
 
 ```iex
-iex> "tuple: #{inspect tuple}"
-"tuple: {1, 2, 3}"
-```
-
-Elixir defines other protocols which can be verified in Elixir's documentation. Frameworks and libraries that you use may define a couple of specific protocols as well. Use them wisely to write code that is easy to maintain and extend.
-
-## 4.3 Exceptions
-
-Exception handling would have its own chapter in many languages, but here they play a much lesser role.
-
-An exception can be rescued inside a `try` block with the `rescue` keyword:
-
-```elixir
-# rescue only runtime error
-try do
-  raise "some error"
-rescue
-  RuntimeError -> "rescued"
-end
-
-# rescue runtime and argument errors
-try do
-  raise "some error"
-rescue
-  [RuntimeError, ArgumentError] -> "rescued"
-end
-
-# rescue and assign to x
-try do
-  raise "some error"
-rescue
-  x in [RuntimeError] ->
-    # all exceptions have a message
-    x.message
-end
-```
-
-Notice that `rescue` works with exception names and doesn't allow guards nor pattern matching. This limitation is intentional: developers should not use exception values to drive their software. In fact, **exceptions in Elixir should only be used under exceptional circumstances**.
-
-For example, software that does log partitioning and rotation over the network may face network issues or an eventual instability when accessing the file system. These scenarios are not exceptional in this particular software and must be handled accordingly. Therefore, the software can read some file using `File.read` and match the result:
-
-```elixir
-case File.read(file) do
-  { :ok, contents }  ->
-    # We were able to access the file
-    # Proceed as expected
-  { :error, reason } ->
-    # Oops, something went wrong
-    # We need to handle the error accordingly
-end
+iex> x = 1
+1
+iex> ^x = 2
+** (MatchError) no match of right hand side value: 2
+iex> {x, ^x} = {2, 1}
+{2, 1}
+iex> x
+2
 ```
 
-Notice that `File.read` does not raise an exception in case something goes wrong; it returns a tuple containing `{ :ok, contents }` in case of success and `{ :error, reason }` in case of failure. This allows us to use Elixir's pattern matching constructs to control how our application should behave.
-
-On the other hand, a CLI interface that needs to access or manipulate a file given by the user may necessarily expect a file to be there. If the given file does not exist, there is nothing to do but fail. Then you may use `File.read!`, which raises an exception instead:
+Finally, notice that if a variable is mentioned more than once in a pattern, all references should bind to the same pattern:
 
 ```iex
-iex> contents = File.read!("/inexistent/file")
-** (File.Error) could not read file /inexistent/file: no such file or directory
+iex> {x, x} = {1, 1}
+1
+iex> {x, x} = {1, 2}
+** (MatchError) no match of right hand side value: {1, 2}
 ```
 
-This pattern is common throughout the Elixir standard library, and many libraries provide both forms.
-
-Finally, exceptions are simply records and can be defined with `defexception`, which has a similar API to `defrecord`. But remember, in Elixir you will use those sparingly.
-
-This showcases Elixir's philosophy of not using exceptions for control-flow. If you feel like you need to rescue an exception in order to change how your code works, you should probably return an atom or tuple instead to allow pattern matching.
-
-Next, let's take a look at how Elixir tackles productivity by building some macros using `defmacro` and `defmacrop`!
-
-> Note: In order to ease integration with Erlang APIs, Elixir also supports "catching errors" coming from Erlang with `try/catch`, as it works in Erlang:
->
->
->     try do
->       :erlang.error(:oops)
->     catch
->       :error, :oops ->
->         "Got Erlang error"
->     end
->
->
-> The first atom can be one of `:error`, `:throw` or `:exit`. Keep in mind that catching errors is as discouraged as rescuing exceptions in Elixir.
+This finishes our introduction to pattern matching. As we will see in the next chapter, pattern matching is very common in many language constructs and, if you are not familiar with it from other languages, you will get the hang of it with just a bit of practice! So let's talk some control flow structures, like `case` and `cond`, before we move towards more advanced data-types, likes binaries, keyword lists and maps.
diff --git a/getting_started/5.markdown b/getting_started/5.markdown
deleted file mode 100644
index 7c07af3e0..000000000
--- a/getting_started/5.markdown
+++ /dev/null
@@ -1,300 +0,0 @@
----
-layout: getting_started
-title: 5 Macros
-guide: 5
-total_guides: 7
----
-
-# {{ page.title }}
-
-An Elixir program can be represented by its own data structures. This chapter will describe what those structures look like and how to manipulate them to create your own macros.
-
-## 5.1 Building blocks of an Elixir program
-
-The building block of Elixir is a tuple with three elements. The function call `sum(1,2,3)` is represented in Elixir as:
-
-```elixir
-{ :sum, [], [1, 2, 3] }
-```
-
-You can get the representation of any expression by using the `quote` macro:
-
-```iex
-iex> quote do: sum(1, 2, 3)
-{ :sum, [], [1, 2, 3] }
-```
-
-Operators are also represented as such tuples:
-
-```iex
-iex> quote do: 1 + 2
-{:+, [context: Elixir, import: Kernel], [1, 2]}
-```
-
-Even a tuple is represented as a call to `{}`:
-
-```iex
-iex> quote do: { 1, 2, 3 }
-{ :{}, [], [1, 2, 3] }
-```
-
-Variables are also represented using tuples, except the last element is an atom, instead of a list:
-
-```iex
-iex> quote do: x
-{ :x, [], Elixir }
-```
-
-When quoting more complex expressions, we can see the representation is composed of such tuples, which are nested on each other resembling a tree where each tuple is a node:
-
-```iex
-iex> quote do: sum(1, 2 + 3, 4)
-{:sum, [], [1, {:+, [context: Elixir, import: Kernel], [2, 3]}, 4]}
-```
-
-In general, each node (tuple) above follows the following format:
-
-```elixir
-{ tuple | atom, list, list | atom }
-```
-
-* The first element of the tuple is an atom or another tuple in the same representation;
-* The second element of the tuple is an list of metadata, it may hold information like the node line number;
-* The third element of the tuple is either a list of arguments for the function call or an atom. When an atom, it means the tuple represents a variable.
-
-Besides the node defined above, there are also five Elixir literals that when quoted return themselves (and not a tuple). They are:
-
-```elixir
-:sum         #=> Atoms
-1.0          #=> Numbers
-[1,2]        #=> Lists
-"binaries"   #=> Strings
-{key, value} #=> Tuples with two elements
-```
-
-With those basic structures in mind, we are ready to define our own macro.
-
-## 5.2 Defining our own macro
-
-A macro can be defined using `defmacro`. For instance, in just a few lines of code we can define a macro called `unless` which does the opposite of `if`:
-
-```elixir
-defmodule MyMacro do
-  defmacro unless(clause, options) do
-    quote do: if(!unquote(clause), unquote(options))
-  end
-end
-```
-
-Similarly to `if`, `unless` expects two arguments: a `clause` and `options`:
-
-```elixir
-require MyMacro
-MyMacro.unless var, do: IO.puts "false"
-```
-
-However, since `unless` is a macro, its arguments are not evaluated when it's invoked but are instead passed literally. For example, if one calls:
-
-```elixir
-unless 2 + 2 == 5, do: call_function()
-```
-
-Our `unless` macro will receive the following:
-
-```elixir
-unless({:==, [], [{:+, [], [2, 2]}, 5]}, { :call_function, [], [] })
-```
-
-Then our `unless` macro will call `quote` to return a tree representation of the `if` clause. This means we are transforming our `unless` into an `if`!
-
-There is a common mistake when quoting expressions which is that developers usually forget to `unquote` the proper expression. In order to understand what `unquote` does, let's simply remove it:
-
-```elixir
-defmacro unless(clause, options) do
-  quote do: if(!clause, options)
-end
-```
-
-When called as `unless 2 + 2 == 5, do: call_function()`, our `unless` would then literally return:
-
-```elixir
-if(!clause, options)
-```
-
-Which would fail because the clause and options variables are not defined in the current scope. If we add `unquote` back:
-
-```elixir
-defmacro unless(clause, options) do
-  quote do: if(!unquote(clause), unquote(options))
-end
-```
-
-`unless` will then return:
-
-```elixir
-if(!(2 + 2 == 5), do: call_function())
-```
-
-In other words, `unquote` is a mechanism to inject expressions into the tree being quoted and it is an essential tool for meta-programming. Elixir also provides `unquote_splicing` allowing us to inject many expressions at once.
-
-We can define any macro we want, including ones that override the built-in macros provided by Elixir. For instance, you can redefine `case`, `receive`, `+`, etc. The only exceptions are Elixir special forms that cannot be overridden, [the full list of special forms is available in `Kernel.SpecialForms`](/docs/stable/Kernel.SpecialForms.html).
-
-## 5.3 Macros hygiene
-
-Elixir macros have late resolution. This guarantees that a variable defined inside a quote won't conflict with a variable defined in the context where that macro is expanded. For example:
-
-```elixir
-defmodule Hygiene do
-  defmacro no_interference do
-    quote do: a = 1
-  end
-end
-
-defmodule HygieneTest do
-  def go do
-    require Hygiene
-    a = 13
-    Hygiene.no_interference
-    a
-  end
-end
-
-HygieneTest.go
-# => 13
-```
-
-In the example above, even if the macro injects `a = 1`, it does not affect the variable `a` defined by the `go` function. In case the macro wants to explicitly affect the context, it can use `var!`:
-
-```elixir
-defmodule Hygiene do
-  defmacro interference do
-    quote do: var!(a) = 1
-  end
-end
-
-defmodule HygieneTest do
-  def go do
-    require Hygiene
-    a = 13
-    Hygiene.interference
-    a
-  end
-end
-
-HygieneTest.go
-# => 1
-```
-
-Variables hygiene only works because Elixir annotates variables with their context. For example, a variable `x` defined at the line 3 of a module, would be represented as:
-
-    { :x, [line: 3], nil }
-
-However, a quoted variable is represented as:
-
-```elixir
-defmodule Sample do
-  def quoted do
-    quote do: x
-  end
-end
-
-Sample.quoted #=> { :x, [line: 3], Sample }
-```
-
-Notice that the third element in the quoted variable is the atom `Sample`, instead of `nil`, which marks the variable as coming from the `Sample` module. Therefore, Elixir considers those two variables come from different contexts and handle them accordingly.
-
-Elixir provides similar mechanisms for imports and aliases too. This guarantees macros will behave as specified by its source module rather than conflicting with the target module.
-
-## 5.4 Private macros
-
-Elixir also supports private macros via `defmacrop`. As private functions, these macros are only available inside the module that defines them, and only at compilation time. A common use case for private macros is to define guards that are frequently used in the same module:
-
-```elixir
-defmodule MyMacros do
-  defmacrop is_even?(x) do
-    quote do
-      rem(unquote(x), 2) == 0
-    end
-  end
-
-  def add_even(a, b) when is_even?(a) and is_even?(b) do
-    a + b
-  end
-end
-```
-
-It is important that the macro is defined before its usage. Failing to define a macro before its invocation will raise an error at runtime, since the macro won't be expanded and will be translated to a function call:
-
-```elixir
-defmodule MyMacros do
-  def four, do: two + two
-  defmacrop two, do: 2
-end
-
-MyMacros.four #=> ** (UndefinedFunctionError) undefined function: two/0
-```
-
-## 5.5 Code execution
-
-To finish our discussion about macros, we are going to briefly discuss how code execution works in Elixir. Code execution in Elixir is done in two steps:
-
-1) All the macros in the code are expanded recursively;
-
-2) The expanded code is compiled to Erlang bytecode and executed
-
-This behavior is important to understand because it affects how we think about our code structure. Consider the following code:
-
-```elixir
-defmodule Sample do
-  case System.get_env("FULL") do
-    "true" ->
-      def full?(), do: true
-    _ ->
-      def full?(), do: false
-  end
-end
-```
-
-The code above will define a function `full?` which will return true or false depending on the value of the environment variable `FULL` at **compilation time**. In order to execute this code, Elixir will first expand all macros. Considering that `defmodule` and `def` are macros, the code will expand to something like:
-
-```elixir
-:elixir_module.store Sample, fn ->
-  case System.get_env("FULL") do
-    "true" ->
-      :elixir_def.store(Foo, :def, :full?, [], true)
-    _ ->
-      :elixir_def.store(Foo, :def, :full?, [], false)
-end
-```
-
-This code will then be executed, define a module `Foo` and store the appropriate function based on the value of the environment variable `FULL`. We achieve this by using the modules `:elixir_module` and `:elixir_def`, which are Elixir internal modules written in Erlang.
-
-There are two lessons to take away from this example:
-
-1) a macro is always expanded, regardless if it is inside a `case` branch that won't actually match when executed;
-
-2) we cannot invoke a function or macro just after it is defined in a module. For example, consider:
-
-```elixir
-defmodule Sample do
-  def full?, do: true
-  IO.puts full?
-end
-```
-
-  The example above will fail because it translates to:
-
-```elixir
-:elixir_module.store Sample, fn ->
-  :elixir_def.store(Foo, :def, :full?, [], true)
-  IO.puts full?
-end
-```
-
-At the moment the module is being defined, there isn't **yet** a function named `full?` defined in the module, so `IO.puts full?` will cause the compilation to fail.
-
-## 5.6 Don't write macros
-
-Although macros are a powerful construct, the first rule of the macro club is **don't write macros**. Macros are harder to write than ordinary Elixir functions, and it's considered to be bad style to use them when they're not necessary. Elixir already provides elegant mechanisms to write your every day code and macros should be saved as last resort.
-
-With those lessons, we finish our introduction to macros. Next, let's move to the next chapter which will discuss several topics such as documentation, partial application and others.
diff --git a/getting_started/6.markdown b/getting_started/6.markdown
deleted file mode 100644
index d2525fef0..000000000
--- a/getting_started/6.markdown
+++ /dev/null
@@ -1,292 +0,0 @@
----
-layout: getting_started
-title: 6 Other topics
-guide: 6
-total_guides: 7
----
-
-# {{ page.title }}
-
-This chapter contains different small topics that are part of Elixir's day to day work. We will learn about writing documentation, list and binary comprehensions, partial function application and more!
-
-## 6.1 String sigils
-
-Elixir provides string sigils via the token `~`:
-
-```elixir
-~s(String with escape codes \x26 interpolation)
-~S(String without escape codes and without #{interpolation})
-```
-
-Sigils starting with an uppercase letter never escape characters or do interpolation. Notice the separators are not necessarily parenthesis, but any non-alphanumeric character:
-
-```elixir
-~s-another string-
-```
-
-Internally, `~s` is translated as a call to `sigil_s`. For instance, the docs for `~s` are available in the macro [`sigil_s/2`](/docs/stable/Kernel.html#sigil_s/2) defined in the `Kernel` module.
-
-The sigils defined in Elixir by default are:
-
-* `~c` and `~C` - Returns a char list;
-* `~r` and `~R` - Returns a regular expression;
-* `~s` and `~S` - Returns a string;
-* `~w` and `~W` - Returns a list of "words" split by whitespace;
-
-## 6.2 Heredocs
-
-Elixir supports heredocs as a way to define long strings. Heredocs are delimited by triple double-quotes for string or triple single-quotes for char lists:
-
-```elixir
-"""
-String heredoc
-"""
-
-'''
-Charlist heredoc
-'''
-```
-
-The heredoc ending must be in a line on its own, otherwise it is part of the heredoc:
-
-```elixir
-"""
-String heredocs in Elixir use """
-"""
-```
-
-Notice the sigils discussed in the previous section are also available as heredocs:
-
-```elixir
-~S"""
-A heredoc without escaping or interpolation
-"""
-```
-
-## 6.3 Documentation
-
-Elixir uses module attributes described in chapter 3 to drive its documentation system. For instance, consider the following example:
-
-```elixir
-defmodule MyModule do
-  @moduledoc "it does x"
-
-  @doc "returns the version"
-  def version, do: 1
-end
-```
-
-In the example above, we are adding a module documentation to `MyModule` via `@moduledoc` and using `@doc` to document each function. When compiled, we are able to inspect the documentation attributes at runtime (remember to start iex in the same directory in which you compiled the module):
-
-    $ elixirc my_module.ex
-    $ iex
-
-```iex
-iex> MyModule.__info__(:docs)
-[{ { :version, 0 }, 5, :def, [], "Returns the version" }]
-iex> MyModule.__info__(:moduledoc)
-{1,"It does X"}
-```
-
-`__info__(:docs)` returns a list of tuples where each tuple contains a function/arity pair, the line the function was defined on, the kind of the function (either `def` or `defmacro`, private functions defined with `defp` or `defmacrop` cannot be documented), the function arguments and its documentation. The comment will be either a binary or `nil` (not given) or `false` (explicit no doc).
-
-Similarly, `__info__(:moduledoc)` returns a tuple with the line the module was defined on and its documentation.
-
-Elixir promotes the use of markdown with heredocs to write readable documentation:
-
-```elixir
-defmodule Math do
-  @moduledoc """
-  This module provides mathematical functions
-  as sin, cos and constants like pi.
-
-  ## Examples
-
-      Math.pi
-      #=> 3.1415...
-
-  """
-end
-```
-
-## 6.4 IEx Helpers
-
-Elixir's interactive console (IEx) ships with many functions to make the developer's life easier. One of these functions is called `h`, which shows documentation directly at the command line:
-
-```iex
-iex> h()
-# IEx.Helpers
-...
-:ok
-```
-
-As you can see, invoking `h()` prints the documentation of `IEx.Helpers`. From there, we can navigate to any of the other helpers by giving its name and arity to get more information:
-
-```iex
-iex> h(c/2)
-* def c(files, path \\ ".")
-...
-:ok
-```
-
-This functionality can also be used to print the documentation for any Elixir module in the system:
-
-```iex
-iex> h(Enum)
-...
-iex> h(Enum.each/2)
-...
-```
-
-The documentation for built-in functions can also be accessed directly or indirectly from the `Kernel` module:
-
-```iex
-iex> h(is_atom/1)
-...
-iex> h(Kernel.is_atom/1)
-...
-```
-
-## 6.5 Function capture
-
-Functions in Elixir are identified by their name and arity (the number of arguments it expects). Since passing functions around is a common practice in Elixir, Elixir provides the capture operator `&` as a convenience. Consider this example:
-
-```iex
-iex> list = ["foo", "bar", "baz"]
-["foo","bar","baz"]
-iex> Enum.map list, fn(x) -> size(x) end
-[3,3,3]
-```
-
-We could write the second line using the capture operator as:
-
-```iex
-iex> Enum.map list, &size/1
-[3,3,3]
-```
-
-The capture operator retrieves the function size with arity 1 as an anonymous function and passes it down to `Enum.map/2`. Remote calls can also be captured:
-
-```iex
-iex> fun = &Kernel.size/1
-&Kernel.size/1
-iex> fun.("hello")
-5
-```
-
-A capture also allows the captured functions to be partially applied, for example:
-
-```iex
-iex> fun = &rem(&1, 2)                  
-#Function<6.80484245 in :erl_eval.expr/5>
-iex> fun.(4)
-0
-```
-
-In the example above, we use `&1` as a placeholder, generating a function with one argument. The capture above is equivalent to `fn(x) -> rem(x, 2) end`.
-
-Since operators are treated as regular function calls in Elixir, they are also supported, although they require explicit parentheses:
-
-```iex
-iex> fun = &(&1 + &2)
-iex> fun.(1, 2)
-3
-```
-
-The capture operator is a handy way of capturing functions and passing them around as anonymous functions. To learn more, [read the documentation](http://elixir-lang.org/docs/stable/Kernel.SpecialForms.html#&/1).
-
-## 6.6 Use
-
-`use` is a macro that provides a common API for extension. For instance, in order to use the `ExUnit` test framework that ships with Elixir, you simply need to use `ExUnit.Case` in your module:
-
-```elixir
-defmodule AssertionTest do
-  use ExUnit.Case, async: true
-
-  test "always pass" do
-    true = true
-  end
-end
-```
-
-This allows `ExUnit.Case` to configure and set up the module for testing, for example, by making the `test` macro used above available.
-
-The implementation of the `use` macro is actually quite trivial. When you invoke `use` with a module, it invokes a hook called `__using__` in this module. For example, the `use` call above is simply a translation to:
-
-```elixir
-defmodule AssertionTest do
-  require ExUnit.Case
-  ExUnit.Case.__using__(async: true)
-
-  test "always pass" do
-    true = true
-  end
-end
-```
-
-In general, we recommend APIs to provide a `__using__` hook in case they want to expose functionality to developers.
-
-## 6.7 Comprehensions
-
-Elixir also provides list and bit comprehensions. List comprehensions allow you to quickly build a list from another list:
-
-```iex
-iex> lc n inlist [1,2,3,4], do: n * 2
-[2,4,6,8]
-```
-
-Or, using keywords blocks:
-
-```elixir
-lc n inlist [1,2,3,4] do
-  n * 2
-end
-```
-
-A comprehension accepts many generators (given by `inlist` or `inbits` operators) as well as filters:
-
-```iex
-# A comprehension with a generator and a filter
-iex> lc n inlist [1,2,3,4,5,6], rem(n, 2) == 0, do: n
-[2,4,6]
-
-# A comprehension with two generators
-iex> lc x inlist [1,2], y inlist [2,3], do: x*y
-[2,3,4,6]
-```
-
-Elixir provides generators for both lists and bitstrings:
-
-```iex
-# A list generator:
-iex> lc n inlist [1,2,3,4], do: n * 2
-[2,4,6,8]
-
-# A bit string generator:
-iex> lc <<n>> inbits <<1,2,3,4>>, do: n * 2
-[2,4,6,8]
-```
-
-Bit string generators are quite useful when you need to organize streams:
-
-```iex
-iex> pixels = <<213,45,132,64,76,32,76,0,0,234,32,15>>
-iex> lc <<r :: size(8), g :: size(8), b :: size(8)>> inbits pixels, do: {r,g,b}
-[{213,45,132},{64,76,32},{76,0,0},{234,32,15}]
-```
-
-Remember, as strings are binaries and a binary is a bitstring, we can also use strings in comprehensions. For instance, the example below removes all white space characters from a string via bit comprehensions:
-
-```iex
-iex> bc <<c>> inbits " hello world ", c != ?\s, do: <<c>>
-"helloworld"
-```
-
-## 6.8 Pseudo variables
-
-Elixir provides a set of pseudo-variables. These variables can only be read and never assigned to. They are:
-
-* `__MODULE__` - Returns an atom representing the current module or nil;
-* `__DIR__` - Returns a string representing the current directory;
-* `__ENV__` - Returns a [Macro.Env](/docs/stable/Macro.Env.html) record with information about the compilation environment. Here we can access the current module, function, line, file and others;
-* `__CALLER__` - Also returns a [Macro.Env](/docs/stable/Macro.Env.html) record but with information of the calling site. `__CALLER__` is available only inside macros;
diff --git a/getting_started/7.markdown b/getting_started/7.markdown
deleted file mode 100644
index 8e4ba83b1..000000000
--- a/getting_started/7.markdown
+++ /dev/null
@@ -1,51 +0,0 @@
----
-layout: getting_started
-title: 7 Where To Go Next
-guide: 7
-total_guides: 7
----
-
-# {{ page.title }}
-
-## 7.1 Applications
-
-In order to get your first project started, Elixir ships with a build tool called [`Mix`](/getting_started/mix/1.html). You can get your new project started by simply running:
-
-    mix new path/to/new/project
-
-You can learn more about Elixir and other applications in the links below:
-
-* [Mix - a build tool for Elixir](/getting_started/mix/1.html)
-* [ExUnit - a unit test framework](/getting_started/ex_unit/1.html)
-
-## 7.2 A Byte of Erlang
-
-As the main page of this site puts it:
-
-> Elixir is a programming language built on top of the Erlang VM.
-
-Sooner than later, an Elixir developer will want to interface with existing Erlang libraries. Here's a list of online resources that cover Erlang's fundamentals and its more advanced features:
-
-* This [Erlang Syntax: A Crash Course][1] provides a concise intro to Erlang's syntax. Each code snippet is accompanied by equivalent code in Elixir. This is an opportunity for you to not only get some exposure to the Erlang's syntax but also review some of the things you have learned in the present guide.
-
-* Erlang's official website has a short [tutorial][2] with pictures that briefly describe Erlang's primitives for concurrent programming.
-
-* [Learn You Some Erlang for Great Good!][4] is an excellent introduction to Erlang, its design principles, standard library, best practices and much more. If you are serious about Elixir, you'll want to get a solid understanding of Erlang principles. Once you have read through the crash course mentioned above, you'll be able to safely skip the first couple of chapters in the book that mostly deal with the syntax. When you reach [The Hitchhiker's Guide to Concurrency][5] chapter, that's where the real fun starts.
-
-## 7.3 Reference Manual
-
-[You can also check the source code of Elixir itself][3], which is mainly written in Elixir (mainly the `lib` directory), or [explore Elixir's documentation][7].
-
-## 7.4 Join The Community
-
-Remember that in case of any difficulties, you can always visit the **#elixir-lang** channel on **irc.freenode.net** or send a message to the [mailing list][6]. You can be sure that there will be someone willing to help. And to keep posted on the latest news and announcements, follow the [blog][9] and join [elixir-core mailing list][8].
-
-  [1]: http://elixir-lang.org/crash-course.html
-  [2]: http://www.erlang.org/course/concurrent_programming.html
-  [3]: https://github.com/elixir-lang/elixir
-  [4]: http://learnyousomeerlang.com/
-  [5]: http://learnyousomeerlang.com/the-hitchhikers-guide-to-concurrency
-  [6]: http://groups.google.com/group/elixir-lang-talk
-  [7]: http://elixir-lang.org/docs.html
-  [8]: http://groups.google.com/group/elixir-lang-core
-  [9]: http://elixir-lang.org/blog/

From b1a7e767013375ec073278f1ef3040047134db22 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sun, 23 Feb 2014 17:48:24 +0100
Subject: [PATCH 047/160] Add chapter on case, cond and if

---
 _layouts/getting_started.html |   3 +-
 getting_started/2.markdown    |  45 +++++++-
 getting_started/4.markdown    |  29 ++++-
 getting_started/5.markdown    | 200 ++++++++++++++++++++++++++++++++++
 4 files changed, 271 insertions(+), 6 deletions(-)
 create mode 100644 getting_started/5.markdown

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index db79a77a6..df4e96680 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -1,6 +1,6 @@
 ---
 section: getting_started
-total_guides: 4
+total_guides: 5
 ---
 
 {% include top.html %}
@@ -15,6 +15,7 @@ <h3 class="widget-title">Index</h3>
       <li><a class="spec" href="/getting_started/2.html">Basic types</a></li>
       <li><a class="spec" href="/getting_started/3.html">Basic operators</a></li>
       <li><a class="spec" href="/getting_started/4.html">Pattern matching</a></li>
+      <li><a class="spec" href="/getting_started/5.html">case, cond and if</a></li>
     </ol>
   </div>
   <div class="widget">
diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index c0d76d4d0..453c3e576 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -184,7 +184,46 @@ true
 
 We will talk more about Unicode support and the difference in between single and double-quoted strings in the "Binaries, strings and char lists" chapter.
 
-## 2.5 Lists
+## 2.5 Anonymous functions
+
+Functions are delimited by the keywords `fn` and `end`:
+
+```iex
+iex> add = fn a, b -> a + b end
+#Function<12.71889879/2 in :erl_eval.expr/5>
+iex> is_function(add)
+true
+iex> is_function(add, 2)
+true
+iex> is_function(add, 1)
+false
+iex> add.(1, 2)
+3
+```
+
+Functions can be passed as argument to other functions. In the example, we have passed the function in the variable `add` to the `is_function/1` function which correctly returned true. We can also check the arity of the function by calling `is_function/2`. Note a dot (`.`) in between the variable and parenthesis is required to invoke an anonymous function.
+
+Anonymous functions are closures and as such they can access variables defined prior to the function definition:
+
+```iex
+iex> add_two = fn a -> add(a, 2) end
+#Function<6.71889879/1 in :erl_eval.expr/5>
+iex> add_two.(2)
+4
+```
+
+Keep in mind that a variable defined inside the function does not affect its surroundings:
+
+```iex
+iex> x = 42
+42
+iex> (fn -> x = 0 end).()
+0
+iex> x
+42
+```
+
+## 2.6 Lists
 
 Elixir uses square brackets to specify a list of values. Values can be of any type:
 
@@ -225,7 +264,7 @@ Oops!
 
 We will revisit lists a couple times in the following chapters. If you want to look ahead, the "Pattern matching", "Key-value types", "Binaries, strings and char lists" and "Enumerables" chapters are particularly interesting.
 
-## 2.6 Tuples
+## 2.7 Tuples
 
 Elixir uses curly brackets to define tuples. As lists, tuples can hold any value:
 
@@ -251,7 +290,7 @@ iex> tuple
 
 Notice that `set_elem/3` returned a new tuple. The original tuple stored in the `tuple` variable was not modified. This is true for all language data types because Elixir is an immutable language. By being immutable, Elixir reduces the amount mutable shared state in your code, which eliminates many problems when writing code concurrently or when building fault-tolerant applications.
 
-## 2.7 Lists or tuples?
+## 2.8 Lists or tuples?
 
 You are probably wondering: what is the difference in between a list and a tuple?
 
diff --git a/getting_started/4.markdown b/getting_started/4.markdown
index dae46ea92..fc5dad00f 100644
--- a/getting_started/4.markdown
+++ b/getting_started/4.markdown
@@ -140,7 +140,7 @@ iex> x
 2
 ```
 
-Finally, notice that if a variable is mentioned more than once in a pattern, all references should bind to the same pattern:
+Notice that if a variable is mentioned more than once in a pattern, all references should bind to the same pattern:
 
 ```iex
 iex> {x, x} = {1, 1}
@@ -149,4 +149,29 @@ iex> {x, x} = {1, 2}
 ** (MatchError) no match of right hand side value: {1, 2}
 ```
 
-This finishes our introduction to pattern matching. As we will see in the next chapter, pattern matching is very common in many language constructs and, if you are not familiar with it from other languages, you will get the hang of it with just a bit of practice! So let's talk some control flow structures, like `case` and `cond`, before we move towards more advanced data-types, likes binaries, keyword lists and maps.
+In some cases, you don't care about a particular value in a pattern. In those cases, it is a common practice to bind the value to underscore `_`. For example, if only the head of the list matters to us, we can assign the tail to underscore:
+
+```iex
+iex> [h | _] = [1, 2, 3]
+[1, 2, 3]
+iex> h
+1
+```
+
+The variable `_` in Elixir is special in that it can never be read from. Trying to read from it gives an unbound variable error:
+
+```iex
+iex> _
+** (CompileError) iex:1: unbound variable _
+```
+
+Although pattern matching allows us to build powerful constructs, its usage is limited. For instance, you cannot make function calls on the left side of a match. The following example is invalid:
+
+```iex
+iex> length([1,[2],3]) = 3
+** (ErlangError) erlang error :illegal_pattern
+```
+
+This finishes our introduction to pattern matching. As we will see in the next chapter, pattern matching is very common in many language constructs. If you are not familiar with it from other languages, you will get the hang of it with just a bit of practice!
+
+So let's talk some control flow structures, like `case` and `cond`, before we move towards more advanced data-types, likes binaries, keyword lists and maps.
diff --git a/getting_started/5.markdown b/getting_started/5.markdown
new file mode 100644
index 000000000..3be5253d1
--- /dev/null
+++ b/getting_started/5.markdown
@@ -0,0 +1,200 @@
+---
+layout: getting_started
+title: 5 case, cond and if
+guide: 5
+---
+
+# {{ page.title }}
+
+In this chapter, we will learn about `case`, `cond` and `if` control-flow structures
+
+## 5.1 case
+
+A `case` allows us to compare a value against many patterns until we find a matching one:
+
+```iex
+iex> 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
+```
+
+If you want to pattern match against an existing variable, you need to use the `^` operator:
+
+```iex
+iex> x = 1
+1
+iex> case 10 do
+...>   ^x -> "Won't match"
+...>   _  -> "Will match"
+...> end
+```
+
+Clauses also support special conditions to be specified via guards:
+
+```iex
+iex> case {1, 2, 3} do
+...>   {1, x, 3} when x > 0 ->
+...>     "Will match"
+...>   _ ->
+...>     "Won't match"
+...> end
+```
+
+The first clause above will only match when `x` is positive. The Erlang VM only allows a limited set of expressions in guards:
+
+* comparison operators (`==`, `!=`, `===`, `!==`, `>`, `<`, `<=`, `>=`);
+* boolean operators (`and`, `or`) and negation operators (`not`, `!`);
+* arithmetic operators (`+`, `-`, `*`, `/`);
+* `<>` and `++` as long as the left side is a literal;
+* the `in` operator;
+* all the following type check functions:
+
+    * `is_atom/1`
+    * `is_binary/1`
+    * `is_bitstring/1`
+    * `is_boolean/1`
+    * `is_float/1`
+    * `is_function/1`
+    * `is_function/2`
+    * `is_integer/1`
+    * `is_list/1`
+    * `is_map/1`
+    * `is_number/1`
+    * `is_pid/1`
+    * `is_port/1`
+    * `is_reference/1`
+    * `is_tuple/1`
+
+* plus these functions:
+
+    * `abs(number)`
+    * `bit_size(bitstring)`
+    * `byte_size(bitstring)`
+    * `div(integer, integer)`
+    * `elem(tuple, n)`
+    * `hd(list)`
+    * `length(list)`
+    * `map_size(map)`
+    * `node()`
+    * `node(pid | ref | port)`
+    * `rem(integer, integer)`
+    * `round(number)`
+    * `self()`
+    * `size(tuple | bitstring)`
+    * `tl(list)`
+    * `trunc(number)`
+    * `tuple_size(tuple)`
+
+Keep in mind errors in guards do not leak but simply the guard fail:
+
+```iex
+iex> hd(1)
+** (ArgumentError) argument error
+    :erlang.hd(1)
+iex> case 1 do
+...>   x when hd(x) -> "Won't match"
+...>   x -> "Got: #{x}"
+...> end
+"Got 1"
+```
+
+If none of the clauses match, an error is raised:
+
+```iex
+iex> case :ok do
+...>   :error -> "Won't match"
+...> end
+** (CaseClauseError) no case clause matching: :ok
+```
+
+Note anonymous functions can also have multiple clauses and guards:
+
+```elixir
+iex> f = fn
+...>   x, y when x > 0 -> x + y
+...>   x, y -> x * y
+...> end
+#Function<12.71889879/2 in :erl_eval.expr/5>
+iex> f.(1, 3)
+4
+iex> f.(-1, 3)
+-3
+```
+
+The number of arguments in each anonymous function clause needs to be the same, otherwise an error is raised.
+
+### 5.2 cond
+
+`case` is useful when you need to match against different values. However, in many circunstances, we want to check different conditions and find the first one that evaluates to true. In such cases, one may use `cond`:
+
+```iex
+iex> cond do
+...>   2 + 2 == 5 ->
+...>     "This will be true"
+...>   2 * 2 == 3 ->
+...>     "Nor this"
+...>   1 + 1 == 2 ->
+...>     "But this will"
+...> end
+"But this will"
+```
+
+This is equivalent to `else if` clauses in many imperative languages.
+
+If none of the conditions return true, an error is raised. For this reason, it is common to see a last condition equal to `true`, which will always match:
+
+```iex
+iex> cond do
+...>   2 + 2 == 5 ->
+...>     "This is never true"
+...>   2 * 2 == 3 ->
+...>     "Nor this"
+...>   true ->
+...>     "This is always true (equivalent to else)"
+...> end
+```
+
+Finally, note `cond` considers any value besides `nil` and `false` to be true:
+
+```iex
+iex> cond do
+...>   hd([1,2,3]) ->
+...>     "1 is considered as true"
+...> end
+"1 is considered as true"
+```
+
+### 5.3 if and unless
+
+Besides `case` and `cond`, Elixir also provides the macros `if/2` and `unless/2` which are useful when you need to check for just one condition:
+
+```iex
+iex> if true do
+...>   "This works!"
+...> end
+"This works!"
+iex> unless true do
+...>   "This will never be seen"
+...> end
+nil
+```
+
+If the condition given to `if/2` returns `false` or `nil`, the body given in between `do/end` is not executed and it simply returns `nil`. The opposite happens with `unless/2`.
+
+They also supports `else` blocks:
+
+```iex
+iex> if nil do
+...>   "This won't be seen"
+...> else
+...>   "This will"
+...> end
+"This will"
+```
+
+One curiosity about `if/2` and `unless/2` is that they are implemented as macros in the language, they are not keywords (as they would be in many languages). You can check the documentation and the source of `if/2` in [the `Kernel` module docs](http://elixir-lang.org/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.

From ecefb57ae22130f05e999d2d467c6dc816399960 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sun, 23 Feb 2014 19:09:43 +0100
Subject: [PATCH 048/160] Add binaries, strings and char lists chapter

---
 _layouts/getting_started.html |   3 +-
 getting_started/2.markdown    |  12 ++-
 getting_started/6.markdown    | 194 ++++++++++++++++++++++++++++++++++
 3 files changed, 203 insertions(+), 6 deletions(-)
 create mode 100644 getting_started/6.markdown

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index df4e96680..72751901d 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -1,6 +1,6 @@
 ---
 section: getting_started
-total_guides: 5
+total_guides: 6
 ---
 
 {% include top.html %}
@@ -16,6 +16,7 @@ <h3 class="widget-title">Index</h3>
       <li><a class="spec" href="/getting_started/3.html">Basic operators</a></li>
       <li><a class="spec" href="/getting_started/4.html">Pattern matching</a></li>
       <li><a class="spec" href="/getting_started/5.html">case, cond and if</a></li>
+      <li><a class="spec" href="/getting_started/5.html">Binaries, strings and char lists</a></li>
     </ol>
   </div>
   <div class="widget">
diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 453c3e576..5efe8d462 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -147,7 +147,7 @@ world
 
 Notice the `IO.puts/1` function returns the atom `:ok` as result after printing.
 
-Strings in Elixir are represented internally by binaries (i.e. a bunch of bytes). We usually check if a value is a string or not by using the `is_binary/1` function:
+Strings in Elixir are represented internally by binaries (i.e. a sequence of bytes):
 
 ```iex
 iex> is_binary("hellö")
@@ -223,7 +223,7 @@ iex> x
 42
 ```
 
-## 2.6 Lists
+## 2.6 (Linked) Lists
 
 Elixir uses square brackets to specify a list of values. Values can be of any type:
 
@@ -234,7 +234,7 @@ iex> length [1, 2, 3]
 3
 ```
 
-Two lists can be concatenated and subtracted using the `++/2` operator:
+Two lists can be concatenated and subtracted using the `++/2` and `--/2` operators:
 
 ```iex
 iex> [1, 2, 3] ++ [4, 5, 6]
@@ -307,7 +307,9 @@ iex> File.read("path/to/unknown/file")
 
 If the path given to `File.read/1` exists, it returns a tuple with the atom `:ok` as first element and the contents as second. Otherwise, it returns `:error` and the error reason.
 
-The difference in between tuples and lists is important because it reflects on the operations you will perform on them. Tuples are fast when you need to get its size or access one element in a particular position. On the other hand, those operations are linear on lists: if you need to access the nth-item in a list, Elixir needs to go item by item until we retrieve the desired one. For this reason, we provide a `elem/2` function to access a tuple item but there is no builtin equivalent for lists:
+The difference in between tuples and lists is important because it reflects on the operations you will perform on them. Tuples are fast when you need to get its size or access one element in a particular position. On the other hand, those operations are linear on lists: if you need to access the nth-item of a list, Elixir needs to go item by item until we retrieve the desired one.
+
+This is the reason there is a `elem/2` function to access a tuple item but there is no builtin equivalent for lists:
 
 ```iex
 iex> tuple = {:ok, "hello"}
@@ -320,6 +322,6 @@ iex> elem(tuple, 1)
 
 Finally, notice we have used 4 counting functions so far: `byte_size/1` (for the number of bytes in a string), `size/1` (for the tuple size), `length/1` (for the list length) and `String.length/1` (for the number of characters in a string). Their naming is not arbitrary.
 
-`length` is used when the number of elements needs to be calculated. For example, calling `length` will iterate the whole list to find the number of elements in that list. `size` is the opposite, it means the value is pre-calculated and stored somewhere and therefore retrieving its value is a cheap operation. That said, we use `byte_size` to get the number of bytes in a string, which is cheap, but retrieving the number of unicode characters uses `String.length`, since the whole string needs to be iterated.
+`length` is used when the number of elements needs to be calculated. For example, calling `length` will iterate the whole list to find the number of elements in that list. `size` is the opposite, it means the value is pre-calculated and stored somewhere, therefore retrieving it is a cheap operation. That said, we use `byte_size` to get the number of bytes in a string, which is cheap, but retrieving the number of unicode characters uses `String.length`, since the whole string needs to be iterated.
 
 Elixir also provides `Port`, `Reference`s and `PID`s as data types (usually used in process communication), and we will take a quick look at them when talking about processes. For now, let's take a look at some of the basic operator to use with our basic types.
diff --git a/getting_started/6.markdown b/getting_started/6.markdown
new file mode 100644
index 000000000..cdaed9770
--- /dev/null
+++ b/getting_started/6.markdown
@@ -0,0 +1,194 @@
+---
+layout: getting_started
+title: 6 Binaries, strings and char lists
+guide: 6
+---
+
+# {{ page.title }}
+
+In "Basic Types", we have learned about strings and used the `is_binary/1` function for checks:
+
+```iex
+iex> string = "hello"
+"hello"
+iex> is_binary string
+true
+```
+
+In this chapter, we will understand what are binaries, how they associate with strings and what a single-quoted value, `'like this'`, means in Elixir.
+
+## 6.1 UTF-8 and Unicode
+
+A string is a UTF-8 encoded binary. In order to understand exactly what we mean by that, we need to understand the difference in between bytes and codepoints.
+
+The Unicode standard assigns codepoints to many of the characters we know. For example, the letter `a` has codepoint `97` while the letter `ł` has codepoint `322`. When writing the string `"hełło"` to disk, we need to convert this codepoint to bytes. Since a byte can represent a number from `0` to `255`, if we adopted a rule that said one byte represents one codepoint, we wouldn't be able to write `"hełło"`, because it uses the codepoint `322`. But of course, given you can actually read `"hełło"` in your screen, it means it is represented *somehow*. That's when encodings come in.
+
+When representing codepoints in bytes, we need to encode them somehow, and Elixir chose the UTF-8 encoding as its main and default encoding. When we say a string is a UTF-8 encoded binary, we mean a string is a bunch of bytes, organized in way to represent certain codepoints, as specified by the UTF-8 encoding.
+
+Since we have codepoints like `ł` assigned with the number `322`, we actually need more than one byte to represent it. That's why we see a difference when we calculate the `byte_size/1` of a string compared to its `String.length/1`:
+
+```iex
+iex> string = "hełło"
+"hełło"
+iex> byte_size string
+7
+iex> String.length string
+5
+```
+
+UTF-8 requires on byte to represent the codepoints `h`, `e` and `o`, but two bytes to represent `ł`. In Elixir, you can get a codepoint's value by using `?`:
+
+```iex
+iex> ?a
+97
+iex> ?ł
+322
+```
+
+You can also use the functions in [the `String` module](http://elixir-lang.org/docs/stable/String.html) to split a string in its codepoints:
+
+```iex
+iex> String.codepoints("hełło")
+["h", "e", "ł", "ł", "o"]
+```
+
+You will see that Elixir has excellent support for working with strings and it also supports many of the Unicode operations. In fact, Elixir passes all the tests showcased in the ["The string type is broken"](http://mortoray.com/2013/11/27/the-string-type-is-broken/) article.
+
+However, strings are just part of the story. If a string is a binary and we have used a `is_binary/1` function, Elixir probably has an underlying type, empowering strings, and that is exactly true. Let's talk about binaries!
+
+## 6.2 Binaries (and bit strings)
+
+In Elixir, you can define a binary using `<<>>`:
+
+```iex
+iex> <<0, 1, 2, 3>>
+<<0, 1, 2, 3>>
+iex> byte_size <<0, 1, 2, 3>>
+4
+```
+
+A binary is just a sequence of bytes. Of course those bytes can be organized in any way and they can be organized in a sequence that do not make them a valid string:
+
+```iex
+iex> String.valid?(<239, 191, 191>>)
+false
+```
+
+The string concatenation operation is actually a binary concatenation operator:
+
+```iex
+iex> <<0, 1>> <> <<2, 3>>
+<<0, 1, 2, 3>>
+```
+
+There is a common trick used in Elixir which is to concatenate the null byte `<<0>>` to a string to see its inner binary representation:
+
+```iex
+iex> "hełło" <> <<0>>
+<<104, 101, 197, 130, 197, 130, 111, 0>>
+```
+
+Each number given to a binary is meant to represent a byte and therefore must go up to 255. Binaries allow modifiers to be given to store numbers bigger than 255 or to convert a codepoint to its utf8 representation:
+
+```iex
+iex> <<255>>
+<<255>>
+iex> <<256>> # truncated
+<<0>>
+iex> <<256 :: size(16)>> # use 16 bits to store the number (2 bytes)
+<<1, 0>>
+iex> <<256 :: utf8>> # the number is a codepoint
+"Ā"
+iex> <<256 :: utf8, 0>> # the number is a codepoint
+<<196, 128, 0>>
+```
+
+If a byte has 8 bits, what happens if we pass a size of 1 bit?
+
+```iex
+iex> <<1 :: size(1)>>
+<<1 :: size(1)>>
+iex> <<2 :: size(1)>> # truncated
+<<0>>
+iex> is_binary(<< 1 :: size(1)>>)
+false
+iex> is_bitstring(<< 1 :: size(1)>>)
+true
+iex> bit_size(<< 1 :: size(1)>>)
+1
+```
+
+Interesting... the value is no longer a binary, but a bit string! I.e. it is just a bunch of bits. So a binary is a bitstring when the number of bits is divisible by 8!
+
+We can also pattern match on binaries / bitstrings:
+
+```iex
+iex> <<0, 1, x>> = <<0, 1, 2>>
+<<0, 1, 2>>
+iex> x
+2
+iex> <<0, 1, x>> = <<0, 1, 2, 3>>
+** (MatchError) no match of right hand side value: <<0, 1, 2, 3>>
+```
+
+Note each entry in the binary is expected to match exactly 8 bits. However, we can match on the rest of the binary modifier:
+
+```iex
+iex> <<0, 1, x :: binary>> = <<0, 1, 2, 3>>
+<<0, 1, 2, 3>>
+iex> x
+<<2, 3>>
+```
+
+The pattern above only works if the binary is at the end of the `<<>>`. Similar results can retrieved with the string concatenation operator `<>`:
+
+```iex
+iex> "he" <> rest = "hello"
+"hello"
+iex> rest
+"llo"
+```
+
+This finishes our tour on bit strings, binaries and strings. A string is a UTF-8 encoded binary and a binary is a bitstring where the number of bits is divisble by 8. Although this shows the flexibility Elixir provides to work with bits and bytes, 99% of the time you will be working with binaries and using the `is_binary/1` and `byte_size/1` functions.
+
+## 6.3 Char lists
+
+A char list is nothing more than a list of characters:
+
+```iex
+iex> 'hełło'
+[104, 101, 322, 322, 111]
+iex> is_list 'hełło'
+```
+
+You can see that, instead of containing bytes, a char list contains the codepoints of the characters in between single-quotes. So while a double-quotes represents a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
+
+In practice, char lists are used mostly when interfacing with Erlang, in particular older libraries that do not accept binaries as arguments. You can convert in between char list to a string or a string to a char list by using the `to_string/1` and `to_char_list/1` functions:
+
+```iex
+iex> to_char_list "hełło"
+[104, 101, 322, 322, 111]
+iex> to_string 'hełło'
+"hełło"
+iex> to_string :hello
+"hello"
+iex> to_string 1
+"1"
+```
+
+Note that those functions are polymorphic. They not only convert char lists to strings, but also integers to strings, atoms to strings and so on.
+
+Before we finish this chapter, we need to briefly talk about `iodata` and `char_data`. Most of the IO operations in Elixir do not only accept strings or char lists but actually a combination of those:
+
+```iex
+iex> IO.puts "hello world"
+hello world
+:ok
+iex> IO.puts ['hello', ?\s, "world"]
+hello world
+:ok
+```
+
+When the elements of a list represents bytes (i.e. their maximum value is 255), we have a `iodata`. However, when the elements of a list represents codepoints, we have a `char_data`. We use `iodata` when a file is opened in raw mode. Since we don't know how the file is encoded, we can't accept UTF-8 data, so we just use raw binaries and lists. However, if the file is opened in UTF-8 mode, we can work with the higher-level char data.
+
+Elixir provides `iodata_to_binary` to convert any `iodata` to binary. The functions `String.from_char_data!` and `List.from_char_data!` can be used to convert char data into strings or char lists respectively.

From ed8a7d18e465f642dc812f766ddf727959833aa4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sun, 23 Feb 2014 20:10:24 +0100
Subject: [PATCH 049/160] Move iodata and char_data footnote to its own chapter

---
 _layouts/getting_started.html |  6 ++++--
 getting_started/2.markdown    |  2 +-
 getting_started/6.markdown    | 17 +----------------
 getting_started/7.markdown    | 14 ++++++++++++++
 getting_started/8.markdown    | 31 +++++++++++++++++++++++++++++++
 5 files changed, 51 insertions(+), 19 deletions(-)
 create mode 100644 getting_started/7.markdown
 create mode 100644 getting_started/8.markdown

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index 72751901d..62d790956 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -1,6 +1,6 @@
 ---
 section: getting_started
-total_guides: 6
+total_guides: 8
 ---
 
 {% include top.html %}
@@ -16,7 +16,9 @@ <h3 class="widget-title">Index</h3>
       <li><a class="spec" href="/getting_started/3.html">Basic operators</a></li>
       <li><a class="spec" href="/getting_started/4.html">Pattern matching</a></li>
       <li><a class="spec" href="/getting_started/5.html">case, cond and if</a></li>
-      <li><a class="spec" href="/getting_started/5.html">Binaries, strings and char lists</a></li>
+      <li><a class="spec" href="/getting_started/6.html">Binaries, strings and char lists</a></li>
+      <li><a class="spec" href="/getting_started/7.html">Keywords, maps and dicts</a></li>
+      <li><a class="spec" href="/getting_started/8.html">IO</a></li>
     </ol>
   </div>
   <div class="widget">
diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 5efe8d462..3034dcf74 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -262,7 +262,7 @@ iex> hd []
 
 Oops!
 
-We will revisit lists a couple times in the following chapters. If you want to look ahead, the "Pattern matching", "Key-value types", "Binaries, strings and char lists" and "Enumerables" chapters are particularly interesting.
+We will revisit lists a couple times in the following chapters. If you want to look ahead, the "Pattern matching", "Binaries, strings and char lists" and "Enumerables" chapters are particularly interesting.
 
 ## 2.7 Tuples
 
diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index cdaed9770..8dbfcdda1 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -176,19 +176,4 @@ iex> to_string 1
 "1"
 ```
 
-Note that those functions are polymorphic. They not only convert char lists to strings, but also integers to strings, atoms to strings and so on.
-
-Before we finish this chapter, we need to briefly talk about `iodata` and `char_data`. Most of the IO operations in Elixir do not only accept strings or char lists but actually a combination of those:
-
-```iex
-iex> IO.puts "hello world"
-hello world
-:ok
-iex> IO.puts ['hello', ?\s, "world"]
-hello world
-:ok
-```
-
-When the elements of a list represents bytes (i.e. their maximum value is 255), we have a `iodata`. However, when the elements of a list represents codepoints, we have a `char_data`. We use `iodata` when a file is opened in raw mode. Since we don't know how the file is encoded, we can't accept UTF-8 data, so we just use raw binaries and lists. However, if the file is opened in UTF-8 mode, we can work with the higher-level char data.
-
-Elixir provides `iodata_to_binary` to convert any `iodata` to binary. The functions `String.from_char_data!` and `List.from_char_data!` can be used to convert char data into strings or char lists respectively.
+Note that those functions are polymorphic. They not only convert char lists to strings, but also integers to strings, atoms to strings and so on. With binaries, strings and char lists out of the way, it is time to talk about key-value data structures.
diff --git a/getting_started/7.markdown b/getting_started/7.markdown
new file mode 100644
index 000000000..0668c6814
--- /dev/null
+++ b/getting_started/7.markdown
@@ -0,0 +1,14 @@
+---
+layout: getting_started
+title: 7 Keywords, maps and dicts
+guide: 7
+---
+
+# {{ page.title }}
+
+## 7.1 Keyword lists
+
+## 7.2 Maps
+
+## 7.3 Dicts
+
diff --git a/getting_started/8.markdown b/getting_started/8.markdown
new file mode 100644
index 000000000..b72980f0b
--- /dev/null
+++ b/getting_started/8.markdown
@@ -0,0 +1,31 @@
+---
+layout: getting_started
+title: 8 IO
+guide: 8
+---
+
+# {{ page.title }}
+
+
+## 8.X `iodata` and `char_data`
+
+In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
+
+The functions in `IO` and `File` also allow lists to given as arguments. Not only that, they also allow a mixed list of lists, integers and binaries to be given:
+
+```iex
+iex> IO.puts 'hello world'
+hello world
+:ok
+iex> IO.puts ['hello', ?\s, "world"]
+hello world
+:ok
+```
+
+However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends when on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
+
+On the other hand, the `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
+
+This is a subtle difference but you only need to be aware of it if you intend to pass lists to those functions. Since strings are always encoded as UTF-8 in binaries and binaries contains bytes, their representation is always raw.
+
+Overall, Elixir provides `iodata_to_binary` to convert any `iodata` to binary. The functions `String.from_char_data!` and `List.from_char_data!` can be used to convert char data into strings or char lists respectively.

From a4d1ec091aab5b6697d33afab57d71a99069d8f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Mon, 24 Feb 2014 10:27:07 +0100
Subject: [PATCH 050/160] Keywords, maps and dicts

---
 getting_started/5.markdown |  65 +++++++++++++++
 getting_started/6.markdown |   2 +-
 getting_started/7.markdown | 166 +++++++++++++++++++++++++++++++++++++
 3 files changed, 232 insertions(+), 1 deletion(-)

diff --git a/getting_started/5.markdown b/getting_started/5.markdown
index 3be5253d1..ed0ca8be3 100644
--- a/getting_started/5.markdown
+++ b/getting_started/5.markdown
@@ -198,3 +198,68 @@ iex> if nil do
 ```
 
 One curiosity about `if/2` and `unless/2` is that they are implemented as macros in the language, they are not keywords (as they would be in many languages). You can check the documentation and the source of `if/2` in [the `Kernel` module docs](http://elixir-lang.org/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
+
+### 5.4 `do` blocks
+
+At this point, we have learned 4 control structures, `case`, `cond`, `if` and `unless`, and they were all wrapped in `do`/`end` blocks. It happens we could also write `if` as follows:
+
+```iex
+iex> if true, do: 1 + 2
+3
+```
+
+In Elixir, `do`/`end` blocks are a convenience for passing a group of expressions to `do:`. These are equivalent:
+
+```iex
+iex> if true do
+...>   a = 1 + 2
+...>   a + 10
+...> end
+13
+iex> if true, do: (
+...>   a = 1 + 2
+...>   a + 10
+...> )
+13
+```
+
+We say the second syntax is using **keyword lists**. We can pass `else` using this syntax:
+
+```iex
+iex> if false, do: :this, else: :that
+:that
+```
+
+It is important to keep one small detail in mind when using `do`/`end` blocks: they always bind to the farthest function call. For example, the following expression:
+
+```iex
+iex> is_number if true do
+...>  1 + 2
+...> end
+```
+
+Would be parsed as:
+
+```iex
+iex> is_number(if true) do
+...>  1 + 2
+...> end
+```
+
+Which leads to an undefined function error, since `do` is being passed to the `is_number` function, which is then being called with two arguments, and `if` is being called with only one argument. Adding explicit parentheses is enough to resolve the ambiguity:
+
+```iex
+iex> is_number(if true do
+...>  1 + 2
+...> end)
+true
+```
+
+The same rules regarding `do`/`end` blocks also apply to `case`, `cond`, etc:
+
+```iex
+iex> case 1, do: (x -> "Got #{x}")
+"Got 1"
+```
+
+Although it is rare to use the keyword syntax with `case` and `cond`, we will see keyword lists play an important role in the language and are quite common in my functions and macros. We will explore them a bit more in a future chapter, but before, it is time to talk about "Binaries, strings and char lists".
\ No newline at end of file
diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index 8dbfcdda1..e1147cca9 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -36,7 +36,7 @@ iex> String.length string
 5
 ```
 
-UTF-8 requires on byte to represent the codepoints `h`, `e` and `o`, but two bytes to represent `ł`. In Elixir, you can get a codepoint's value by using `?`:
+UTF-8 requires one byte to represent the codepoints `h`, `e` and `o`, but two bytes to represent `ł`. In Elixir, you can get a codepoint's value by using `?`:
 
 ```iex
 iex> ?a
diff --git a/getting_started/7.markdown b/getting_started/7.markdown
index 0668c6814..8d7a9130e 100644
--- a/getting_started/7.markdown
+++ b/getting_started/7.markdown
@@ -6,9 +6,175 @@ guide: 7
 
 # {{ page.title }}
 
+So far, we haven't discussed any associative data structures, i.e. data structures that are able to associate a certain value (or multiple values) to a key. Different languages call them different names, like dictionaries, hashes, associative arrays, maps, etc.
+
+In Elixir, we have two main associative data structures: keyword lists and maps. It is time to learn more about them!
+
 ## 7.1 Keyword lists
 
+In many functional programming languages, it is common to use a list of 2-item tuples as the representation of an associative data structure. In Elixir, when we have a list of tuples and the first item of the tuple (i.e. the key) is an atom, we call it a keyword list:
+
+```iex
+iex> list = [{:a, 1}, {:b, 2}]
+[a: 1, b: 2]
+iex> list == [a: 1, b: 2]
+true
+iex> list[:a]
+1
+```
+
+As we can see above, Elixir supports a special syntax for defining such lists and underneath they just map to a list of tuples. Since they are simply lists, all operations available to lists, including their performance characteristics, also apply to keyword lists.
+
+For example, we can use `++` to add new values to a keyword list:
+
+```iex
+iex> list ++ [c: 3]
+[a: 1, b: 2, c: 3]
+iex> [a: 0] ++ list
+[a: 0, a: 1, b: 2]
+```
+
+Note that values added to the front are the ones fetched on lookup:
+
+```iex
+iex> new_list = [a: 0] ++ list
+[a: 0, a: 1, b: 2]
+iex> new_list[:a]
+0
+```
+
+Keyword lists are important because they have two special characteristics:
+
+* They keep the user order;
+* They allow a key to be given more than once;
+
+For example, [the Ecto library](https://github.com/elixir-lang/ecto) makes use of both features to provide an elegant DSL for writing database queries:
+
+```elixir
+query = from w in Weather,
+      where: w.prcp > 0,
+      where: w.temp < 20,
+     select: w
+```
+
+Those features are what prompted keyword lists to be the default mechanism for passing options to functions in Elixir. In chapter 5, when we discussed the `if/2` macro, we mentioned the following syntax is supported:
+
+```iex
+iex> if false, do: :this, else: :that
+:that
+```
+
+The `do:` and `else:` pairs are keyword lists! In fact, the call above is equivalent to:
+
+```iex
+iex> if(false, [do: :this, else: :that])
+:that
+```
+
+I.e. when the keyword list is the last argument of a function, the square brackets are optional.
+
+In order to manipulate keyword lists, Elixir provides [the `Keyword` module](http://elixir-lang.org/docs/stable/Keyword.html). Remember though keyword lists are simply lists and as such they provide the same linear performance characteristics as lists. The longer the list, the longer it will take to find a key, to count how many items, and so on. For this reason, keyword lists are used in Elixir mainly as options. If you need to store many items or guarantee one-key maps to at maximum one-value, you should use maps instead.
+
+> Note we can also pattern match on keyword lists:
+>
+> ```iex
+> iex> [a: a] = [a: 1]
+> [a: 1]
+> iex> a
+> 1
+> iex> [a: a] = [a: 1, b: 2]
+> ** (MatchError) no match of right hand side value: [a: 1, b: 2]
+> iex> [b: b, a: a] = [a: 1, b: 2]
+> ** (MatchError) no match of right hand side value: [a: 1, b: 2]
+> ```
+>
+> However this is rarely done in practice since pattern matching on lists require the number of items and their internal order to match.
+
 ## 7.2 Maps
 
+Whenever you need a key-value store, maps are the "go to" data structure in Elixir. A map is created using the `%{}` syntax:
+
+```iex
+iex> map = %{:a => 1, 2 => :b}
+%{2 => :b, :a => 1}
+iex> map[:a]
+1
+iex> map[2]
+:b
+```
+
+Compared to keyword lists, we can already see two differences:
+
+* Maps allow any value as key;
+* Maps do not have any specific order;
+
+If you pass duplicate keys when creating a map, the last one wins:
+
+```iex
+iex> %{1 => 1, 1 => 2}
+%{1 => 2}
+```
+
+When all the keys in a map are atoms, you can use the keyword syntax for convenience:
+
+```iex
+iex> map = %{a: 1, b: 2}
+%{a: 1, b: 2}
+```
+
+Opposite to keyword lists, maps are very useful with pattern matching:
+
+```iex
+iex> %{} = %{:a => 1, 2 => :b}
+%{:a => 1, 2 => :b}
+iex> %{:a => a} = %{:a => 1, 2 => :b}
+%{:a => 1, 2 => :b}
+iex> a
+1
+iex> %{:c => c} = %{:a => 1, 2 => :b}
+** (MatchError) no match of right hand side value: %{2 => :b, :a => 1}
+```
+
+As shown above, a map matches as long as the given keys exist on the given map. Therefore, an empty map matches all maps.
+
+One interesting property about maps is that they provide a special syntax for update:
+
+```iex
+iex> map = %{:a => 1, 2 => :b}
+%{:a => 1, 2 => :b}
+iex> %{map | :a => 2}
+%{:a => 2, 2 => :b}
+iex> %{map | :c => 3}
+** (ArgumentError) argument error
+```
+
+The update syntax above requires the given keys to exist. For example, the last line failed because there is no `:c` in the map. This is very useful when you are working with maps on a tight loop and you expect only certain keys to exist. In future chapters, we will also learn about structs, which provide compile-time guarantees and the foundation for polymorphism in Elixir. Structs are built on top of maps where the update guarantees above are proven to be quite useful.
+
+Manipulating maps is done via [the `Map` module](http://elixir-lang.org/docs/stable/Map.html) module and that it provides a very similar API to the `Keyword` module. This is because both modules implement the `Dict` behaviour.
+
+> Maps were recently introduced into the Erlang VM with [the `EEP 43`](www.erlang.org/eeps/eep-0043.html). Erlang 17 provides a partial implementation of the EEP, where only "small maps" are supported. This means maps have good performance characteristics only when storing at maximum a couple dozens keys. To fill in this gap, Elixir also provides [the `HashDict` module](http://elixir-lang.org/docs/stable/HashDict.html) which uses a hashing algorithm to provide a dictionary that supports hundreds of thousands keys with good performance.
+
 ## 7.3 Dicts
 
+In Elixir, both keyword lists and maps are called dictionaries. In other words, a dictionary is like an interface (we call them behaviours in Elixir) and both keyword lists and maps implement this interface.
+
+This interface is defined in the [the `Dict` module](http://elixir-lang.org/docs/stable/Dict.html) module which also provides an API that delegates to the underyling implementations:
+
+```iex
+iex> keyword = []
+[]
+iex> map = %{}
+%{}
+iex> Dict.put(keyword, :a, 1)
+[a: 1]
+iex> Dict.put(map, :a, 1)
+%{a: 1}
+```
+
+The Dict module allows any developer to implement their own variation of Dict, with specific characteristics, and hook into existing Elixir code. The Dict module also provides functions that are meant to work accross dictionaries. For example, `Dict.equal?/2` can compare two dictionaries of any kind.
+
+That said, you may be wondering, which of `Keyword`, `Map` or `Dict` modules should you use in your code? The answer is: it depends.
+
+If your code is expecting a keyword as argument, use explicitly the `Keyword` module. If a map, the `Map` module. However, if your API is meant to work with any dictionary, use the `Dict` module (and be sure to write tests that pass different dict implementations as arguments).
+
+This concludes our introduction to associative data structures in Elixir. You will find out that in between keyword lists and maps, you will have the right tools to tackle many problems that require associative data structures in Elixir.

From 2c776cc225e841b8704dbdca5e2b834d00b2c5b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Mon, 24 Feb 2014 10:34:50 +0100
Subject: [PATCH 051/160] Expand structure for next chapters

---
 _layouts/getting_started.html |  7 ++++++-
 getting_started/10.markdown   |  7 +++++++
 getting_started/11.markdown   |  7 +++++++
 getting_started/12.markdown   | 31 +++++++++++++++++++++++++++++++
 getting_started/13.markdown   |  7 +++++++
 getting_started/7.markdown    | 28 ++++++++++++++--------------
 getting_started/8.markdown    | 26 +-------------------------
 getting_started/9.markdown    |  7 +++++++
 8 files changed, 80 insertions(+), 40 deletions(-)
 create mode 100644 getting_started/10.markdown
 create mode 100644 getting_started/11.markdown
 create mode 100644 getting_started/12.markdown
 create mode 100644 getting_started/13.markdown
 create mode 100644 getting_started/9.markdown

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index 62d790956..1107df3b5 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -18,7 +18,12 @@ <h3 class="widget-title">Index</h3>
       <li><a class="spec" href="/getting_started/5.html">case, cond and if</a></li>
       <li><a class="spec" href="/getting_started/6.html">Binaries, strings and char lists</a></li>
       <li><a class="spec" href="/getting_started/7.html">Keywords, maps and dicts</a></li>
-      <li><a class="spec" href="/getting_started/8.html">IO</a></li>
+      <li><a class="spec" href="/getting_started/8.html">Modules</a></li>
+      <li><a class="spec" href="/getting_started/9.html">Recursion</a></li>
+      <li><a class="spec" href="/getting_started/10.html">alias, require and import</a></li>
+      <li><a class="spec" href="/getting_started/11.html">Module attributes</a></li>
+      <li><a class="spec" href="/getting_started/12.html">IO</a></li>
+      <li><a class="spec" href="/getting_started/13.html">Enumerables</a></li>
     </ol>
   </div>
   <div class="widget">
diff --git a/getting_started/10.markdown b/getting_started/10.markdown
new file mode 100644
index 000000000..8c83d30e4
--- /dev/null
+++ b/getting_started/10.markdown
@@ -0,0 +1,7 @@
+---
+layout: getting_started
+title: 10 alias, require and import
+guide: 10
+---
+
+# {{ page.title }}
diff --git a/getting_started/11.markdown b/getting_started/11.markdown
new file mode 100644
index 000000000..9209e1604
--- /dev/null
+++ b/getting_started/11.markdown
@@ -0,0 +1,7 @@
+---
+layout: getting_started
+title: 11 Module attributes
+guide: 11
+---
+
+# {{ page.title }}
diff --git a/getting_started/12.markdown b/getting_started/12.markdown
new file mode 100644
index 000000000..51fc393c4
--- /dev/null
+++ b/getting_started/12.markdown
@@ -0,0 +1,31 @@
+---
+layout: getting_started
+title: 12 IO
+guide: 12
+---
+
+# {{ page.title }}
+
+
+## 8.X `iodata` and `char_data`
+
+In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
+
+The functions in `IO` and `File` also allow lists to given as arguments. Not only that, they also allow a mixed list of lists, integers and binaries to be given:
+
+```iex
+iex> IO.puts 'hello world'
+hello world
+:ok
+iex> IO.puts ['hello', ?\s, "world"]
+hello world
+:ok
+```
+
+However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends when on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
+
+On the other hand, the `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
+
+This is a subtle difference but you only need to be aware of it if you intend to pass lists to those functions. Since strings are always encoded as UTF-8 in binaries and binaries contains bytes, their representation is always raw.
+
+Overall, Elixir provides `iodata_to_binary` to convert any `iodata` to binary. The functions `String.from_char_data!` and `List.from_char_data!` can be used to convert char data into strings or char lists respectively.
diff --git a/getting_started/13.markdown b/getting_started/13.markdown
new file mode 100644
index 000000000..ada483e01
--- /dev/null
+++ b/getting_started/13.markdown
@@ -0,0 +1,7 @@
+---
+layout: getting_started
+title: 13 Enumerables
+guide: 13
+---
+
+# {{ page.title }}
diff --git a/getting_started/7.markdown b/getting_started/7.markdown
index 8d7a9130e..3b97bbc0f 100644
--- a/getting_started/7.markdown
+++ b/getting_started/7.markdown
@@ -75,20 +75,20 @@ I.e. when the keyword list is the last argument of a function, the square bracke
 
 In order to manipulate keyword lists, Elixir provides [the `Keyword` module](http://elixir-lang.org/docs/stable/Keyword.html). Remember though keyword lists are simply lists and as such they provide the same linear performance characteristics as lists. The longer the list, the longer it will take to find a key, to count how many items, and so on. For this reason, keyword lists are used in Elixir mainly as options. If you need to store many items or guarantee one-key maps to at maximum one-value, you should use maps instead.
 
-> Note we can also pattern match on keyword lists:
->
-> ```iex
-> iex> [a: a] = [a: 1]
-> [a: 1]
-> iex> a
-> 1
-> iex> [a: a] = [a: 1, b: 2]
-> ** (MatchError) no match of right hand side value: [a: 1, b: 2]
-> iex> [b: b, a: a] = [a: 1, b: 2]
-> ** (MatchError) no match of right hand side value: [a: 1, b: 2]
-> ```
->
-> However this is rarely done in practice since pattern matching on lists require the number of items and their internal order to match.
+Note we can also pattern match on keyword lists:
+
+```iex
+iex> [a: a] = [a: 1]
+[a: 1]
+iex> a
+1
+iex> [a: a] = [a: 1, b: 2]
+** (MatchError) no match of right hand side value: [a: 1, b: 2]
+iex> [b: b, a: a] = [a: 1, b: 2]
+** (MatchError) no match of right hand side value: [a: 1, b: 2]
+```
+
+However this is rarely done in practice since pattern matching on lists require the number of items and their internal order to match.
 
 ## 7.2 Maps
 
diff --git a/getting_started/8.markdown b/getting_started/8.markdown
index b72980f0b..6971bf04d 100644
--- a/getting_started/8.markdown
+++ b/getting_started/8.markdown
@@ -1,31 +1,7 @@
 ---
 layout: getting_started
-title: 8 IO
+title: 8 Modules
 guide: 8
 ---
 
 # {{ page.title }}
-
-
-## 8.X `iodata` and `char_data`
-
-In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
-
-The functions in `IO` and `File` also allow lists to given as arguments. Not only that, they also allow a mixed list of lists, integers and binaries to be given:
-
-```iex
-iex> IO.puts 'hello world'
-hello world
-:ok
-iex> IO.puts ['hello', ?\s, "world"]
-hello world
-:ok
-```
-
-However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends when on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
-
-On the other hand, the `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
-
-This is a subtle difference but you only need to be aware of it if you intend to pass lists to those functions. Since strings are always encoded as UTF-8 in binaries and binaries contains bytes, their representation is always raw.
-
-Overall, Elixir provides `iodata_to_binary` to convert any `iodata` to binary. The functions `String.from_char_data!` and `List.from_char_data!` can be used to convert char data into strings or char lists respectively.
diff --git a/getting_started/9.markdown b/getting_started/9.markdown
new file mode 100644
index 000000000..d3ce34c9b
--- /dev/null
+++ b/getting_started/9.markdown
@@ -0,0 +1,7 @@
+---
+layout: getting_started
+title: 9 Recursion
+guide: 9
+---
+
+# {{ page.title }}

From 4ac8a42a98a42338af0d666fe6095844724aab8a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Mon, 24 Feb 2014 10:55:32 +0100
Subject: [PATCH 052/160] Modules

---
 getting_started/2.markdown     |   2 +-
 getting_started/5.markdown     |   2 +-
 getting_started/6.markdown     |   2 +-
 getting_started/7.markdown     |   8 +-
 getting_started/8.markdown     | 242 +++++++++++++++++++++++++++++++++
 getting_started/mix/2.markdown |   6 +-
 6 files changed, 252 insertions(+), 10 deletions(-)

diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 3034dcf74..83193d6f4 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -168,7 +168,7 @@ iex> String.length("hellö")
 5
 ```
 
-The [String module](http://elixir-lang.org/docs/stable/String.html) contains a bunch of functions that operate on strings as defined in the Unicode standard:
+The [String module](/docs/stable/String.html) contains a bunch of functions that operate on strings as defined in the Unicode standard:
 
 ```iex
 iex> String.upcase("hellö")
diff --git a/getting_started/5.markdown b/getting_started/5.markdown
index ed0ca8be3..260fc7661 100644
--- a/getting_started/5.markdown
+++ b/getting_started/5.markdown
@@ -197,7 +197,7 @@ iex> if nil do
 "This will"
 ```
 
-One curiosity about `if/2` and `unless/2` is that they are implemented as macros in the language, they are not keywords (as they would be in many languages). You can check the documentation and the source of `if/2` in [the `Kernel` module docs](http://elixir-lang.org/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
+One curiosity about `if/2` and `unless/2` is that they are implemented as macros in the language, they are not keywords (as they would be in many languages). You can check the documentation and the source of `if/2` in [the `Kernel` module docs](/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
 
 ### 5.4 `do` blocks
 
diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index e1147cca9..84ce6fa59 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -45,7 +45,7 @@ iex> ?ł
 322
 ```
 
-You can also use the functions in [the `String` module](http://elixir-lang.org/docs/stable/String.html) to split a string in its codepoints:
+You can also use the functions in [the `String` module](/docs/stable/String.html) to split a string in its codepoints:
 
 ```iex
 iex> String.codepoints("hełło")
diff --git a/getting_started/7.markdown b/getting_started/7.markdown
index 3b97bbc0f..f727ddb61 100644
--- a/getting_started/7.markdown
+++ b/getting_started/7.markdown
@@ -73,7 +73,7 @@ iex> if(false, [do: :this, else: :that])
 
 I.e. when the keyword list is the last argument of a function, the square brackets are optional.
 
-In order to manipulate keyword lists, Elixir provides [the `Keyword` module](http://elixir-lang.org/docs/stable/Keyword.html). Remember though keyword lists are simply lists and as such they provide the same linear performance characteristics as lists. The longer the list, the longer it will take to find a key, to count how many items, and so on. For this reason, keyword lists are used in Elixir mainly as options. If you need to store many items or guarantee one-key maps to at maximum one-value, you should use maps instead.
+In order to manipulate keyword lists, Elixir provides [the `Keyword` module](/docs/stable/Keyword.html). Remember though keyword lists are simply lists and as such they provide the same linear performance characteristics as lists. The longer the list, the longer it will take to find a key, to count how many items, and so on. For this reason, keyword lists are used in Elixir mainly as options. If you need to store many items or guarantee one-key maps to at maximum one-value, you should use maps instead.
 
 Note we can also pattern match on keyword lists:
 
@@ -150,15 +150,15 @@ iex> %{map | :c => 3}
 
 The update syntax above requires the given keys to exist. For example, the last line failed because there is no `:c` in the map. This is very useful when you are working with maps on a tight loop and you expect only certain keys to exist. In future chapters, we will also learn about structs, which provide compile-time guarantees and the foundation for polymorphism in Elixir. Structs are built on top of maps where the update guarantees above are proven to be quite useful.
 
-Manipulating maps is done via [the `Map` module](http://elixir-lang.org/docs/stable/Map.html) module and that it provides a very similar API to the `Keyword` module. This is because both modules implement the `Dict` behaviour.
+Manipulating maps is done via [the `Map` module](/docs/stable/Map.html) module and that it provides a very similar API to the `Keyword` module. This is because both modules implement the `Dict` behaviour.
 
-> Maps were recently introduced into the Erlang VM with [the `EEP 43`](www.erlang.org/eeps/eep-0043.html). Erlang 17 provides a partial implementation of the EEP, where only "small maps" are supported. This means maps have good performance characteristics only when storing at maximum a couple dozens keys. To fill in this gap, Elixir also provides [the `HashDict` module](http://elixir-lang.org/docs/stable/HashDict.html) which uses a hashing algorithm to provide a dictionary that supports hundreds of thousands keys with good performance.
+> Maps were recently introduced into the Erlang VM with [the `EEP 43`](www.erlang.org/eeps/eep-0043.html). Erlang 17 provides a partial implementation of the EEP, where only "small maps" are supported. This means maps have good performance characteristics only when storing at maximum a couple dozens keys. To fill in this gap, Elixir also provides [the `HashDict` module](/docs/stable/HashDict.html) which uses a hashing algorithm to provide a dictionary that supports hundreds of thousands keys with good performance.
 
 ## 7.3 Dicts
 
 In Elixir, both keyword lists and maps are called dictionaries. In other words, a dictionary is like an interface (we call them behaviours in Elixir) and both keyword lists and maps implement this interface.
 
-This interface is defined in the [the `Dict` module](http://elixir-lang.org/docs/stable/Dict.html) module which also provides an API that delegates to the underyling implementations:
+This interface is defined in the [the `Dict` module](/docs/stable/Dict.html) module which also provides an API that delegates to the underyling implementations:
 
 ```iex
 iex> keyword = []
diff --git a/getting_started/8.markdown b/getting_started/8.markdown
index 6971bf04d..db8850f90 100644
--- a/getting_started/8.markdown
+++ b/getting_started/8.markdown
@@ -5,3 +5,245 @@ guide: 8
 ---
 
 # {{ page.title }}
+
+In Elixir, we group several functions into modules. In the previous chapters, we have used many different modules, like [the `String` module](/docs/stable/String.html):
+
+```iex
+iex> String.length "hello"
+5
+```
+
+In order to create our own modules in Elixir, we use the `defmodule` macro and `def` to define our functions:
+
+```iex
+iex> defmodule Math do
+...>   def sum(a, b) do
+...>     a + b
+...>   end
+...> end
+
+iex> Math.sum(1, 2)
+3
+```
+
+In the following sections, our examples are going to get a bit more complex and it can be tricky to type them all in the shell. It is about time for us to learn how to compile Elixir code and also how to run Elixir scripts.
+
+## 8.1 Compilation
+
+Most of the time it is convenient to write modules into files so they can be compiled and reused. Let's assume we have a file named `math.ex` with the following contents:
+
+```elixir
+defmodule Math do
+  def sum(a, b) do
+    a + b
+  end
+end
+```
+
+This file can be compiled using `elixirc`:
+
+    elixirc math.ex
+
+This will generate a file named `Elixir.Math.beam` containing the bytecode for the defined module. If we start `iex` again, our module definition will be available (considering `iex` is being started in the same directory the bytecode file is):
+
+```iex
+iex> Math.sum(1, 2)
+3
+```
+
+Elixir projects are usually organized into three directories:
+
+* ebin - contains the compiled bytecode
+* lib - contains elixir code (usually `.ex` files)
+* test - contains tests (usually `.exs` files)
+
+When working on actual projects, our build tool called `mix` will be responsible to compile and set up the proper paths for you. For learning purposes, Elixir supports scripted modes, which is more flexible and does not generate any artifact.
+
+## 8.2 Scripted mode
+
+In addition to the Elixir file `.ex`, Elixir also supports `.exs` files for scripting. Elixir treats both files exactly the same way, the only difference is in intention. `.ex` files are meant to be compiled while `.exs` files are used for scripting, without the need for compilation. For instance, one can create a file called `math.exs`:
+
+```elixir
+defmodule Math do
+  def sum(a, b) do
+    a + b
+  end
+end
+
+IO.puts Math.sum(1, 2)
+```
+
+And execute it as:
+
+    elixir math.exs
+
+The file will be compiled in memory and executed, printing "3" as the result. No bytecode file will be created. In the following examples, we recommend you to write your code into script files and execute them as shown above.
+
+## 8.3 Named functions
+
+Inside a module, we can define functions with `def/2` and private functions with `defp/2`. A function defined with `def/2` is available to be invoked from other modules while a private function can only be invoked locally.
+
+```elixir
+defmodule Math do
+  def sum(a, b) do
+    do_sum(a, b)
+  end
+
+  defp do_sum(a, b) do
+    a + b
+  end
+end
+
+Math.sum(1, 2)    #=> 3
+Math.do_sum(1, 2) #=> ** (UndefinedFunctionError)
+```
+
+Function declarations also support guards and multiple clauses. If a function has several clauses, Elixir will try each clause until it finds one that matches. Here is the implementation of a function that checks if the given number is zero or not:
+
+```elixir
+defmodule Math do
+  def zero?(0) do
+    true
+  end
+
+  def zero?(x) when is_number(x) do
+    false
+  end
+end
+
+Math.zero?(0)  #=> true
+Math.zero?(1)  #=> false
+
+Math.zero?([1,2,3])
+#=> ** (FunctionClauseError)
+```
+
+Giving an argument that does not match any of the clauses raises an error.
+
+## 8.4 Function capturing
+
+Throughout this tutorial, we have been using the notation `name/arity` to refer to functions. It happens this notation can actually be used to retrieve a module function as a function type. Let's start `iex` and run the `math.exs` file defined above:
+
+    $ iex math.exs
+
+```iex
+iex> Math.zero?(0)
+true
+iex> fun = &Math.zero?/1
+&Math.zero?/1
+iex> is_function fun
+true
+iex> fun.(0)
+true
+````
+
+Local or imported functions, like `is_function/1`, we can be captured without the module:
+
+```iex
+iex> &is_function/1
+&:erlang.is_function/1
+iex> (&is_function/1).(fun)
+true
+```
+
+Note the capture syntax can also be used as a shortcut for defining functions:
+
+```iex
+iex> fun = &(&1 + 1)
+#Function<6.71889879/1 in :erl_eval.expr/5>
+iex> fun.(1)
+2
+```
+
+The `&1` represents the first argument passed into the function. The syntax above is useful for short function definitions. You can read more about the capture operator `&` in [the `Kernel.SpecialForms` documentation](/docs/stable/Kernel.SpecialForms.html).
+
+## 8.5 Default arguments
+
+Finally, named functions also support default arguments:
+
+```elixir
+defmodule Concat do
+  def join(a, b, sep \\ " ") do
+    a <> sep <> b
+  end
+end
+
+IO.puts Concat.join("Hello", "world")      #=> Hello world
+IO.puts Concat.join("Hello", "world", "_") #=> Hello_world
+```
+
+Any expression is allowed to serve as a default value but it won't be evaluated during the function definition; it will simply be stored for later use. Every time the function is invoked and any of its default values have to be used, the expression for that default value will be evaluated:
+
+```elixir
+defmodule DefaultTest do
+  def dowork(x \\ IO.puts "hello") do
+    x
+  end
+end
+```
+
+```iex
+iex> DefaultTest.dowork 123
+123
+iex> DefaultTest.dowork
+hello
+:ok
+```
+
+If a function with default values has multiple clauses, it is recommended to create a separate clause without an actual body, just for declaring defaults:
+
+```elixir
+defmodule Concat do
+  def join(a, b \\ nil, sep \\ " ")
+
+  def join(a, b, _sep) when nil?(b) do
+    a
+  end
+
+  def join(a, b, sep) do
+    a <> sep <> b
+  end
+end
+
+IO.puts Concat.join("Hello", "world")      #=> Hello world
+IO.puts Concat.join("Hello", "world", "_") #=> Hello_world
+IO.puts Concat.join("Hello")               #=> Hello
+```
+
+When using default values, one must be careful to avoid overlapping function definitions. Consider the following example:
+
+```elixir
+defmodule Concat do
+  def join(a, b) do
+    IO.puts "***First join"
+    a <> b
+  end
+
+  def join(a, b, sep \\ " ") do
+    IO.puts "***Second join"
+    a <> sep <> b
+  end
+end
+```
+
+If we save the code above in a file named "concat.ex" and compile it, Elixir will emit the following warning:
+
+    concat.exs:7: this clause cannot match because a previous clause at line 2 always matches
+
+The compiler is telling us that invoking the `join` function with two arguments will always choose the first definition of `join` whereas the second one will only be invoked when three arguments are passed:
+
+    $ iex concat.exs
+
+```iex
+iex> Concat.join "Hello", "world"
+***First join
+"Helloworld"
+```
+
+```iex
+iex> Concat.join "Hello", "world", "_"
+***Second join
+"Hello_world"
+```
+
+This finishes our short introduction to modules. In the next chapters, we will learn how to use functions for recursion, explore Elixir lexical directives that can be used for importing functions from other modules, as well as module attributes.
diff --git a/getting_started/mix/2.markdown b/getting_started/mix/2.markdown
index 6976cba19..a532dc203 100644
--- a/getting_started/mix/2.markdown
+++ b/getting_started/mix/2.markdown
@@ -122,7 +122,7 @@ iex> :gen_server.call(pid, :pop)
 
 You can see there are two error reports. The first one is generated by server, due to the crash. Since the server is linked to our process, it also sent an exit message which was printed by `IEx` as `** (exit) ...`.
 
-Since our servers may eventually crash, it is common to supervise them, and that's what we are going to next. There is a bit more to `GenServer` than what we have seen here. For more information, check [`GenServer.Behaviour`'s documentation](http://elixir-lang.org/docs/stable/GenServer.Behaviour.html).
+Since our servers may eventually crash, it is common to supervise them, and that's what we are going to next. There is a bit more to `GenServer` than what we have seen here. For more information, check [`GenServer.Behaviour`'s documentation](/docs/stable/GenServer.Behaviour.html).
 
 ## 2.2 Supervising our servers
 
@@ -218,7 +218,7 @@ iex> :gen_server.call(:stacker, :unknown)
     gen_server.erl:180: :gen_server.call/2
 ```
 
-The sixth message no longer generates an error report, since our server was no longer started automatically. Elixir returns `:noproc` (which stands for no process), meaning there isn't a process named `:stacker`. The number of restarts allowed and its time interval can be customized by passing options to the `supervise` function. Different restart strategies, besides the `:one_for_one` used above, can be chosen for the supervisor as well. For more information on the supported options, [check the documentation for `Supervisor.Behaviour`](http://elixir-lang.org/docs/stable/Supervisor.Behaviour.html).
+The sixth message no longer generates an error report, since our server was no longer started automatically. Elixir returns `:noproc` (which stands for no process), meaning there isn't a process named `:stacker`. The number of restarts allowed and its time interval can be customized by passing options to the `supervise` function. Different restart strategies, besides the `:one_for_one` used above, can be chosen for the supervisor as well. For more information on the supported options, [check the documentation for `Supervisor.Behaviour`](/docs/stable/Supervisor.Behaviour.html).
 
 ## 2.3 Who supervises the supervisor?
 
@@ -260,7 +260,7 @@ iex> :gen_server.call(:stacker, :pop)
 :hello
 ```
 
-Amazing, it works! As you may have noticed, the application `start/2` callback receives a type argument, which we have ignored. The type controls how the VM should behave when the supervisor, and consequently our application, crashes. You can learn more about it by [reading the documentation for `Application.Behaviour`](http://elixir-lang.org/docs/stable/Application.Behaviour.html).
+Amazing, it works! As you may have noticed, the application `start/2` callback receives a type argument, which we have ignored. The type controls how the VM should behave when the supervisor, and consequently our application, crashes. You can learn more about it by [reading the documentation for `Application.Behaviour`](/docs/stable/Application.Behaviour.html).
 
 Finally, notice that `mix new` supports a `--sup` option, which tells Mix to generate a supervisor with an application module callback, automating some of the work we have done here. Try it!
 

From a980c7ff0a7094f8d9fdc27966c5ac29879bddd3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Mon, 24 Feb 2014 11:01:51 +0100
Subject: [PATCH 053/160] Recursion

---
 _layouts/getting_started.html | 13 ++---
 getting_started/10.markdown   | 55 ++++++++++++++++++++-
 getting_started/11.markdown   |  4 +-
 getting_started/12.markdown   | 28 +----------
 getting_started/13.markdown   | 28 ++++++++++-
 getting_started/14.markdown   |  7 +++
 getting_started/8.markdown    | 91 +----------------------------------
 getting_started/9.markdown    | 89 +++++++++++++++++++++++++++++++++-
 8 files changed, 187 insertions(+), 128 deletions(-)
 create mode 100644 getting_started/14.markdown

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index 1107df3b5..5f804abec 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -1,6 +1,6 @@
 ---
 section: getting_started
-total_guides: 8
+total_guides: 14
 ---
 
 {% include top.html %}
@@ -19,11 +19,12 @@ <h3 class="widget-title">Index</h3>
       <li><a class="spec" href="/getting_started/6.html">Binaries, strings and char lists</a></li>
       <li><a class="spec" href="/getting_started/7.html">Keywords, maps and dicts</a></li>
       <li><a class="spec" href="/getting_started/8.html">Modules</a></li>
-      <li><a class="spec" href="/getting_started/9.html">Recursion</a></li>
-      <li><a class="spec" href="/getting_started/10.html">alias, require and import</a></li>
-      <li><a class="spec" href="/getting_started/11.html">Module attributes</a></li>
-      <li><a class="spec" href="/getting_started/12.html">IO</a></li>
-      <li><a class="spec" href="/getting_started/13.html">Enumerables</a></li>
+      <li><a class="spec" href="/getting_started/9.html">Default arguments</a></li>
+      <li><a class="spec" href="/getting_started/10.html">Recursion</a></li>
+      <li><a class="spec" href="/getting_started/11.html">alias, require and import</a></li>
+      <li><a class="spec" href="/getting_started/12.html">Module attributes</a></li>
+      <li><a class="spec" href="/getting_started/13.html">IO</a></li>
+      <li><a class="spec" href="/getting_started/14.html">Enumerables</a></li>
     </ol>
   </div>
   <div class="widget">
diff --git a/getting_started/10.markdown b/getting_started/10.markdown
index 8c83d30e4..699a45254 100644
--- a/getting_started/10.markdown
+++ b/getting_started/10.markdown
@@ -1,7 +1,60 @@
 ---
 layout: getting_started
-title: 10 alias, require and import
+title: 10 Recursion
 guide: 10
 ---
 
 # {{ page.title }}
+
+Due to immutability, loops in Elixir (and in functional programming languages) are written differently from conventional imperative languages. For example, in an imperative language, one would write:
+
+```c
+for(i = 0; i < array.length; i++) {
+  array[i] = array[i] * 2
+}
+```
+
+In the example above, we are mutating the array which is not possible in Elixir. Therefore, functional languages rely on recursion: a function is called recursively until a condition is reached. Consider the example below that manually sums all the items in the list:
+
+```elixir
+defmodule Math do
+  def sum_list([h|t], acc) do
+    sum_list(t, h + acc)
+  end
+
+  def sum_list([], acc) do
+    acc
+  end
+end
+
+Math.sum_list([1,2,3], 0) #=> 6
+```
+
+In the example above, we invoke `sum_list` giving a list `[1,2,3]` and the initial value `0` as arguments. When a function has many clauses, we will try each clause until we find one that matches according to the pattern matching rules. In this case, the list `[1,2,3]` matches against `[h|t]` which assigns `h = 1` and `t = [2,3]` while `acc` is set to 0.
+
+Then, we add the head of the list to the accumulator `h + acc` and call `sum_list` again, recursively, passing the tail of the list as argument. The tail will once again match `[h|t]` until the list is empty, as seen below:
+
+```elixir
+sum_list [1,2,3], 0
+sum_list [2,3], 1
+sum_list [3], 3
+sum_list [], 6
+```
+
+When the list is empty, it will match the final clause which returns the final result of `6`. In imperative languages, such implementation would usually fail for large lists because the stack (in which our execution path is kept) would grow until it reaches a limit. Elixir, however, does tail call optimization in which the stack does not grow when a function exits by calling another function.
+
+Recursion and tail call optimization are an important part of Elixir and are commonly used to create loops, especially in cases where processes need to wait and respond to messages. However, recursion as above is rarely used to manipulate lists, since [the `Enum` module](/docs/stable/Enum.html) already provides many conveniences for working not only with lists but different kinds of Enumerables. For instance, the example above could be simply written as:
+
+```iex
+iex> Enum.reduce([1,2,3], 0, fn(x, acc) -> x + acc end)
+6
+```
+
+Or using the capture syntax:
+
+```iex
+iex> Enum.reduce([1,2,3], 0, &+/2)
+6
+```
+
+We will learn more about Enumerables in the "Enumerables" chapter.
diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index 9209e1604..8c83d30e4 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -1,7 +1,7 @@
 ---
 layout: getting_started
-title: 11 Module attributes
-guide: 11
+title: 10 alias, require and import
+guide: 10
 ---
 
 # {{ page.title }}
diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index 51fc393c4..9209e1604 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -1,31 +1,7 @@
 ---
 layout: getting_started
-title: 12 IO
-guide: 12
+title: 11 Module attributes
+guide: 11
 ---
 
 # {{ page.title }}
-
-
-## 8.X `iodata` and `char_data`
-
-In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
-
-The functions in `IO` and `File` also allow lists to given as arguments. Not only that, they also allow a mixed list of lists, integers and binaries to be given:
-
-```iex
-iex> IO.puts 'hello world'
-hello world
-:ok
-iex> IO.puts ['hello', ?\s, "world"]
-hello world
-:ok
-```
-
-However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends when on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
-
-On the other hand, the `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
-
-This is a subtle difference but you only need to be aware of it if you intend to pass lists to those functions. Since strings are always encoded as UTF-8 in binaries and binaries contains bytes, their representation is always raw.
-
-Overall, Elixir provides `iodata_to_binary` to convert any `iodata` to binary. The functions `String.from_char_data!` and `List.from_char_data!` can be used to convert char data into strings or char lists respectively.
diff --git a/getting_started/13.markdown b/getting_started/13.markdown
index ada483e01..dd90aa054 100644
--- a/getting_started/13.markdown
+++ b/getting_started/13.markdown
@@ -1,7 +1,31 @@
 ---
 layout: getting_started
-title: 13 Enumerables
-guide: 13
+title: 12 IO
+guide: 12
 ---
 
 # {{ page.title }}
+
+
+## 13.X `iodata` and `char_data`
+
+In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
+
+The functions in `IO` and `File` also allow lists to given as arguments. Not only that, they also allow a mixed list of lists, integers and binaries to be given:
+
+```iex
+iex> IO.puts 'hello world'
+hello world
+:ok
+iex> IO.puts ['hello', ?\s, "world"]
+hello world
+:ok
+```
+
+However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends when on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
+
+On the other hand, the `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
+
+This is a subtle difference but you only need to be aware of it if you intend to pass lists to those functions. Since strings are always encoded as UTF-8 in binaries and binaries contains bytes, their representation is always raw.
+
+Overall, Elixir provides `iodata_to_binary` to convert any `iodata` to binary. The functions `String.from_char_data!` and `List.from_char_data!` can be used to convert char data into strings or char lists respectively.
diff --git a/getting_started/14.markdown b/getting_started/14.markdown
new file mode 100644
index 000000000..aff64e33e
--- /dev/null
+++ b/getting_started/14.markdown
@@ -0,0 +1,7 @@
+---
+layout: getting_started
+title: 14 Enumerables
+guide: 14
+---
+
+# {{ page.title }}
diff --git a/getting_started/8.markdown b/getting_started/8.markdown
index db8850f90..21879cbec 100644
--- a/getting_started/8.markdown
+++ b/getting_started/8.markdown
@@ -157,93 +157,4 @@ iex> fun.(1)
 
 The `&1` represents the first argument passed into the function. The syntax above is useful for short function definitions. You can read more about the capture operator `&` in [the `Kernel.SpecialForms` documentation](/docs/stable/Kernel.SpecialForms.html).
 
-## 8.5 Default arguments
-
-Finally, named functions also support default arguments:
-
-```elixir
-defmodule Concat do
-  def join(a, b, sep \\ " ") do
-    a <> sep <> b
-  end
-end
-
-IO.puts Concat.join("Hello", "world")      #=> Hello world
-IO.puts Concat.join("Hello", "world", "_") #=> Hello_world
-```
-
-Any expression is allowed to serve as a default value but it won't be evaluated during the function definition; it will simply be stored for later use. Every time the function is invoked and any of its default values have to be used, the expression for that default value will be evaluated:
-
-```elixir
-defmodule DefaultTest do
-  def dowork(x \\ IO.puts "hello") do
-    x
-  end
-end
-```
-
-```iex
-iex> DefaultTest.dowork 123
-123
-iex> DefaultTest.dowork
-hello
-:ok
-```
-
-If a function with default values has multiple clauses, it is recommended to create a separate clause without an actual body, just for declaring defaults:
-
-```elixir
-defmodule Concat do
-  def join(a, b \\ nil, sep \\ " ")
-
-  def join(a, b, _sep) when nil?(b) do
-    a
-  end
-
-  def join(a, b, sep) do
-    a <> sep <> b
-  end
-end
-
-IO.puts Concat.join("Hello", "world")      #=> Hello world
-IO.puts Concat.join("Hello", "world", "_") #=> Hello_world
-IO.puts Concat.join("Hello")               #=> Hello
-```
-
-When using default values, one must be careful to avoid overlapping function definitions. Consider the following example:
-
-```elixir
-defmodule Concat do
-  def join(a, b) do
-    IO.puts "***First join"
-    a <> b
-  end
-
-  def join(a, b, sep \\ " ") do
-    IO.puts "***Second join"
-    a <> sep <> b
-  end
-end
-```
-
-If we save the code above in a file named "concat.ex" and compile it, Elixir will emit the following warning:
-
-    concat.exs:7: this clause cannot match because a previous clause at line 2 always matches
-
-The compiler is telling us that invoking the `join` function with two arguments will always choose the first definition of `join` whereas the second one will only be invoked when three arguments are passed:
-
-    $ iex concat.exs
-
-```iex
-iex> Concat.join "Hello", "world"
-***First join
-"Helloworld"
-```
-
-```iex
-iex> Concat.join "Hello", "world", "_"
-***Second join
-"Hello_world"
-```
-
-This finishes our short introduction to modules. In the next chapters, we will learn how to use functions for recursion, explore Elixir lexical directives that can be used for importing functions from other modules, as well as module attributes.
+This finishes our short introduction to modules. In the next chapters, we will learn how to define default arguments, how to use functions for recursion, explore Elixir lexical directives that can be used for importing functions from other modules, as well as module attributes.
diff --git a/getting_started/9.markdown b/getting_started/9.markdown
index d3ce34c9b..36ae767b0 100644
--- a/getting_started/9.markdown
+++ b/getting_started/9.markdown
@@ -1,7 +1,94 @@
 ---
 layout: getting_started
-title: 9 Recursion
+title: 9 Default arguments
 guide: 9
 ---
 
 # {{ page.title }}
+
+Named functions in Elixir also support default arguments:
+
+```elixir
+defmodule Concat do
+  def join(a, b, sep \\ " ") do
+    a <> sep <> b
+  end
+end
+
+IO.puts Concat.join("Hello", "world")      #=> Hello world
+IO.puts Concat.join("Hello", "world", "_") #=> Hello_world
+```
+
+Any expression is allowed to serve as a default value but it won't be evaluated during the function definition; it will simply be stored for later use. Every time the function is invoked and any of its default values have to be used, the expression for that default value will be evaluated:
+
+```elixir
+defmodule DefaultTest do
+  def dowork(x \\ IO.puts "hello") do
+    x
+  end
+end
+```
+
+```iex
+iex> DefaultTest.dowork 123
+123
+iex> DefaultTest.dowork
+hello
+:ok
+```
+
+If a function with default values has multiple clauses, it is recommended to create a separate clause without an actual body, just for declaring defaults:
+
+```elixir
+defmodule Concat do
+  def join(a, b \\ nil, sep \\ " ")
+
+  def join(a, b, _sep) when nil?(b) do
+    a
+  end
+
+  def join(a, b, sep) do
+    a <> sep <> b
+  end
+end
+
+IO.puts Concat.join("Hello", "world")      #=> Hello world
+IO.puts Concat.join("Hello", "world", "_") #=> Hello_world
+IO.puts Concat.join("Hello")               #=> Hello
+```
+
+When using default values, one must be careful to avoid overlapping function definitions. Consider the following example:
+
+```elixir
+defmodule Concat do
+  def join(a, b) do
+    IO.puts "***First join"
+    a <> b
+  end
+
+  def join(a, b, sep \\ " ") do
+    IO.puts "***Second join"
+    a <> sep <> b
+  end
+end
+```
+
+If we save the code above in a file named "concat.ex" and compile it, Elixir will emit the following warning:
+
+    concat.exs:7: this clause cannot match because a previous clause at line 2 always matches
+
+The compiler is telling us that invoking the `join` function with two arguments will always choose the first definition of `join` whereas the second one will only be invoked when three arguments are passed:
+
+    $ iex concat.exs
+
+```iex
+iex> Concat.join "Hello", "world"
+***First join
+"Helloworld"
+```
+
+```iex
+iex> Concat.join "Hello", "world", "_"
+***Second join
+"Hello_world"
+```

From 5ef41527b7df857c986c496671b854adf61bd93a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Mon, 24 Feb 2014 12:04:35 +0100
Subject: [PATCH 054/160] Module attributes

---
 getting_started/11.markdown | 183 +++++++++++++++++++++++++++++++++++-
 getting_started/12.markdown | 169 ++++++++++++++++++++++++++++++++-
 2 files changed, 348 insertions(+), 4 deletions(-)

diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index 8c83d30e4..449b78880 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -1,7 +1,186 @@
 ---
 layout: getting_started
-title: 10 alias, require and import
-guide: 10
+title: 11 alias, require and import
+guide: 11
 ---
 
 # {{ page.title }}
+
+In order to facilitate software reuse, Elixir provides three directives. As we are going to see below, they are called directives because they have **lexical scope**.
+
+### 11.1 alias
+
+`alias` allows you to setup aliases for any given module name. Imagine our `Math` module uses a special list implementation for doing math specific operations:
+
+```elixir
+defmodule Math do
+  alias Math.List, as: List
+end
+```
+
+From now on, any reference to `List` will automatically expand to `Math.List`. In case one wants to access the original `List`, it can be done by accessing the module via `Elixir`:
+
+```elixir
+List.values             #=> uses Math.List.values
+Elixir.List.values      #=> uses List.values
+Elixir.Math.List.values #=> uses Math.List.values
+```
+
+> Note: All modules defined in Elixir are defined inside a main Elixir namespace. However, for convenience, you can omit the Elixir main namespace.
+
+Aliases are frequently used to define shortcuts:
+
+```iex
+iex> alias String, as: S
+nil
+iex> S.length "hello"
+5
+```
+
+Calling `alias` without an `as` option sets the alias automatically to the last part of the module name, for example:
+
+```elixir
+alias Math.List
+```
+
+Is the same as:
+
+```elixir
+alias Math.List, as: List
+```
+
+Note that `alias` is **lexically scoped**, which allows you to set aliases inside specific functions:
+
+```elixir
+defmodule Math do
+  def plus(a, b) do
+    alias Math.List
+    # ...
+  end
+
+  def minus(a, b) do
+    # ...
+  end
+end
+```
+
+In the example above, since we are invoking `alias` inside the function `plus/2`, the alias will just be valid inside the function `plus/2`. `minus/2` won't be affected at all.
+
+### 11.2 require
+
+Elixir provides macros.
+
+Macros are chunks of code that are executed and expanded at compilation time. This means, in order to use a macro, we need to guarantee its module and implementation are available during compilation. This is done with the `require` directive:
+
+```iex
+iex> Integer.odd?(3)
+** (CompileError) iex:1: you must require Integer before invoking the macro Integer.odd?/1
+iex> require Integer
+nil
+iex> Integer.odd?(3)
+true
+```
+
+In Elixir, `Integer.odd?/1` is defined as a macro so it can be used as guards. This means that, in order to invoke `Integer.odd?/1`, we need to first require the `Integer` module.
+
+In general, a module does not need to be required before usage, except if we want to use the macros available in that module. An attempt to call a macro that was not loaded will raise an error. Note that like the `alias` directive, `require` is also lexically scoped. We will talk more about macros in a later chapter.
+
+### 11.3 import
+
+We use `import` whenever we want to easily access functions or macros from other modules without using the qualified name. For instance, if we want to use the `duplicate` function from `List` several times, we can simply import it:
+
+```iex
+iex> import List, only: [duplicate: 2]
+nil
+iex> duplicate :ok, 3
+[:ok, :ok, :ok]
+```
+
+In this case, we are importing only the function `duplicate` (with arity 2) from `List`. Although `only:` is optional, its usage is recommended. `except` could also be given as an option.
+
+`import` also supports `:macros` and `:functions` to be given to `:only`. For example, to import all macros, one could write:
+
+```elixir
+import Integer, only: :macros
+```
+
+Or to import all functions, you could write:
+
+```elixir
+import Integer, only: :functions
+```
+
+Note that `import` is also **lexically scoped**, this means we can import specific macros inside specific functions:
+
+```elixir
+defmodule Math do
+  def some_function do
+    import List, only: [duplicate: 2]
+    # call duplicate
+  end
+end
+```
+
+In the example above, the imported `List.duplicate/2` is only visible within that specific function. `duplicate/2` won't be available in any other function in that module (or any other module for that matter).
+
+Note that importing a module automatically requires it.
+
+## 11.4 Aliases
+
+At this point, you may be wondering, what exactly is an Elixir alias? How is it represented?
+
+An alias in Elixir is a capitalized identifier (like `String`, `Keyword`, etc) which is converted to an atom representing a module during compilation. For instance, the `String` alias translates by default to the atom `Elixir.String`:
+
+```iex
+iex> is_atom(String)
+true
+iex> to_string(String)
+"Elixir.String"
+iex> :"Elixir.String"
+String
+```
+
+By using the `alias/2` directive, we are simply changing what an alias translates to.
+
+Aliases work as described because in the Erlang VM (and consequently Elixir), modules are represented by atoms. For example, that's the mechanism we use to call Erlang modules:
+
+```iex
+iex> :lists.flatten([1,[2],3])
+[1, 2, 3]
+```
+
+This is also the mechanism that allows us to dynamically call a given function in a module:
+
+```iex
+iex> mod = :lists
+:lists
+iex> mod.flatten([1,[2],3])
+[1,2,3]
+```
+
+In other words, we are simply calling the function `flatten` on the atom `:lists`.
+
+## 11.5 Nesting
+
+Now that we have talked about aliases, we can talk about nesting and how it works in Elixir. Consider the following example:
+
+```elixir
+defmodule Foo do
+  defmodule Bar do
+  end
+end
+```
+
+The example above will define two modules `Foo` and `Foo.Bar`. The second can be accessed as `Bar` inside `Foo` as long as they are in the same lexical scope. If later the developer decides to move `Bar` to another file, it will need to be referenced by its full name (`Foo.Bar`) or an alias needs to be set using the `alias` directive discussed above.
+
+In other words, the code above is exactly the same as:
+
+```elixir
+defmodule Elixir.Foo do
+  defmodule Elixir.Foo.Bar do
+  end
+  alias Elixir.Foo.Bar, as: Bar
+end
+```
+
+As we will see in later chapters, aliases also play a crucial role in macros, to guarantee they are hygienic. With this, we are almost finishing our tour about Elixir modules, the last topic to cover is module attributes.
diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index 9209e1604..e780c6e67 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -1,7 +1,172 @@
 ---
 layout: getting_started
-title: 11 Module attributes
-guide: 11
+title: 12 Module attributes
+guide: 12
 ---
 
 # {{ page.title }}
+
+Module attributes in Elixir serves three purposes:
+
+1. They serve to annotate the module, often with information to be used by the user or the VM;
+2. They work as constants;
+3. They work as a temporary module storage to be used during compilation;
+
+Let's check each case, one by one.
+
+## 12.1 As annotations
+
+Elixir brings the concept of module attributes from Erlang. For example:
+
+```elixir
+defmodule MyServer do
+  @vsn 2
+end
+```
+
+In the example above, we are explicitly setting the version attribute for that module. `@vsn` is used by the code reloading mechanism in the Erlang VM to check if a module has been updated or not. If no version is specified, the version is set to the MD5 checksum of the module functions.
+
+Elixir has a handful of reserved attributes. Here are just a few of them, the most commonly used ones:
+
+* `@moduledoc` - provides documentation for the current module;
+* `@doc` - provides documentation for the function or macro that follows the attribute;
+* `@behaviour` - (notice the British spelling) used for specifying an OTP or user-defined behaviour;
+* `@before_compile` - provides a hook that will be invoked before the module is compiled. This makes it possible to inject functions inside the module exactly before compilation;
+
+`@moduledoc` and `@doc` are by far the most used attributes and we expect you to use them a lot. Elixir treats documentation as first-class and provide many functions to access documentation:
+
+```iex
+iex> defmodule MyModule do
+...>  @moduledoc "It does **x**"
+...>
+...>  @doc """
+...>  Returns the version
+...>  """
+...>  def version, do: 1
+...> end
+{:module, MyModule, <<70, 79, 82, ...>>, {:version, 0}}
+iex> h MyModule
+* MyModule
+
+It does **x**
+
+iex> h MyModule.version
+* def version()
+
+Returns the version
+
+```
+
+Elixir promotes the use of markdown with heredocs to write readable documentation:
+
+```elixir
+defmodule Math do
+  @moduledoc """
+  This module provides mathematical functions
+  as sin, cos and constants like pi.
+
+  ## Examples
+
+      Math.pi
+      #=> 3.1415...
+
+  """
+end
+```
+
+We also provide a tool called [ExDoc](https://github.com/elixir-lang/ex_doc) which is used to generate HTML pages with the documentation.
+
+You can take a look at the docs for [Module](/docs/stable/Module.html) for a complete list of supported attributes. Elixir also uses attributes to define [typespecs](/docs/stable/Kernel.Typespec.html), via:
+
+* `@spec` - provides a specification for a function;
+* `@callback` - provides a specification for the behavior callback;
+* `@type` - defines a type to be used in `@spec`;
+* `@typep` - defines a private type to be used in `@spec`;
+* `@opaque` - defines an opaque type to be used in `@spec`;
+
+This section covers built-in attributes. However, attributes can also be used by developers or extended by libraries to support custom behaviour.
+
+## 12.2 As constants
+
+Elixir developers will often use module attributes to be used as constants:
+
+```elixir
+defmodule MyServer do
+  @initial_state %{host: "127.0.0.1", port: 3456}
+  IO.inspect @initial_state
+end
+```
+
+> Note: Unlike Erlang, user defined attributes are not stored in the module by default. The value exists only during compilation time. A developer can configure an attribute to behave closer to Erlang by calling [`Module.register_attribute/3`](/docs/stable/Module.html#register_attribute/3).
+
+Trying to access an attribute that was not previously defined will raise a warning:
+
+```elixir
+defmodule MyServer do
+  @unknown
+end
+warning: undefined module attribute @unknown, please remove access to @unknown or explicitly set it to nil before access
+```
+
+Finally, attributes can also be read inside functions:
+
+```elixir
+defmodule MyServer do
+  @my_data 11
+  def first_data, do: @my_data
+  @my_data 13
+  def second_data, do: @my_data
+end
+
+MyServer.first_data #=> 11
+MyServer.second_data #=> 13
+```
+
+Notice that reading an attribute inside a function takes a snapshot of its current value. In other words, the value is read at compilation time and not at runtime. As we are going to see, this makes attributes useful to be used as storage during the module compilation.
+
+## 12.3 As temporary storage
+
+One of the projects in the Elixir organization is [the `Plug` project](https://github.com/elixir-lang/plug), which is meant to be a common foundation for building web libraries and frameworks in Elixir.
+
+The Plug library also allows developers to define their own plugs which can be run in a web server:
+
+```elixir
+defmodule MyPlug do
+  use Plug.Builder
+
+  plug :set_header
+  plug :send_ok
+
+  def set_header(conn, _opts) do
+    put_resp_header(conn, "x-header", "set")
+  end
+
+  def send_ok(conn, _opts) do
+    send(conn, 200, "ok")
+  end
+end
+
+IO.puts "Running MyPlug with Cowboy on http://localhost:4000"
+Plug.Adapters.Cowboy.http MyPlug, []
+```
+
+In the example above, we have used the `plug/1` macro to connect functions that will be invoked when there is a web request. Internally, every time you call `plug/1`, the Plug library stores the given arguments as a list in a `@plugs` attribute. At the end, before the module is compiled, Plug runs a callback (registered via the `@before_compile` module attribute) that will then compile all `@plugs` into actual code.
+
+In order to understand the underlying code, we'd need macros, so we will revisit this pattern later on. However, the focus here is exactly on how using module attributes as storage allow developers to create DSLs. Note only they are elegant DSLs but using them with a combination of `@before_compile` callback allows developers to generate code that performs extremely well.
+
+Another example comes from the ExUnit framework, that uses module attributes as annotation and storage:
+
+```elixir
+defmodule MyTest do
+  use ExUnit.Case
+
+  @tag :external
+  test "contacts external service" do
+    # ...
+  end
+end
+```
+
+Tags in ExUnit are used to annotate tests. Tags can be later used to filter tests, so you don't run external tests by default in locally, since they can be slow, while you can leave them enabled in your builds. Internally, those tags are stored in temporary module attributes, associating each test to their tags, so it can be later fetched by the test framework.
+
+We hope this section shows some light on how Elixir supports meta-programming and how module attributes play an important role when building DSLs. In the next chapters, we will talk about some common modules in Elixir, like `IO` and `Enum`, before finally going into more advanced topics, like macros.

From ebf91ca0cdfea3bc45e028fd6abf44cf1c295409 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Tue, 25 Feb 2014 16:45:43 +0100
Subject: [PATCH 055/160] Add enumerables and streams, more progress on IO

---
 _layouts/getting_started.html |   5 +-
 getting_started/10.markdown   |   2 +-
 getting_started/12.markdown   |   8 +--
 getting_started/13.markdown   | 109 +++++++++++++++++++++++++++++-----
 getting_started/14.markdown   |   2 +-
 getting_started/2.markdown    |   2 +-
 index.html                    |   2 +-
 7 files changed, 105 insertions(+), 25 deletions(-)

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index 5f804abec..cc524d876 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -23,8 +23,9 @@ <h3 class="widget-title">Index</h3>
       <li><a class="spec" href="/getting_started/10.html">Recursion</a></li>
       <li><a class="spec" href="/getting_started/11.html">alias, require and import</a></li>
       <li><a class="spec" href="/getting_started/12.html">Module attributes</a></li>
-      <li><a class="spec" href="/getting_started/13.html">IO</a></li>
-      <li><a class="spec" href="/getting_started/14.html">Enumerables</a></li>
+      <li><a class="spec" href="/getting_started/13.html">Enumerables and streams</a></li>
+      <li><a class="spec" href="/getting_started/14.html">Processes</a></li>
+      <li><a class="spec" href="/getting_started/15.html">IO</a></li>
     </ol>
   </div>
   <div class="widget">
diff --git a/getting_started/10.markdown b/getting_started/10.markdown
index 699a45254..8b13fbb8c 100644
--- a/getting_started/10.markdown
+++ b/getting_started/10.markdown
@@ -57,4 +57,4 @@ iex> Enum.reduce([1,2,3], 0, &+/2)
 6
 ```
 
-We will learn more about Enumerables in the "Enumerables" chapter.
+We will learn more about Enumerables in the "Enumerables and streams" chapter.
diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index e780c6e67..c15557148 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -150,9 +150,9 @@ IO.puts "Running MyPlug with Cowboy on http://localhost:4000"
 Plug.Adapters.Cowboy.http MyPlug, []
 ```
 
-In the example above, we have used the `plug/1` macro to connect functions that will be invoked when there is a web request. Internally, every time you call `plug/1`, the Plug library stores the given arguments as a list in a `@plugs` attribute. At the end, before the module is compiled, Plug runs a callback (registered via the `@before_compile` module attribute) that will then compile all `@plugs` into actual code.
+In the example above, we have used the `plug/1` macro to connect functions that will be invoked when there is a web request. Internally, every time you call `plug/1`, the Plug library stores the given arguments as a list in a `@plugs` attribute. At the end, before the module is compiled, Plug runs a callback (registered via the `@before_compile` module attribute) that will then compile all `@plugs` into actual function calls.
 
-In order to understand the underlying code, we'd need macros, so we will revisit this pattern later on. However, the focus here is exactly on how using module attributes as storage allow developers to create DSLs. Note only they are elegant DSLs but using them with a combination of `@before_compile` callback allows developers to generate code that performs extremely well.
+In order to understand the underlying code, we'd need macros, so we will revisit this pattern later on. However, the focus here is exactly on how using module attributes as storage allow developers to create DSLs. Note only they are elegant DSLs but using them with a combination of `@before_compile` callbacks allows developers to generate code that performs well.
 
 Another example comes from the ExUnit framework, that uses module attributes as annotation and storage:
 
@@ -167,6 +167,6 @@ defmodule MyTest do
 end
 ```
 
-Tags in ExUnit are used to annotate tests. Tags can be later used to filter tests, so you don't run external tests by default in locally, since they can be slow, while you can leave them enabled in your builds. Internally, those tags are stored in temporary module attributes, associating each test to their tags, so it can be later fetched by the test framework.
+Tags in ExUnit are used to annotate tests. Tags can be later used to filter tests, so you don't run external tests by default locally, since they can be slow, while you can leave them enabled in your builds. Internally, those tags are stored in temporary module attributes, associating each test to their respective tags, so it can be later fetched and filtered by the test framework.
 
-We hope this section shows some light on how Elixir supports meta-programming and how module attributes play an important role when building DSLs. In the next chapters, we will talk about some common modules in Elixir, like `IO` and `Enum`, before finally going into more advanced topics, like macros.
+We hope this section shows some light on how Elixir supports meta-programming and how module attributes play an important role when doing so. In the next chapters, we will talk about some common modules in Elixir, like `IO` and `Enum`, before finally going into more advanced topics, like macros.
diff --git a/getting_started/13.markdown b/getting_started/13.markdown
index dd90aa054..95d9e1124 100644
--- a/getting_started/13.markdown
+++ b/getting_started/13.markdown
@@ -1,31 +1,110 @@
 ---
 layout: getting_started
-title: 12 IO
-guide: 12
+title: 13 Enumerables and Streams
+guide: 13
 ---
 
 # {{ page.title }}
 
+## 13.1 Enumerables
 
-## 13.X `iodata` and `char_data`
+Elixir provides the concept of enumerables and [the `Enum` module](/docs/stable/Enum.html) to work with them. We have already learned two enumerables: lists and maps.
 
-In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
+```iex
+iex> Enum.map([1, 2, 3], fn x -> x * 2 end)
+[2, 4, 6]
+iex> Enum.map(%{1 => 2, 3 => 4}, fn {k, v} -> k * v end)
+[2, 12]
+```
+
+The Enum module provides a huge range of functions to transform, sort, group, filter and retrieve items from enumerables. It is one of the modules developers use frequently in their Elixir code.
+
+Elixir also provides ranges:
+
+```iex
+iex> Enum.map(1..3, fn x -> x * 2 end)
+[2, 4, 6]
+iex> Enum.reduce(1..3, 0, &+/2)
+6
+```
+
+Since the Enum module was designed to work accross different data types, its API is limitted to functions that are useful accross many data types. For specific operations, you may need to reach to modules specific to the data types. For example, if you want to insert an element at a given position in a list, you should use the `List.insert_at/3` function from [the `List` module](/docs/stable/List.html), as it would make little sense to insert a value into a range.
+
+We say the functions in the `Enum` module are polymorphic because they can work with diverse data types. In particular, the functions in the `Enum` module can work with any data type that implements [the `Enumerable` protocol](/docs/stable/Enumerable.html). We are going to discuss Protocols in a later chapter, now we are going to move on to a specific kind of enumerable called streams.
+
+## 13.2 Eager vs Lazy
+
+All the functions in the `Enum` module are eager. Many functions expect an enumerable and return a list back:
+
+```iex
+iex> require Integer
+nil
+iex> Enum.filter(1..3, &Integer.odd?/1)
+[1, 3]
+```
+
+This means that when performing multiple operations with `Enum`, each operation is going to generate an intermediate list until we reach the result:
+
+```iex
+iex> 1..100_000 |> Enum.map(&(&1 * 3)) |> Enum.filter(&Integer.odd?/1) |> Enum.reduce(&+/2)
+7500000000
+```
 
-The functions in `IO` and `File` also allow lists to given as arguments. Not only that, they also allow a mixed list of lists, integers and binaries to be given:
+The example above has a pipeline of operations. We start with a range and then multiply each element in the range by 3. This first operation will now create and return a list with `100_000` items. Then we retrieve keep all odd elements from the list, generating a new list, now with `50_000` items, and then we sum all entries.
+
+As an alternative, Elixir provides [the `Stream` module](/docs/stable/Stream.html) which supports lazy operations:
+
+```iex
+iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(&Integer.odd?/1) |> Enum.reduce(&+/2)
+7500000000
+```
+
+Instead of generating intermediate lists, streams create a series of computations that are invoked only when we pass it to the `Enum` module. Streams are useful when working with large, *possibly infite*, collections.
+
+## 13.3 Streams
+
+Streams are lazy, composable enumerables.
+
+They are lazy because, as shown in the example above, `1..100_000 |> Stream.map(&(&1 * 3))` returns a data type, an actual stream, that represents the `map` computation:
+
+```iex
+iex> 1..100_000 |> Stream.map(&(&1 * 3))
+#Stream<1..100_000, chain: [#Function<34.16982430/1 in Stream.map/2>]>
+```
+
+Furthermore, they are composable because we can pipe many stream operations:
 
 ```iex
-iex> IO.puts 'hello world'
-hello world
-:ok
-iex> IO.puts ['hello', ?\s, "world"]
-hello world
-:ok
+iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(&Integer.odd?/1)
+#Stream<1..100_000, chain: [...]>
 ```
 
-However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends when on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
+Many functions in the Stream module accept any enumerable as argument and return a stream as result. It also provides functions for creating streams, possibly infite. For example, `Stream.cycle/1` can be used to create a stream that cycles around a given enumerable. Be careful to not call a function like `Enum.map/2` on such streams, as they would cycle forever:
+
+    ```iex
+    iex> stream = Stream.cycle([1, 2, 3])
+    #Function<15.16982430/2 in Stream.cycle/1>
+    iex> Enum.take(stream, 10)
+    [1, 2, 3, 1, 2, 3, 1, 2, 3, 1]
+    ```
+
+On the other hand, `Stream.unfold/2` can be used to generate values from a given initial value:
 
-On the other hand, the `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
+    ```iex
+    iex> stream = Stream.unfold("hełło", &String.next_codepoint/1)
+    #Function<15.16982430/2 in Stream.cycle/1>
+    iex> Enum.take(stream, 3)
+    ["h", "e", "ł"]
+    ```
+
+Another interesting function is `Stream.resource/3`, which can be used to wrap around resources, guaranteeing they are opened right before enumeration and closed afterwards, even in case of failures. For example, we can use it to stream a file:
+
+```iex
+iex> stream = File.stream!("path/to/file")
+#Function<18.16982430/2 in Stream.resource/3>
+iex> Enum.take(stream, 10)
+```
 
-This is a subtle difference but you only need to be aware of it if you intend to pass lists to those functions. Since strings are always encoded as UTF-8 in binaries and binaries contains bytes, their representation is always raw.
+The example above will fetch the first 10 lines of the file you have selected. This means streams can be very useful for handling large files or even slow resources like network resources.
 
-Overall, Elixir provides `iodata_to_binary` to convert any `iodata` to binary. The functions `String.from_char_data!` and `List.from_char_data!` can be used to convert char data into strings or char lists respectively.
+The amount of functions and functionality in [`Enum`](/docs/stable/Enum.html) and [`Stream`](/docs/stable/Stream.html) modules can be daunting at first, but you will get familiar with them case by case when needed. In particular, focus on the Enum module first and only move to Streams for the particular scenarios where laziness is required to either deal with slow resources or infinite collections.
diff --git a/getting_started/14.markdown b/getting_started/14.markdown
index aff64e33e..6dec0f4a4 100644
--- a/getting_started/14.markdown
+++ b/getting_started/14.markdown
@@ -1,6 +1,6 @@
 ---
 layout: getting_started
-title: 14 Enumerables
+title: 14 Processes
 guide: 14
 ---
 
diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 83193d6f4..244309d30 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -262,7 +262,7 @@ iex> hd []
 
 Oops!
 
-We will revisit lists a couple times in the following chapters. If you want to look ahead, the "Pattern matching", "Binaries, strings and char lists" and "Enumerables" chapters are particularly interesting.
+We will revisit lists a couple times in the following chapters. If you want to look ahead, the "Pattern matching", "Binaries, strings and char lists" and "Enumerables and streams" chapters are particularly interesting.
 
 ## 2.7 Tuples
 
diff --git a/index.html b/index.html
index 439cbb969..fa4438ae0 100644
--- a/index.html
+++ b/index.html
@@ -54,7 +54,7 @@ <h4>Meta-programming and DSLs</h4>
 
 {% highlight elixir %}
 defmodule MathTest do
-  use ExUnit.Case
+  use ExUnit.Case, async: true
 
   test "can add two numbers" do
     assert 1 + 1 == 2

From 377127273db673f2dee07d74f2dd6615722f9f80 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Tue, 25 Feb 2014 16:46:07 +0100
Subject: [PATCH 056/160] Missing IO chapter

---
 _layouts/getting_started.html |  2 +-
 getting_started/15.markdown   | 57 +++++++++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+), 1 deletion(-)
 create mode 100644 getting_started/15.markdown

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index cc524d876..21ba6b57b 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -1,6 +1,6 @@
 ---
 section: getting_started
-total_guides: 14
+total_guides: 15
 ---
 
 {% include top.html %}
diff --git a/getting_started/15.markdown b/getting_started/15.markdown
new file mode 100644
index 000000000..04b455231
--- /dev/null
+++ b/getting_started/15.markdown
@@ -0,0 +1,57 @@
+---
+layout: getting_started
+title: 15 IO
+guide: 15
+---
+
+# {{ page.title }}
+
+This chapter is a quick introduction to input/output mechanisms in Elixir and related modules, like [IO](/docs/stable/IO.html), [Path](/docs/stable/Path.html), [File](/docs/stable/File.html) and [StringIO](/docs/stabke/StringIO.html).
+
+## 13.1 The IO module
+
+The IO module in Elixir is the main mechanism for reading and writing to the standard io (`:stdio`), standard error (`:stderr`), files and other IO devices. Usage of the module is pretty straight-forward:
+
+```iex
+iex> IO.puts "hello world"
+"hello world"
+:ok
+iex> IO.gets "yes or no? "
+yes or no? yes
+"yes\n"
+```
+
+By default, the functions in the IO module use the standard input and output. We can pass the `:stderr` as argument to write to the standard error device:
+
+```iex
+iex> IO.puts :stderr, "hello world"
+"hello world"
+:ok
+```
+
+## 13.2 The Path and File modules
+
+The File module contains functions that allows us to open files as IO devices. By default, files are opened in binary mode, which requires developers to use the specific `IO.binread/2` and `IO.binwrite/2` functions from the IO module. Opening a file
+
+## 13.X `iodata` and `char_data`
+
+In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
+
+The functions in `IO` and `File` also allow lists to given as arguments. Not only that, they also allow a mixed list of lists, integers and binaries to be given:
+
+```iex
+iex> IO.puts 'hello world'
+hello world
+:ok
+iex> IO.puts ['hello', ?\s, "world"]
+hello world
+:ok
+```
+
+However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends when on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
+
+On the other hand, the `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
+
+This is a subtle difference but you only need to be aware of it if you intend to pass lists to those functions. Since strings are always encoded as UTF-8 in binaries and binaries contains bytes, their representation is always raw.
+
+Overall, Elixir provides `iodata_to_binary` to convert any `iodata` to binary. The functions `String.from_char_data!` and `List.from_char_data!` can be used to convert char data into strings or char lists respectively.

From 4b35a35449400e537525e8ccf6c71b3c45746da2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Tue, 25 Feb 2014 21:11:40 +0100
Subject: [PATCH 057/160] Talk about processes

---
 getting_started/1.markdown  |   2 +-
 getting_started/14.markdown | 114 ++++++++++++++++++++++++++++++++++++
 2 files changed, 115 insertions(+), 1 deletion(-)

diff --git a/getting_started/1.markdown b/getting_started/1.markdown
index 3040b6b6c..4e317f61d 100644
--- a/getting_started/1.markdown
+++ b/getting_started/1.markdown
@@ -80,4 +80,4 @@ iex> "hello" <> " world"
 "hello world"
 ```
 
-It seems we are ready to go! We will use the interactive shell quite a lot in the next chapters to get a bit more familiar with the language constructs and basic types, starting in the next chapter.
+It seems we are ready to go!  We will use the interactive shell quite a lot in the next chapters to get a bit more familiar with the language constructs and basic types, starting in the next chapter.
diff --git a/getting_started/14.markdown b/getting_started/14.markdown
index 6dec0f4a4..6df2166d0 100644
--- a/getting_started/14.markdown
+++ b/getting_started/14.markdown
@@ -5,3 +5,117 @@ guide: 14
 ---
 
 # {{ page.title }}
+
+In Elixir, all of your code run inside processes. Those processes are isolated from each other and they communicate with message passing. In this chapter, we will learn about the basic constructs for spawning new processes, sending and receiving messages.
+
+## 14.1 spawn
+
+The basic mechanism for spawning new processes is with the auto-imported `spawn/1` function:
+
+```iex
+iex> spawn fn -> 1 + 2 end
+#PID<0.43.0>
+```
+
+Notice `spawn/1` returns a PID (process identifier). At this point, the process you spawned is very likely dead. The spawned process will execute the given function and exit after the function is done.
+
+> Note: you will likely get different process identifiers than the ones we are getting in the tutorial.
+
+We can retrieve the PID of the current process by calling `self/0`:
+
+```iex
+iex> self()
+#PID<0.41.0>
+```
+
+Process get much more interesting when we are able to send and receive messages.
+
+## 14.2 send and receive
+
+We can send messages with `send/2` and receive them with `receive/1`:
+
+```iex
+iex> send self(), {:hello, "world"}
+{:hello, "world"}
+iex> receive do
+...>   {:hello, msg}  -> msg
+...>   {:world, msg} -> "won't match"
+...> end
+"world"
+```
+
+When a message is sent to a process, the message is stored in the process mailbox. The `receive/2` block goes through the current process mailbox searching for a message that matches any of the given patterns. `receive/1` supports many clauses, like `case/2`, as well as guards in the clauses.
+
+If there is no message in the mailbox matching any of the patterns, the current process will wait until a matching message arrives. A timeout can also be specified:
+
+```iex
+iex> receive do
+...>   {:hello, msg}  -> msg
+...> after
+...>   1_000 -> "nothing after 1s"
+...> end
+"nothing after 1s"
+```
+
+A timeout of 0 can be given when you already expect the message to be in the mailbox.
+
+Let's put all together and send messages in between processes:
+
+```iex
+iex> parent = self()
+#PID<0.41.0>
+iex> spawn fn -> send(parent, {:hello, self()}) end
+#PID<0.48.0>
+iex> receive do
+...>   {:hello, pid} -> "Got hello from #{inspect pid}"
+...> end
+"Got hello from #PID<0.48.0>"
+```
+
+While in the shell, you may find the helper `flush/0` quite useful. It flushes and prints all the messages in the mailbox.
+
+```iex
+iex> send self(), :hello
+:hello
+iex> flush()
+:hello
+:ok
+```
+
+Before we finish this chapter, let's talk about process links.
+
+## 14.3 Links
+
+The most common form of spawning in Elixir is actually via `spawn_link/1`. Before we show an example with `spawn_link/1`, let's try to see what happens when a process fail:
+
+```iex
+iex> spawn fn -> raise "oops" end
+#PID<0.58.0>
+```
+
+Well... nothing happened. That's because processes are isolated. If we want the failure in one process to propagate to another one, we should link them. This can be done with `spawn_link/1`:
+
+```iex
+iex> spawn_link fn -> raise "oops" end
+#PID<0.60.0>
+** (EXIT from #PID<0.60.0>) {RuntimeError[message: "oops"], [{:erlang, :apply, 2, []}]}
+```
+
+When a failure happens in the shell, the shell automatically traps the failure and shows it nicely formatted. In order to understand what would really happen in our code, let's use `spawn_link/1` inside a file and run it:
+
+```iex
+# spawn.exs
+spawn_link fn -> raise "oops" end
+
+receive do
+  :hello -> "let's wait until the process fails"
+end
+```
+
+This time the process failed and brought the parent process down as they are linked.
+
+Process and links play an important role when building fault-tolerant systems. In Elixir applications, we often link our processes to supervisors which will detect when a process die and start a new process in its place.
+
+While other languages would require us to catch/handle exceptions, in Elixir we are actually fine with letting process fail because we expect supervisors to properly restart our systems. Our philosophy is "let it crash".
+
+So let it crash.

From bd31b40ae35181abf618c5577346b1a2ac0c2d3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Tue, 25 Feb 2014 22:31:00 +0100
Subject: [PATCH 058/160] Time to talk about IO

---
 getting_started/14.markdown |  13 +++-
 getting_started/15.markdown | 136 +++++++++++++++++++++++++++++++++---
 2 files changed, 139 insertions(+), 10 deletions(-)

diff --git a/getting_started/14.markdown b/getting_started/14.markdown
index 6df2166d0..d29155faf 100644
--- a/getting_started/14.markdown
+++ b/getting_started/14.markdown
@@ -17,7 +17,14 @@ iex> spawn fn -> 1 + 2 end
 #PID<0.43.0>
 ```
 
-Notice `spawn/1` returns a PID (process identifier). At this point, the process you spawned is very likely dead. The spawned process will execute the given function and exit after the function is done.
+Notice `spawn/1` returns a PID (process identifier). At this point, the process you spawned is very likely dead. The spawned process will execute the given function and exit after the function is done:
+
+```iex
+iex> pid = spawn fn -> 1 + 2 end
+#PID<0.44.0>
+iex> Process.alive?(pid)
+false
+```
 
 > Note: you will likely get different process identifiers than the ones we are getting in the tutorial.
 
@@ -26,6 +33,8 @@ We can retrieve the PID of the current process by calling `self/0`:
 ```iex
 iex> self()
 #PID<0.41.0>
+iex> Process.alive?(self())
+true
 ```
 
 Process get much more interesting when we are able to send and receive messages.
@@ -112,7 +121,7 @@ receive do
 end
 ```
 
-This time the process failed and brought the parent process down as they are linked.
+This time the process failed and brought the parent process down as they are linked. Linking can also be done manually by calling `Process.link/2`. We recommend you to take a look at [the `Process` module](/docs/stable/Process.html) for other functionality provided by processes.
 
 Process and links play an important role when building fault-tolerant systems. In Elixir applications, we often link our processes to supervisors which will detect when a process die and start a new process in its place.
 
diff --git a/getting_started/15.markdown b/getting_started/15.markdown
index 04b455231..bbbe3a698 100644
--- a/getting_started/15.markdown
+++ b/getting_started/15.markdown
@@ -6,9 +6,11 @@ guide: 15
 
 # {{ page.title }}
 
-This chapter is a quick introduction to input/output mechanisms in Elixir and related modules, like [IO](/docs/stable/IO.html), [Path](/docs/stable/Path.html), [File](/docs/stable/File.html) and [StringIO](/docs/stabke/StringIO.html).
+This chapter is a quick introduction to input/output mechanisms in Elixir and related modules, like [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html) and [`Path`](/docs/stable/Path.html).
 
-## 13.1 The IO module
+We have originally sketched this chapter to come much earlier in the getting started guide. However, we noticed the IO system provides a great opportunity to bring some philosophies and curiosities about Elixir and the VM.
+
+## 15.1 The IO module
 
 The IO module in Elixir is the main mechanism for reading and writing to the standard io (`:stdio`), standard error (`:stderr`), files and other IO devices. Usage of the module is pretty straight-forward:
 
@@ -29,11 +31,125 @@ iex> IO.puts :stderr, "hello world"
 :ok
 ```
 
-## 13.2 The Path and File modules
+## 15.2 The File module
+
+The [`File`](/docs/stable/File.html) module contains functions that allows us to open files as IO devices. By default, files are opened in binary mode, which requires developers to use the specific `IO.binread/2` and `IO.binwrite/2` functions from the `IO` module:
+
+```iex
+iex> {:ok, file} = File.open "hello", [:write]
+{:ok, #PID<0.47.0>}
+iex> IO.binwrite file, "world"
+:ok
+iex> File.close file
+:ok
+iex> File.read "hello"
+{:ok, "world"}
+```
+
+A file can also be opened with `:utf8` encoding which allows the remaining function in the `IO` module to be used:
+
+```iex
+iex> {:ok, file} = File.open "another", [:write, :utf8]
+{:ok, #PID<0.48.0>}
+```
+
+Besides functions for opening, reading and writing files, the `File` module has many functions that work on the filesystem. Those functions are named after their UNIX equivalents. For exmaple, `File.rm/1` can be used to remove files, `File.mkdir/1` to create directories, `File.mkdir_p/1` creates directories guaranteeing their parents exists and there is even `File.cp_r/2` and `File.rm_rf/2` which copy and remove files and directories recursively.
+
+You will also notice that functions in the File module have two variants, one with `!` (bang) in its name and others without. For example, when we read the "hello" file above, we have used the one without `!`. Let's try some new examples:
+
+```iex
+iex> File.read "hello"
+{:ok, "world"}
+iex> File.read! "hello"
+"world"
+iex> File.read "unknwon"
+{:error, :enoent}
+iex> File.read! "unknown"
+** (File.Error) could not read file unknown: no such file or directory
+```
+
+Notice that when the file does not exist, the version with `!` raises an error. That said, the version without `!` is preferred when you want to handle different outcomes with pattern matching. However, if you expect the file to be there, the bang variation is more useful as it raises a meaningful error message. That said, never write:
+
+```elixir
+{:ok, body} = File.read(file)
+```
+
+Instead write:
+
+```elixir
+case File.read(file) do
+  {:ok, body} -> # handle ok
+  {:error, r} -> # handle error
+end
+```
+
+or
+
+```elixir
+File.read!(file)
+```
+
+## 15.3 The Path module
+
+The majority of the functions in the File module expects paths as arguments. Most commonly, those paths will be binaries and they can be manipulated with the [`Path`](/docs/stable/Path.html) module:
+
+```iex
+iex> Path.join("foo", "bar")
+"foo/bar"
+iex> Path.expand("~/hello")
+"/Users/jose/hello"
+```
+
+With this, we have covered the main modules for doing IO and interacting with the filesystem. However there are some advanced topics to discuss regarding IO but feel free to skip them if you are in a hurry.
+
+## 15.4 Processes and group leaders
+
+You may have noticed that `File.open/2` returned a tuple containing a PID:
+
+```iex
+iex> {:ok, file} = File.open "hello", [:write]
+{:ok, #PID<0.47.0>}
+```
+
+That's because the IO module actually works with processes. When you say `IO.write(pid, binary)`, the IO module will send a message to the process to the desired operation. Let's see what happens if we use our own process:
 
-The File module contains functions that allows us to open files as IO devices. By default, files are opened in binary mode, which requires developers to use the specific `IO.binread/2` and `IO.binwrite/2` functions from the IO module. Opening a file
+```iex
+iex> pid = spawn fn ->
+...>  receive do: (msg -> IO.inspect msg)
+...> end
+#PID<0.57.0>
+iex> IO.write(pid, "hello")
+{:io_request, #PID<0.41.0>, #PID<0.57.0>, {:put_chars, :unicode, "hello"}}
+** (ErlangError) erlang error: :terminated
+```
+
+After `IO.write/2`, we can see the request sent by the IO module, which then fails since the IO module expected some kind of result, which we did not supply.
 
-## 13.X `iodata` and `char_data`
+The [`StringIO`](/docs/stable/StringIO.html) module provides an implementation of the IO device messages on top of a string:
+
+```iex
+iex> {:ok, pid} = StringIO.start("hello")
+{:ok, #PID<0.43.0>}
+iex> IO.read(pid, 2)
+"he"
+```
+
+By modelling IO devices with processes, the Erlang VM allows different nodes in the same network to, for example, exchange file processes and read/write files in between nodes. Of all IO devices, there  is one that is special to each process, called group leader.
+
+When you write to `:stdio`, you are actually sending a message to the group leader, which writes to `:stdio`:
+
+```iex
+iex> IO.puts :stdio, "hello"
+hello
+:ok
+iex> IO.puts Process.group_leader, "hello"
+hello
+:ok
+```
+
+The group leader can be configured per process and is used in many situations, for example, to redirect input and output when connected to another node remotely.
+
+## 15.5 `iodata` and `char_data`
 
 In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
 
@@ -50,8 +166,12 @@ hello world
 
 However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends when on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
 
-On the other hand, the `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
+On the other hand, `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
+
+Although this is a subtle difference, you only need to worry about those details if you intend to pass lists to those functions. Binaries are already represented by the underlying bytes and as such their representation is always raw.
+
+When working with iodata and char data, Elixir provides `iodata_to_binary` to convert any `iodata` to binary. The functions `String.from_char_data!` and `List.from_char_data!` can be used to convert char data into strings or char lists respectively. Unless you are working closely with some devices, you will rarely need to use those functions.
 
-This is a subtle difference but you only need to be aware of it if you intend to pass lists to those functions. Since strings are always encoded as UTF-8 in binaries and binaries contains bytes, their representation is always raw.
+This finishes our tour on IO devices and IO related functionality. We have learned about four Elixir modules, [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html), [`Path`](/docs/stable/Path.html) and [`StringIO`](/docs/stable/StringIO.html), as well as how the VM uses processes for the underlying IO mechanisms and when how to use lists for IO operations.
 
-Overall, Elixir provides `iodata_to_binary` to convert any `iodata` to binary. The functions `String.from_char_data!` and `List.from_char_data!` can be used to convert char data into strings or char lists respectively.
+In the next chapters, we will explore structs and protocols, before moving to exception handling and other constructs like sigils and comprehensions.

From 55b5fb52eb35d45e185129feb4a77e5cbd81d417 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Wed, 26 Feb 2014 13:45:32 +0100
Subject: [PATCH 059/160] Add remaining chapters layout

---
 _layouts/getting_started.html | 8 +++++++-
 getting_started/15.markdown   | 2 +-
 getting_started/16.markdown   | 7 +++++++
 getting_started/17.markdown   | 7 +++++++
 getting_started/18.markdown   | 7 +++++++
 getting_started/19.markdown   | 7 +++++++
 getting_started/20.markdown   | 7 +++++++
 getting_started/21.markdown   | 7 +++++++
 8 files changed, 50 insertions(+), 2 deletions(-)
 create mode 100644 getting_started/16.markdown
 create mode 100644 getting_started/17.markdown
 create mode 100644 getting_started/18.markdown
 create mode 100644 getting_started/19.markdown
 create mode 100644 getting_started/20.markdown
 create mode 100644 getting_started/21.markdown

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index 21ba6b57b..866384b8f 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -1,6 +1,6 @@
 ---
 section: getting_started
-total_guides: 15
+total_guides: 21
 ---
 
 {% include top.html %}
@@ -26,6 +26,12 @@ <h3 class="widget-title">Index</h3>
       <li><a class="spec" href="/getting_started/13.html">Enumerables and streams</a></li>
       <li><a class="spec" href="/getting_started/14.html">Processes</a></li>
       <li><a class="spec" href="/getting_started/15.html">IO</a></li>
+      <li><a class="spec" href="/getting_started/16.html">Structs</a></li>
+      <li><a class="spec" href="/getting_started/17.html">Protocols</a></li>
+      <li><a class="spec" href="/getting_started/18.html">try, catch and rescue</a></li>
+      <li><a class="spec" href="/getting_started/19.html">Comprehensions</a></li>
+      <li><a class="spec" href="/getting_started/20.html">Sigils</a></li>
+      <li><a class="spec" href="/getting_started/21.html">Macros</a></li>
     </ol>
   </div>
   <div class="widget">
diff --git a/getting_started/15.markdown b/getting_started/15.markdown
index bbbe3a698..9cfe5392d 100644
--- a/getting_started/15.markdown
+++ b/getting_started/15.markdown
@@ -170,7 +170,7 @@ On the other hand, `:stdio` and files opened with `:utf8` encoding work with the
 
 Although this is a subtle difference, you only need to worry about those details if you intend to pass lists to those functions. Binaries are already represented by the underlying bytes and as such their representation is always raw.
 
-When working with iodata and char data, Elixir provides `iodata_to_binary` to convert any `iodata` to binary. The functions `String.from_char_data!` and `List.from_char_data!` can be used to convert char data into strings or char lists respectively. Unless you are working closely with some devices, you will rarely need to use those functions.
+When working with iodata and char data, Elixir provides `iodata_to_binary/1` to convert any `iodata` to binary. The functions `String.from_char_data!/1` and `List.from_char_data!/1` can be used to convert char data into strings or char lists respectively. Unless you are working closely with some devices, you will rarely need to use those functions.
 
 This finishes our tour on IO devices and IO related functionality. We have learned about four Elixir modules, [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html), [`Path`](/docs/stable/Path.html) and [`StringIO`](/docs/stable/StringIO.html), as well as how the VM uses processes for the underlying IO mechanisms and when how to use lists for IO operations.
 
diff --git a/getting_started/16.markdown b/getting_started/16.markdown
new file mode 100644
index 000000000..590d9ab75
--- /dev/null
+++ b/getting_started/16.markdown
@@ -0,0 +1,7 @@
+---
+layout: getting_started
+title: 16 Structs
+guide: 16
+---
+
+# {{ page.title }}
diff --git a/getting_started/17.markdown b/getting_started/17.markdown
new file mode 100644
index 000000000..b95dfd692
--- /dev/null
+++ b/getting_started/17.markdown
@@ -0,0 +1,7 @@
+---
+layout: getting_started
+title: 17 Protocols
+guide: 17
+---
+
+# {{ page.title }}
diff --git a/getting_started/18.markdown b/getting_started/18.markdown
new file mode 100644
index 000000000..45649c5ba
--- /dev/null
+++ b/getting_started/18.markdown
@@ -0,0 +1,7 @@
+---
+layout: getting_started
+title: 18 try, catch and rescue
+guide: 18
+---
+
+# {{ page.title }}
diff --git a/getting_started/19.markdown b/getting_started/19.markdown
new file mode 100644
index 000000000..db2abf221
--- /dev/null
+++ b/getting_started/19.markdown
@@ -0,0 +1,7 @@
+---
+layout: getting_started
+title: 19 Comprehensions
+guide: 19
+---
+
+# {{ page.title }}
diff --git a/getting_started/20.markdown b/getting_started/20.markdown
new file mode 100644
index 000000000..440ac3caf
--- /dev/null
+++ b/getting_started/20.markdown
@@ -0,0 +1,7 @@
+---
+layout: getting_started
+title: 20 Sigils
+guide: 20
+---
+
+# {{ page.title }}
diff --git a/getting_started/21.markdown b/getting_started/21.markdown
new file mode 100644
index 000000000..2c42b07da
--- /dev/null
+++ b/getting_started/21.markdown
@@ -0,0 +1,7 @@
+---
+layout: getting_started
+title: 21 Macros
+guide: 21
+---
+
+# {{ page.title }}

From dbd6fc9adee5d6befc29bc03d681126b47c79604 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Wed, 26 Feb 2014 14:30:08 +0100
Subject: [PATCH 060/160] Chapter about structs

---
 getting_started/16.markdown | 67 +++++++++++++++++++++++++++++++++++++
 getting_started/7.markdown  |  8 +++--
 2 files changed, 73 insertions(+), 2 deletions(-)

diff --git a/getting_started/16.markdown b/getting_started/16.markdown
index 590d9ab75..7d3e3468b 100644
--- a/getting_started/16.markdown
+++ b/getting_started/16.markdown
@@ -5,3 +5,70 @@ guide: 16
 ---
 
 # {{ page.title }}
+
+In early chapters, we have learned about maps:
+
+```iex
+iex> map = %{a: 1, b: 2}
+%{a: 1, b: 2}
+iex> map[:a]
+1
+iex> %{map | a: 3}
+%{a: 3, b: 2}
+```
+
+Structs are extensions on top of maps that bring default values, compile-time guarantees and polymorphism into Elixir.
+
+To define a struct, we just need to call `defstruct/1` inside a module:
+
+```iex
+iex> defmodule User do
+...>   defstruct name: "jose", age: 27
+...> end
+{:module, User,
+ <<70, 79, 82, ...>>, {:__struct__, 0}}
+```
+
+We can now create "instances" of this struct by using the `%User{}` syntax:
+
+```iex
+iex> %User{}
+%User{name: "jose", age: 27}
+iex> %User{name: "eric"}
+%User{name: "eric", age: 27}
+iex> is_map(%User{})
+true
+```
+
+Structs give compile-time guarantees that the provided fields exist in the struct:
+
+```iex
+iex> %User{oops: :field}
+** (CompileError) iex:3: unknown key :oops for struct User
+```
+
+When discussing maps, we demonstrated how we can access and update existing fields of a map. The same applies to structs:
+
+```iex
+iex> jose = %User{}
+%User{name: "jose", age: 27}
+iex> jose.name
+"jose"
+iex> eric = %{jose | name: "eric"}
+%User{name: "eric", age: 27}
+iex> %{user | oops: :field}
+** (ArgumentError) argument error
+```
+
+By using the update syntax, the VM is aware no new keys will be added to the map/struct, leading the different maps created a long the way to share their structure. In the example above, both `jose` and `eric` share the same structure.
+
+A struct is just a bare map with default fields. Notice we say it is a bare map because none of the protocols implemented for maps are available for structs. For example, you can't enumerate nor access a struct:
+
+```iex
+iex> user = %User{}
+%User{name: "jose", age: 27}
+iex> user[:name]
+** (Protocol.UndefinedError) protocol Access not implemented for %User{age: 27, name: "jose"}
+```
+
+We will cover how structs interacts with protocols in the next chapter.
diff --git a/getting_started/7.markdown b/getting_started/7.markdown
index f727ddb61..4c30adcb4 100644
--- a/getting_started/7.markdown
+++ b/getting_started/7.markdown
@@ -137,18 +137,22 @@ iex> %{:c => c} = %{:a => 1, 2 => :b}
 
 As shown above, a map matches as long as the given keys exist on the given map. Therefore, an empty map matches all maps.
 
-One interesting property about maps is that they provide a special syntax for update:
+One interesting property about maps is that they provide syntaxes for update and accessing atom keys:
 
 ```iex
 iex> map = %{:a => 1, 2 => :b}
 %{:a => 1, 2 => :b}
+iex> map.a
+1
 iex> %{map | :a => 2}
 %{:a => 2, 2 => :b}
 iex> %{map | :c => 3}
 ** (ArgumentError) argument error
 ```
 
-The update syntax above requires the given keys to exist. For example, the last line failed because there is no `:c` in the map. This is very useful when you are working with maps on a tight loop and you expect only certain keys to exist. In future chapters, we will also learn about structs, which provide compile-time guarantees and the foundation for polymorphism in Elixir. Structs are built on top of maps where the update guarantees above are proven to be quite useful.
+Both access and update syntaxes above require the given keys to exist. For example, the last line failed because there is no `:c` in the map. This is very useful when you are working with maps on a tight loop and you expect only certain keys to exist.
+
+In future chapters, we will also learn about structs, which provide compile-time guarantees and the foundation for polymorphism in Elixir. Structs are built on top of maps where the update guarantees above are proven to be quite useful.
 
 Manipulating maps is done via [the `Map` module](/docs/stable/Map.html) module and that it provides a very similar API to the `Keyword` module. This is because both modules implement the `Dict` behaviour.
 

From 48208fa9035862c7d8d091c2a2860f186b4b7ace Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Wed, 26 Feb 2014 14:57:23 +0100
Subject: [PATCH 061/160] New protocol chapter

---
 getting_started/16.markdown |  20 +++-
 getting_started/17.markdown | 190 ++++++++++++++++++++++++++++++++++++
 2 files changed, 209 insertions(+), 1 deletion(-)

diff --git a/getting_started/16.markdown b/getting_started/16.markdown
index 7d3e3468b..b2c84be07 100644
--- a/getting_started/16.markdown
+++ b/getting_started/16.markdown
@@ -62,7 +62,25 @@ iex> %{user | oops: :field}
 
 By using the update syntax, the VM is aware no new keys will be added to the map/struct, leading the different maps created a long the way to share their structure. In the example above, both `jose` and `eric` share the same structure.
 
-A struct is just a bare map with default fields. Notice we say it is a bare map because none of the protocols implemented for maps are available for structs. For example, you can't enumerate nor access a struct:
+Structs can also be used in pattern matching and they guarantee the structs are of the same type:
+
+```iex
+iex> %User{name: name} = jose
+%User{name: "jose", age: 27}
+iex> name
+"jose"
+iex> %User{} = %{}
+** (MatchError) no match of right hand side value: %{}
+```
+
+Matching works because structs store a field named `__struct__` inside the map:
+
+```iex
+iex> jose.__struct__
+User
+```
+
+Overall, a struct is just a bare map with default fields. Notice we say it is a bare map because none of the protocols implemented for maps are available for structs. For example, you can't enumerate nor access a struct:
 
 ```iex
 iex> user = %User{}
diff --git a/getting_started/17.markdown b/getting_started/17.markdown
index b95dfd692..ae66f7e63 100644
--- a/getting_started/17.markdown
+++ b/getting_started/17.markdown
@@ -5,3 +5,193 @@ guide: 17
 ---
 
 # {{ page.title }}
+
+Protocols are a mechanism to achieve polymorphism in Elixir. Dispatching on a protocol is available to any data type as long as it implements the protocol. Let's see an example.
+
+In Elixir, only `false` and `nil` are treated as false. Everything else evaluates to true. Depending on the application, it may be important to specify a `blank?` protocol that returns a boolean for other data types that should be considered blank. For instance, an empty list or an empty binary could be considered blanks.
+
+We could define this protocol as follows:
+
+```elixir
+defprotocol Blank do
+  @doc "Returns true if data is considered blank/empty"
+  def blank?(data)
+end
+```
+
+The protocol expects a function called `blank?` that receives one argument to be implemented. We can implement this protocol for different Elixir data types as follows:
+
+```elixir
+# Integers are never blank
+defimpl Blank, for: Integer do
+  def blank?(_), do: false
+end
+
+# Just empty list is blank
+defimpl Blank, for: List do
+  def blank?([]), do: true
+  def blank?(_),  do: false
+end
+
+# Just empty map is blank
+defimpl Blank, for: Map do
+  # Keep ind mind we could not pattern match on %{} because
+  # it matches on all maps. We can however check if the size
+  # is zero (and size is a fast operation).
+  def blank?(map), do: map_size(map) == 0
+end
+
+# Just the atoms false and nil are blank
+defimpl Blank, for: Atom do
+  def blank?(false), do: true
+  def blank?(nil),   do: true
+  def blank?(_),     do: false
+end
+```
+
+And we would do so for all native data types. The types available are:
+
+* `Atom`
+* `BitString`
+* `Float`
+* `Function`
+* `Integer`
+* `List`
+* `Map`
+* `PID`
+* `Port`
+* `Reference`
+* `Tuple`
+
+Now, with the protocol defined and implementations in hand, we can invoke it:
+
+```iex
+iex> Blank.blank?(0)
+false
+iex> Blank.blank?([])
+true
+iex> Blank.blank?([1, 2, 3])
+false
+```
+
+Notice however that passing a data type that does not implement the protocol raises an error:
+
+```iex
+iex> Blank.blank?("hello")
+** (Protocol.UndefinedError) protocol Blank not implemented for "hello"
+```
+
+## 17.1 Protocols and structs
+
+The power of Elixir's extensibility comes when protocols and structs are mixed.
+
+In the previous chapter, we have learned that, although structs are maps, they do not share protocol implementations with maps. Let's define a `User` struct as in the previous chapter:
+
+```iex
+iex> defmodule User do
+...>   defstruct name: "jose", age: 27
+...> end
+{:module, User,
+ <<70, 79, 82, ...>>, {:__struct__, 0}}
+```
+
+And then check:
+
+```iex
+iex> Blank.blank?(%{})
+true
+iex> Blank.blank?(%User{})
+** (Protocol.UndefinedError) protocol Blank not implemented for %User{age: 27, name: "jose"}
+```
+
+Instead of sharing protocol implementation with maps, structs require their own protocol implementation:
+
+```elixir
+defprotocol User, for: Any do
+  def blank?(_), do: false
+end
+```
+
+If desired you could come up with your own semantics for a user being blank. Not only that, you could use structs to build more robust data types, like queues, and implemented all relevant protocols, like `Enumerable` and possibly `Blank`.
+
+In many cases though, developers may still want to provide a default implementation for structs or any other data type. That's when falling back to Any comes in hand.
+
+### 17.2 Falling back to Any
+
+It may be convenient to provide a default implementation for all types. This can be achieved by setting `@fallback_to_any` to `true` in the protocol definition:
+
+```elixir
+defprotocol Blank do
+  @fallback_to_any true
+  def blank?(data)
+end
+```
+
+Which can now be implemented as:
+
+```elixir
+defimpl Blank, for: Any do
+  def blank?(_), do: false
+end
+```
+
+Now all data types (including structs) that we have not implemented the `Blank` protocol for will be considered non-blank.
+
+### 17.3 Sample protocols
+
+Elixir ships with some built-in protocols. In a previous chapter, we have discussed the `Enum` module which provides many functions that work with any data structure that implements the `Enumerable` protocol:
+
+```iex
+iex> Enum.map [1,2,3], fn(x) -> x * 2 end
+[2,4,6]
+iex> Enum.reduce 1..3, 0, fn(x, acc) -> x + acc end
+6
+```
+
+Another example is the `Inspect` protocol which is used to transform any data structure into a readable textual representation. This is what tools like IEx use to print results:
+
+```iex
+iex> {1, 2, 3}
+{1,2,3}
+iex> %User{}
+%User{name: "jose", age: 27}
+```
+
+Keep in mind that, by convention, whenever the inspected value starts with `#`, it is representing a data structure in non-valid Elixir syntax. This means the inspect protocol is not reversible. Information may be lost along the way:
+
+```iex
+iex> inspect &(&1+2)
+"#Function<6.71889879/1 in :erl_eval.expr/5>"
+```
+
+Another useful example is the `String.Chars` protocol, which specifies how to convert a data structure with characters to a string. It's exposed via the `to_string` function:
+
+```iex
+iex> to_string :hello
+"hello"
+```
+
+Notice that string interpolation in Elixir calls the `to_string` function:
+
+```iex
+iex> "age: #{25}"
+"age: 25"
+```
+
+The snippet above only works because numbers implement the `String.Chars` protocol. Passing a tuple, for example, will lead to an error:
+
+```iex
+iex> tuple = {1, 2, 3}
+{1, 2, 3}
+iex> "tuple: #{tuple}"
+** (Protocol.UndefinedError) protocol String.Chars not implemented for {1, 2, 3}
+```
+
+When there is a need to "print" a more complex data structure, one can simply use the `inspect` function, based on the `Inspect` protocol above:
+
+```iex
+iex> "tuple: #{inspect tuple}"
+"tuple: {1, 2, 3}"
+```
+
+There are other protocols in Elixir but this covers the most common ones. In the next chapter we will learn a bit more about error handling and exceptions in Elixir.

From 1025af386801f352d73a9400c1eef26c648df190 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eric=20Meadows-Jo=CC=88nsson?=
 <eric.meadows.jonsson@gmail.com>
Date: Sun, 2 Mar 2014 22:07:27 +0100
Subject: [PATCH 062/160] Fixes to getting started guide

---
 getting_started/1.markdown  |  6 ++++--
 getting_started/10.markdown |  2 +-
 getting_started/11.markdown |  4 ++--
 getting_started/13.markdown | 12 ++++++------
 getting_started/14.markdown |  2 +-
 getting_started/15.markdown |  6 +++---
 getting_started/17.markdown |  4 ++--
 getting_started/2.markdown  | 26 +++++++++++++-------------
 getting_started/3.markdown  |  4 ++--
 getting_started/4.markdown  |  4 ++--
 getting_started/5.markdown  | 10 +++++-----
 getting_started/6.markdown  | 16 ++++++++--------
 getting_started/7.markdown  | 16 ++++++++--------
 getting_started/8.markdown  |  4 ++--
 14 files changed, 59 insertions(+), 57 deletions(-)

diff --git a/getting_started/1.markdown b/getting_started/1.markdown
index 4e317f61d..d7d35aad7 100644
--- a/getting_started/1.markdown
+++ b/getting_started/1.markdown
@@ -10,7 +10,7 @@ Welcome!
 
 In this tutorial we are going to show you how to get started with Elixir. This chapter will cover installation and how to get started with the Interactive Elixir shell called IEx.
 
-If you find any errors in the tutorial or in the website, [please report a bug or send a pull request to our issues tracker](https://github.com/elixir-lang/elixir-lang.github.com). If you suspect it is a language bug, [please let us know in the language issues tracker](https://github.com/elixir-lang/elixir/issues).
+If you find any errors in the tutorial or on the website, [please report a bug or send a pull request to our issue tracker](https://github.com/elixir-lang/elixir-lang.github.com). If you suspect it is a language bug, [please let us know in the language issue tracker](https://github.com/elixir-lang/elixir/issues).
 
 Let's get started!
 
@@ -71,11 +71,13 @@ If the tests pass, you are ready to go. Otherwise, feel free to open an issue [i
 
 When you install Elixir, you will have three new executables: `iex`, `elixir` and `elixirc`. If you compiled Elixir from source or are using a packaged version, you can find these inside the `bin` directory.
 
-For now, let's start by running `iex` which stands for Interactive Elixir. In interactive mode, we can type any Elixir expression and get its result straight away. Let's warm up with some basic arithmetic expressions:
+For now, let's start by running `iex` which stands for Interactive Elixir. In interactive mode, we can type any Elixir expression and get its result straight away. Let's warm up with some basic expressions:
 
 ```text
 Interactive Elixir - press Ctrl+C to exit (type h() ENTER for help)
 
+iex> 40 + 2
+42
 iex> "hello" <> " world"
 "hello world"
 ```
diff --git a/getting_started/10.markdown b/getting_started/10.markdown
index 8b13fbb8c..80594b224 100644
--- a/getting_started/10.markdown
+++ b/getting_started/10.markdown
@@ -30,7 +30,7 @@ end
 Math.sum_list([1,2,3], 0) #=> 6
 ```
 
-In the example above, we invoke `sum_list` giving a list `[1,2,3]` and the initial value `0` as arguments. When a function has many clauses, we will try each clause until we find one that matches according to the pattern matching rules. In this case, the list `[1,2,3]` matches against `[h|t]` which assigns `h = 1` and `t = [2,3]` while `acc` is set to 0.
+In the example above, we invoke `sum_list` giving a list `[1,2,3]` and the initial value `0` as arguments. When a function has many clauses, we will try each clause until we find one that matches according to the pattern matching rules. In this case, the list `[1,2,3]` matches against `[h|t]` which assigns `h = 1` and `t = [2,3]` while `acc` is set to `0`.
 
 Then, we add the head of the list to the accumulator `h + acc` and call `sum_list` again, recursively, passing the tail of the list as argument. The tail will once again match `[h|t]` until the list is empty, as seen below:
 
diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index 449b78880..5cd2d8710 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -127,9 +127,9 @@ Note that importing a module automatically requires it.
 
 ## 11.4 Aliases
 
-At this point, you may be wondering, what exactly is an Elixir alias? How is it represented?
+At this point, you may be wondering, what exactly an Elixir alias is an how it is represented?
 
-An alias in Elixir is a capitalized identifier (like `String`, `Keyword`, etc) which is converted to an atom representing a module during compilation. For instance, the `String` alias translates by default to the atom `Elixir.String`:
+An alias in Elixir is a capitalized identifier (like `String`, `Keyword`, etc) which is converted to an atom representing a module during compilation. For instance, the `String` alias translates by default to the atom `:"Elixir.String"`:
 
 ```iex
 iex> is_atom(String)
diff --git a/getting_started/13.markdown b/getting_started/13.markdown
index 95d9e1124..78d828566 100644
--- a/getting_started/13.markdown
+++ b/getting_started/13.markdown
@@ -17,7 +17,7 @@ iex> Enum.map(%{1 => 2, 3 => 4}, fn {k, v} -> k * v end)
 [2, 12]
 ```
 
-The Enum module provides a huge range of functions to transform, sort, group, filter and retrieve items from enumerables. It is one of the modules developers use frequently in their Elixir code.
+The `Enum` module provides a huge range of functions to transform, sort, group, filter and retrieve items from enumerables. It is one of the modules developers use frequently in their Elixir code.
 
 Elixir also provides ranges:
 
@@ -28,7 +28,7 @@ iex> Enum.reduce(1..3, 0, &+/2)
 6
 ```
 
-Since the Enum module was designed to work accross different data types, its API is limitted to functions that are useful accross many data types. For specific operations, you may need to reach to modules specific to the data types. For example, if you want to insert an element at a given position in a list, you should use the `List.insert_at/3` function from [the `List` module](/docs/stable/List.html), as it would make little sense to insert a value into a range.
+Since the Enum module was designed to work across different data types, its API is limited to functions that are useful across many data types. For specific operations, you may need to reach to modules specific to the data types. For example, if you want to insert an element at a given position in a list, you should use the `List.insert_at/3` function from [the `List` module](/docs/stable/List.html), as it would make little sense to insert a value into , for example, a range.
 
 We say the functions in the `Enum` module are polymorphic because they can work with diverse data types. In particular, the functions in the `Enum` module can work with any data type that implements [the `Enumerable` protocol](/docs/stable/Enumerable.html). We are going to discuss Protocols in a later chapter, now we are going to move on to a specific kind of enumerable called streams.
 
@@ -59,13 +59,13 @@ iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(&Integer.odd?/1) |> En
 7500000000
 ```
 
-Instead of generating intermediate lists, streams create a series of computations that are invoked only when we pass it to the `Enum` module. Streams are useful when working with large, *possibly infite*, collections.
+Instead of generating intermediate lists, streams create a series of computations that are invoked only when we pass it to the `Enum` module. Streams are useful when working with large, *possibly infinite*, collections.
 
 ## 13.3 Streams
 
 Streams are lazy, composable enumerables.
 
-They are lazy because, as shown in the example above, `1..100_000 |> Stream.map(&(&1 * 3))` returns a data type, an actual stream, that represents the `map` computation:
+They are lazy because, as shown in the example above, `1..100_000 |> Stream.map(&(&1 * 3))` returns a data type, an actual stream, that represents the `map` computation over the range `1..100_000`:
 
 ```iex
 iex> 1..100_000 |> Stream.map(&(&1 * 3))
@@ -79,7 +79,7 @@ iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(&Integer.odd?/1)
 #Stream<1..100_000, chain: [...]>
 ```
 
-Many functions in the Stream module accept any enumerable as argument and return a stream as result. It also provides functions for creating streams, possibly infite. For example, `Stream.cycle/1` can be used to create a stream that cycles around a given enumerable. Be careful to not call a function like `Enum.map/2` on such streams, as they would cycle forever:
+Many functions in the `Stream` module accept any enumerable as argument and return a stream as result. It also provides functions for creating streams, possibly infinite. For example, `Stream.cycle/1` can be used to create a stream that cycles around a given enumerable. Be careful to not call a function like `Enum.map/2` on such streams, as they would cycle forever:
 
     ```iex
     iex> stream = Stream.cycle([1, 2, 3])
@@ -107,4 +107,4 @@ iex> Enum.take(stream, 10)
 
 The example above will fetch the first 10 lines of the file you have selected. This means streams can be very useful for handling large files or even slow resources like network resources.
 
-The amount of functions and functionality in [`Enum`](/docs/stable/Enum.html) and [`Stream`](/docs/stable/Stream.html) modules can be daunting at first, but you will get familiar with them case by case when needed. In particular, focus on the Enum module first and only move to Streams for the particular scenarios where laziness is required to either deal with slow resources or infinite collections.
+The amount of functions and functionality in [`Enum`](/docs/stable/Enum.html) and [`Stream`](/docs/stable/Stream.html) modules can be daunting at first, but you will get familiar with them case by case when needed. In particular, focus on the `Enum` module first and only move to `Stream` for the particular scenarios where laziness is required to either deal with slow resources or infinite collections.
diff --git a/getting_started/14.markdown b/getting_started/14.markdown
index d29155faf..1563bea5f 100644
--- a/getting_started/14.markdown
+++ b/getting_started/14.markdown
@@ -37,7 +37,7 @@ iex> Process.alive?(self())
 true
 ```
 
-Process get much more interesting when we are able to send and receive messages.
+Processes get much more interesting when we are able to send and receive messages.
 
 ## 14.2 send and receive
 
diff --git a/getting_started/15.markdown b/getting_started/15.markdown
index 9cfe5392d..e8c910674 100644
--- a/getting_started/15.markdown
+++ b/getting_started/15.markdown
@@ -12,7 +12,7 @@ We have originally sketched this chapter to come much earlier in the getting sta
 
 ## 15.1 The IO module
 
-The IO module in Elixir is the main mechanism for reading and writing to the standard io (`:stdio`), standard error (`:stderr`), files and other IO devices. Usage of the module is pretty straight-forward:
+The `IO` module in Elixir is the main mechanism for reading and writing to the standard io (`:stdio`), standard error (`:stderr`), files and other IO devices. Usage of the module is pretty straight-forward:
 
 ```iex
 iex> IO.puts "hello world"
@@ -53,7 +53,7 @@ iex> {:ok, file} = File.open "another", [:write, :utf8]
 {:ok, #PID<0.48.0>}
 ```
 
-Besides functions for opening, reading and writing files, the `File` module has many functions that work on the filesystem. Those functions are named after their UNIX equivalents. For exmaple, `File.rm/1` can be used to remove files, `File.mkdir/1` to create directories, `File.mkdir_p/1` creates directories guaranteeing their parents exists and there is even `File.cp_r/2` and `File.rm_rf/2` which copy and remove files and directories recursively.
+Besides functions for opening, reading and writing files, the `File` module has many functions that work on the filesystem. Those functions are named after their UNIX equivalents. For example, `File.rm/1` can be used to remove files, `File.mkdir/1` to create directories, `File.mkdir_p/1` creates directories guaranteeing their parents exists and there is even `File.cp_r/2` and `File.rm_rf/2` which copy and remove files and directories recursively.
 
 You will also notice that functions in the File module have two variants, one with `!` (bang) in its name and others without. For example, when we read the "hello" file above, we have used the one without `!`. Let's try some new examples:
 
@@ -164,7 +164,7 @@ hello world
 :ok
 ```
 
-However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends when on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
+However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
 
 On the other hand, `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
 
diff --git a/getting_started/17.markdown b/getting_started/17.markdown
index ae66f7e63..f0360fcaf 100644
--- a/getting_started/17.markdown
+++ b/getting_started/17.markdown
@@ -35,7 +35,7 @@ end
 
 # Just empty map is blank
 defimpl Blank, for: Map do
-  # Keep ind mind we could not pattern match on %{} because
+  # Keep in mind we could not pattern match on %{} because
   # it matches on all maps. We can however check if the size
   # is zero (and size is a fast operation).
   def blank?(map), do: map_size(map) == 0
@@ -83,7 +83,7 @@ iex> Blank.blank?("hello")
 
 ## 17.1 Protocols and structs
 
-The power of Elixir's extensibility comes when protocols and structs are mixed.
+The power of Elixir's extensibility comes when protocols and structs are used together.
 
 In the previous chapter, we have learned that, although structs are maps, they do not share protocol implementations with maps. Let's define a `User` struct as in the previous chapter:
 
diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 244309d30..1f676f0b4 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -31,7 +31,7 @@ iex> 10 / 2
 5.0
 ```
 
-Notice `10 / 2` returned a float `5.0` instead of an integer. This is expected. In Elixir the operator `/` always returns a float. If you want to do integer division or get the division remainder, you can invoke the `div` and `rem` functions:
+Notice that `10 / 2` returned a float `5.0` instead of an integer. This is expected. In Elixir, the operator `/` always returns a float. If you want to do integer division or get the division remainder, you can invoke the `div` and `rem` functions:
 
 ```iex
 iex> div(10, 2)
@@ -44,7 +44,7 @@ iex> rem 10, 3
 
 Notice that parentheses are not required in order to invoke a function.
 
-Elixir also supports shorcut notations for entering binaries, octals and hexadecimal numbers:
+Elixir also supports shortcut notations for entering binary, octal and hexadecimal numbers:
 
 ```iex
 iex> 0x1F
@@ -64,7 +64,7 @@ iex> 1.0e-10
 1.0e-10
 ```
 
-Floats in Elixir are double precision, accurate up to 16 digits.
+Floats in Elixir are 64 bit double precision.
 
 ## 2.2 Booleans
 
@@ -86,7 +86,7 @@ iex> is_boolean(1)
 false
 ```
 
-Throughout this tutorial and in Elixir documentation, you will see functions mentioned in the format `is_boolean/1`. The first part is the function name and the number is its arity, i.e. the number of arguments the function expects.
+Throughout this tutorial and in Elixir documentation, you will see functions mentioned in the format `is_boolean/1`. The first part is the function name and the number is the arity, i.e. the number of arguments the function expects.
 
 You can also use `is_integer/1`, `is_float/1` or `is_number/1` to check if an argument is an integer, float or any of them.
 
@@ -147,7 +147,7 @@ world
 
 Notice the `IO.puts/1` function returns the atom `:ok` as result after printing.
 
-Strings in Elixir are represented internally by binaries (i.e. a sequence of bytes):
+Strings in Elixir are represented internally by binaries which are sequences of bytes:
 
 ```iex
 iex> is_binary("hellö")
@@ -212,7 +212,7 @@ iex> add_two.(2)
 4
 ```
 
-Keep in mind that a variable defined inside the function does not affect its surroundings:
+Keep in mind that a variable assigned to inside a function does not affect its surrounding environment:
 
 ```iex
 iex> x = 42
@@ -243,7 +243,7 @@ iex> [1, true, 2, false, 3, true] -- [true, false]
 [1, 2, 3, true]
 ```
 
-Throughout the tutorial, we will talk a lot about head and tail of a list. A head is the first element of a list and tail is the remaining of a list. They can be retrieved with the functions `hd/1` and `tl/1`. Let's assign a list to a variable and retrieve its head and tail:
+Throughout the tutorial, we will talk a lot about the head and tail of a list. The head is the first element of a list and the tail is the remainder of a list. They can be retrieved with the functions `hd/1` and `tl/1`. Let's assign a list to a variable and retrieve its head and tail:
 
 ```iex
 iex> list = [1,2,3]
@@ -262,7 +262,7 @@ iex> hd []
 
 Oops!
 
-We will revisit lists a couple times in the following chapters. If you want to look ahead, the "Pattern matching", "Binaries, strings and char lists" and "Enumerables and streams" chapters are particularly interesting.
+We will revisit lists a couple of times in the following chapters. If you want to look ahead, the "Pattern matching", "Binaries, strings and char lists" and "Enumerables and streams" chapters are particularly interesting.
 
 ## 2.7 Tuples
 
@@ -292,9 +292,9 @@ Notice that `set_elem/3` returned a new tuple. The original tuple stored in the
 
 ## 2.8 Lists or tuples?
 
-You are probably wondering: what is the difference in between a list and a tuple?
+You are probably wondering what the difference is between lists and tuples?
 
-That's an excellent question. Tuples are useful when you have a fixed number of fields or when you usually access those items by position. Lists, on the other hand, are useful when the items need to be enumerated.
+Tuples are useful when you have a fixed number of fields or when you usually access those items by position. Lists, on the other hand, are useful when the items need to be enumerated.
 
 One very common use case for tuples is to use them to return extra information from a function. For example, we can use the `File.read/1` function to read a file:
 
@@ -307,9 +307,9 @@ iex> File.read("path/to/unknown/file")
 
 If the path given to `File.read/1` exists, it returns a tuple with the atom `:ok` as first element and the contents as second. Otherwise, it returns `:error` and the error reason.
 
-The difference in between tuples and lists is important because it reflects on the operations you will perform on them. Tuples are fast when you need to get its size or access one element in a particular position. On the other hand, those operations are linear on lists: if you need to access the nth-item of a list, Elixir needs to go item by item until we retrieve the desired one.
+The difference between tuples and lists is important because it reflects on the operations you will perform on them. Tuples are fast when you need to get its size or access one element in a particular position. On the other hand, those operations are linear on lists: if you need to access the nth-item of a list, Elixir needs to go item by item until we retrieve the desired one.
 
-This is the reason there is a `elem/2` function to access a tuple item but there is no builtin equivalent for lists:
+This is the reason there is a `elem/2` function to access a tuple item but there is no built-in equivalent for lists:
 
 ```iex
 iex> tuple = {:ok, "hello"}
@@ -324,4 +324,4 @@ Finally, notice we have used 4 counting functions so far: `byte_size/1` (for the
 
 `length` is used when the number of elements needs to be calculated. For example, calling `length` will iterate the whole list to find the number of elements in that list. `size` is the opposite, it means the value is pre-calculated and stored somewhere, therefore retrieving it is a cheap operation. That said, we use `byte_size` to get the number of bytes in a string, which is cheap, but retrieving the number of unicode characters uses `String.length`, since the whole string needs to be iterated.
 
-Elixir also provides `Port`, `Reference`s and `PID`s as data types (usually used in process communication), and we will take a quick look at them when talking about processes. For now, let's take a look at some of the basic operator to use with our basic types.
+Elixir also provides `Port`, `Reference` and `PID` as data types (usually used in process communication), and we will take a quick look at them when talking about processes. For now, let's take a look at some of the basic operators to use with our basic types.
diff --git a/getting_started/3.markdown b/getting_started/3.markdown
index 403f2c341..252edb291 100644
--- a/getting_started/3.markdown
+++ b/getting_started/3.markdown
@@ -17,7 +17,7 @@ iex> [1,2,3] -- [2]
 [1,3]
 ```
 
-String concatenation is done via `<>`:
+String concatenation is done with `<>`:
 
 ```iex
 iex> "foo" <> "bar"
@@ -111,4 +111,4 @@ The reason we can compare different data types is pragmatism. Sorting algorithms
 
 You don't actually need to memorize this ordering, but it is important just to know an order exists.
 
-Well, that is it for the introduction. In the next chapter, we are going to discuss some basic functions, data types conversions and a bit of control-flow.
+Well, that is it for the introduction. In the next chapter, we are going to discuss some basic functions, data type conversions and a bit of control-flow.
diff --git a/getting_started/4.markdown b/getting_started/4.markdown
index fc5dad00f..f340a8f81 100644
--- a/getting_started/4.markdown
+++ b/getting_started/4.markdown
@@ -28,7 +28,7 @@ iex> 2 = x
 ** (MatchError) no match of right hand side value: 1
 ```
 
-Notice we `1 = x` is a valid expression and it matched because both the left and right side are equal to 1. When the sides do not match, a `MatchError` is reported.
+Notice that `1 = x` is a valid expression and it matched because both the left and right side are equal to 1. When the sides do not match, a `MatchError` is raised.
 
 Also, in Elixir parlance, we don't say a variable is assigned. We say a variable is bound or not. A variable can only be bound while on the left side:
 
@@ -87,7 +87,7 @@ iex> a
 1
 ```
 
-Lists also supporting matching on its head and tail:
+Lists also support matching on its head and tail:
 
 ```iex
 iex> [head | tail] = [1, 2, 3]
diff --git a/getting_started/5.markdown b/getting_started/5.markdown
index 260fc7661..ac8463c86 100644
--- a/getting_started/5.markdown
+++ b/getting_started/5.markdown
@@ -6,7 +6,7 @@ guide: 5
 
 # {{ page.title }}
 
-In this chapter, we will learn about `case`, `cond` and `if` control-flow structures
+In this chapter, we will learn about `case`, `cond` and `if` control-flow structures.
 
 ## 5.1 case
 
@@ -90,7 +90,7 @@ The first clause above will only match when `x` is positive. The Erlang VM only
     * `trunc(number)`
     * `tuple_size(tuple)`
 
-Keep in mind errors in guards do not leak but simply the guard fail:
+Keep in mind errors in guards do not leak but simply let the guard fail:
 
 ```iex
 iex> hd(1)
@@ -130,7 +130,7 @@ The number of arguments in each anonymous function clause needs to be the same,
 
 ### 5.2 cond
 
-`case` is useful when you need to match against different values. However, in many circunstances, we want to check different conditions and find the first one that evaluates to true. In such cases, one may use `cond`:
+`case` is useful when you need to match against different values. However, in many circumstances, we want to check different conditions and find the first one that evaluates to true. In such cases, one may use `cond`:
 
 ```iex
 iex> cond do
@@ -197,7 +197,7 @@ iex> if nil do
 "This will"
 ```
 
-One curiosity about `if/2` and `unless/2` is that they are implemented as macros in the language, they are not keywords (as they would be in many languages). You can check the documentation and the source of `if/2` in [the `Kernel` module docs](/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
+An interesting thing about `if/2` and `unless/2` is that they are implemented as macros in the language, they are not keywords (as they would be in many languages). You can check the documentation and the source of `if/2` in [the `Kernel` module docs](/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
 
 ### 5.4 `do` blocks
 
@@ -262,4 +262,4 @@ iex> case 1, do: (x -> "Got #{x}")
 "Got 1"
 ```
 
-Although it is rare to use the keyword syntax with `case` and `cond`, we will see keyword lists play an important role in the language and are quite common in my functions and macros. We will explore them a bit more in a future chapter, but before, it is time to talk about "Binaries, strings and char lists".
\ No newline at end of file
+Although it is rare to use the keyword syntax with `case` and `cond`, we will see keyword lists play an important role in the language and are quite common in my functions and macros. We will explore them a bit more in a future chapter, but before, it is time to talk about "Binaries, strings and char lists".
diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index 84ce6fa59..32184ef43 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -6,7 +6,7 @@ guide: 6
 
 # {{ page.title }}
 
-In "Basic Types", we have learned about strings and used the `is_binary/1` function for checks:
+In "Basic Types", we learned about strings and used the `is_binary/1` function for checks:
 
 ```iex
 iex> string = "hello"
@@ -15,7 +15,7 @@ iex> is_binary string
 true
 ```
 
-In this chapter, we will understand what are binaries, how they associate with strings and what a single-quoted value, `'like this'`, means in Elixir.
+In this chapter, we will understand what binaries are, how they associate with strings and what a single-quoted value, `'like this'`, means in Elixir.
 
 ## 6.1 UTF-8 and Unicode
 
@@ -54,9 +54,9 @@ iex> String.codepoints("hełło")
 
 You will see that Elixir has excellent support for working with strings and it also supports many of the Unicode operations. In fact, Elixir passes all the tests showcased in the ["The string type is broken"](http://mortoray.com/2013/11/27/the-string-type-is-broken/) article.
 
-However, strings are just part of the story. If a string is a binary and we have used a `is_binary/1` function, Elixir probably has an underlying type, empowering strings, and that is exactly true. Let's talk about binaries!
+However, strings are just part of the story. If a string is a binary and we have used a `is_binary/1` function, Elixir probably has an underlying type empowering strings, and that is exactly true. Let's talk about binaries!
 
-## 6.2 Binaries (and bit strings)
+## 6.2 Binaries (and bitstrings)
 
 In Elixir, you can define a binary using `<<>>`:
 
@@ -99,7 +99,7 @@ iex> <<256 :: size(16)>> # use 16 bits to store the number (2 bytes)
 <<1, 0>>
 iex> <<256 :: utf8>> # the number is a codepoint
 "Ā"
-iex> <<256 :: utf8, 0>> # the number is a codepoint
+iex> <<256 :: utf8, 0>>
 <<196, 128, 0>>
 ```
 
@@ -118,7 +118,7 @@ iex> bit_size(<< 1 :: size(1)>>)
 1
 ```
 
-Interesting... the value is no longer a binary, but a bit string! I.e. it is just a bunch of bits. So a binary is a bitstring when the number of bits is divisible by 8!
+Interesting... the value is no longer a binary, but a bitstring! I.e. it is just a bunch of bits. So a binary is a bitstring when the number of bits is divisible by 8!
 
 We can also pattern match on binaries / bitstrings:
 
@@ -149,7 +149,7 @@ iex> rest
 "llo"
 ```
 
-This finishes our tour on bit strings, binaries and strings. A string is a UTF-8 encoded binary and a binary is a bitstring where the number of bits is divisble by 8. Although this shows the flexibility Elixir provides to work with bits and bytes, 99% of the time you will be working with binaries and using the `is_binary/1` and `byte_size/1` functions.
+This finishes our tour on bitstrings, binaries and strings. A string is a UTF-8 encoded binary and a binary is a bitstring where the number of bits is divisible by 8. Although this shows the flexibility Elixir provides to work with bits and bytes, 99% of the time you will be working with binaries and using the `is_binary/1` and `byte_size/1` functions.
 
 ## 6.3 Char lists
 
@@ -163,7 +163,7 @@ iex> is_list 'hełło'
 
 You can see that, instead of containing bytes, a char list contains the codepoints of the characters in between single-quotes. So while a double-quotes represents a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
 
-In practice, char lists are used mostly when interfacing with Erlang, in particular older libraries that do not accept binaries as arguments. You can convert in between char list to a string or a string to a char list by using the `to_string/1` and `to_char_list/1` functions:
+In practice, char lists are used mostly when interfacing with Erlang, in particular older libraries that do not accept binaries as arguments. You can convert a char list to a string and back by using the `to_string/1` and `to_char_list/1` functions:
 
 ```iex
 iex> to_char_list "hełło"
diff --git a/getting_started/7.markdown b/getting_started/7.markdown
index 4c30adcb4..be6e02055 100644
--- a/getting_started/7.markdown
+++ b/getting_started/7.markdown
@@ -150,19 +150,19 @@ iex> %{map | :c => 3}
 ** (ArgumentError) argument error
 ```
 
-Both access and update syntaxes above require the given keys to exist. For example, the last line failed because there is no `:c` in the map. This is very useful when you are working with maps on a tight loop and you expect only certain keys to exist.
+Both access and update syntaxes above require the given keys to exist. For example, the last line failed because there is no `:c` in the map. This is very useful when you are working with maps where you only expect certain keys to exist.
 
 In future chapters, we will also learn about structs, which provide compile-time guarantees and the foundation for polymorphism in Elixir. Structs are built on top of maps where the update guarantees above are proven to be quite useful.
 
-Manipulating maps is done via [the `Map` module](/docs/stable/Map.html) module and that it provides a very similar API to the `Keyword` module. This is because both modules implement the `Dict` behaviour.
+Manipulating maps is done via [the `Map` module](/docs/stable/Map.html), it provides a very similar API to the `Keyword` module. This is because both modules implement the `Dict` behaviour.
 
-> Maps were recently introduced into the Erlang VM with [the `EEP 43`](www.erlang.org/eeps/eep-0043.html). Erlang 17 provides a partial implementation of the EEP, where only "small maps" are supported. This means maps have good performance characteristics only when storing at maximum a couple dozens keys. To fill in this gap, Elixir also provides [the `HashDict` module](/docs/stable/HashDict.html) which uses a hashing algorithm to provide a dictionary that supports hundreds of thousands keys with good performance.
+> Maps were recently introduced into the Erlang VM with [EEP 43](www.erlang.org/eeps/eep-0043.html). Erlang 17 provides a partial implementation of the EEP, where only "small maps" are supported. This means maps have good performance characteristics only when storing at maximum a couple of dozens keys. To fill in this gap, Elixir also provides [the `HashDict` module](/docs/stable/HashDict.html) which uses a hashing algorithm to provide a dictionary that supports hundreds of thousands keys with good performance.
 
 ## 7.3 Dicts
 
 In Elixir, both keyword lists and maps are called dictionaries. In other words, a dictionary is like an interface (we call them behaviours in Elixir) and both keyword lists and maps implement this interface.
 
-This interface is defined in the [the `Dict` module](/docs/stable/Dict.html) module which also provides an API that delegates to the underyling implementations:
+This interface is defined in the [the `Dict` module](/docs/stable/Dict.html) module which also provides an API that delegates to the underlying implementations:
 
 ```iex
 iex> keyword = []
@@ -175,10 +175,10 @@ iex> Dict.put(map, :a, 1)
 %{a: 1}
 ```
 
-The Dict module allows any developer to implement their own variation of Dict, with specific characteristics, and hook into existing Elixir code. The Dict module also provides functions that are meant to work accross dictionaries. For example, `Dict.equal?/2` can compare two dictionaries of any kind.
+The `Dict` module allows any developer to implement their own variation of `Dict`, with specific characteristics, and hook into existing Elixir code. The `Dict` module also provides functions that are meant to work across dictionaries. For example, `Dict.equal?/2` can compare two dictionaries of any kind.
 
-That said, you may be wondering, which of `Keyword`, `Map` or `Dict` modules should you use in your code? The answer is: it depends.
+That said, you may be wondering, which of `Keyword`, `Map` or `Dict` modules you should use in your code? The answer is: it depends.
 
-If your code is expecting a keyword as argument, use explicitly the `Keyword` module. If a map, the `Map` module. However, if your API is meant to work with any dictionary, use the `Dict` module (and be sure to write tests that pass different dict implementations as arguments).
+If your code is expecting a keyword as argument, explicitly use the `Keyword` module. If a map, the `Map` module. However, if your API is meant to work with any dictionary, use the `Dict` module (and make sure to write tests that pass different dict implementations as arguments).
 
-This concludes our introduction to associative data structures in Elixir. You will find out that in between keyword lists and maps, you will have the right tools to tackle many problems that require associative data structures in Elixir.
+This concludes our introduction to associative data structures in Elixir. You will find out that between keyword lists and maps, you will have the right tools to tackle many problems that require associative data structures in Elixir.
diff --git a/getting_started/8.markdown b/getting_started/8.markdown
index 21879cbec..bf4c95997 100644
--- a/getting_started/8.markdown
+++ b/getting_started/8.markdown
@@ -57,11 +57,11 @@ Elixir projects are usually organized into three directories:
 * lib - contains elixir code (usually `.ex` files)
 * test - contains tests (usually `.exs` files)
 
-When working on actual projects, our build tool called `mix` will be responsible to compile and set up the proper paths for you. For learning purposes, Elixir supports scripted modes, which is more flexible and does not generate any artifact.
+When working on actual projects, our build tool called `mix` will be responsible to compile and set up the proper paths for you. For learning purposes, Elixir supports scripted modes, which is more flexible and does not generate any compiled artifacts.
 
 ## 8.2 Scripted mode
 
-In addition to the Elixir file `.ex`, Elixir also supports `.exs` files for scripting. Elixir treats both files exactly the same way, the only difference is in intention. `.ex` files are meant to be compiled while `.exs` files are used for scripting, without the need for compilation. For instance, one can create a file called `math.exs`:
+In addition to the Elixir file extension `.ex`, Elixir also supports `.exs` files for scripting. Elixir treats both files exactly the same way, the only difference is in intention. `.ex` files are meant to be compiled while `.exs` files are used for scripting, without the need for compilation. For instance, one can create a file called `math.exs`:
 
 ```elixir
 defmodule Math do

From 9c03556a711748a5e6865ee91c5c44aa24930aae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eric=20Meadows-J=C3=B6nsson?=
 <eric.meadows.jonsson@gmail.com>
Date: Sun, 9 Mar 2014 16:15:44 +0100
Subject: [PATCH 063/160] Document `:override` option in mix guide

---
 getting_started/mix/1.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/mix/1.markdown b/getting_started/mix/1.markdown
index 6652ffe5b..5ff834d59 100644
--- a/getting_started/mix/1.markdown
+++ b/getting_started/mix/1.markdown
@@ -235,7 +235,7 @@ Use `mix help` to get more information.
 
 ### 1.4.5 Dependencies of dependencies
 
-If your dependency is another Mix or rebar project, Mix does the right thing: it will automatically fetch and handle all dependencies of your dependencies. However, if your project have two dependencies that share the same dependency and the SCM information for the shared dependency doesn't match between the parent dependencies, Mix will mark that dependency as diverged and emit a warning. To solve this issue you can declare the shared dependency in your project and Mix will use that SCM information to fetch the dependency.
+If your dependency is another Mix or rebar project, Mix does the right thing: it will automatically fetch and handle all dependencies of your dependencies. However, if your project has two dependencies that share the same dependency and the SCM information for the shared dependency doesn't match between the parent dependencies, Mix will mark that dependency as diverged and emit a warning. To solve this issue you can declare the shared dependency in your project with the option `override: true` and Mix will use that SCM information to fetch the dependency.
 
 ## 1.5 Umbrella projects
 

From dad597a319e20897e2d8b0ef0d594b6aec953941 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sat, 8 Mar 2014 08:55:10 -0800
Subject: [PATCH 064/160] let it crash -> fail fast

---
 getting_started/14.markdown    | 4 +---
 getting_started/mix/2.markdown | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/getting_started/14.markdown b/getting_started/14.markdown
index 1563bea5f..20c82f09d 100644
--- a/getting_started/14.markdown
+++ b/getting_started/14.markdown
@@ -125,6 +125,4 @@ This time the process failed and brought the parent process down as they are lin
 
 Process and links play an important role when building fault-tolerant systems. In Elixir applications, we often link our processes to supervisors which will detect when a process die and start a new process in its place.
 
-While other languages would require us to catch/handle exceptions, in Elixir we are actually fine with letting process fail because we expect supervisors to properly restart our systems. Our philosophy is "let it crash".
-
-So let it crash.
+While other languages would require us to catch/handle exceptions, in Elixir we are actually fine with letting process fail because we expect supervisors to properly restart our systems. "Failing fast" is a common philosophy when writing Elixir software!
diff --git a/getting_started/mix/2.markdown b/getting_started/mix/2.markdown
index a532dc203..e34c1c8dd 100644
--- a/getting_started/mix/2.markdown
+++ b/getting_started/mix/2.markdown
@@ -126,7 +126,7 @@ Since our servers may eventually crash, it is common to supervise them, and that
 
 ## 2.2 Supervising our servers
 
-When building applications in Erlang/Elixir, a common philosophy is to "let it crash". Resources are going to become unavailable, timeout in between services are going to happen and other possible failures exist. That's why it is important to recover and react to such failures. With this in mind, we are going to write a supervisor for our server.
+When building applications in Erlang/Elixir, a common philosophy is to fail fast. Resources are going to become unavailable, timeout in between services are going to happen and other possible failures exist. That's why it is important to recover and react to such failures. With this in mind, we are going to write a supervisor for our server.
 
 Create a file at `lib/stacker/supervisor.ex` with the following:
 

From 0c83aeacc2720f26686d82bb1e140ea1afb581b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sat, 15 Mar 2014 20:01:50 +0100
Subject: [PATCH 065/160] Diverse improvements to current chapters

---
 getting_started/10.markdown | 19 +++++++++----
 getting_started/11.markdown | 29 +++++++------------
 getting_started/12.markdown | 10 +++----
 getting_started/13.markdown | 20 ++++++-------
 getting_started/14.markdown |  4 +--
 getting_started/15.markdown | 12 ++++----
 getting_started/16.markdown |  9 +++++-
 getting_started/17.markdown | 16 +++++------
 getting_started/2.markdown  | 57 ++++++++++++++++++++++++++-----------
 getting_started/4.markdown  | 12 ++++----
 getting_started/5.markdown  | 18 ++++++------
 getting_started/6.markdown  |  6 ++--
 getting_started/7.markdown  | 18 ++++++------
 13 files changed, 128 insertions(+), 102 deletions(-)

diff --git a/getting_started/10.markdown b/getting_started/10.markdown
index 80594b224..90c49f39d 100644
--- a/getting_started/10.markdown
+++ b/getting_started/10.markdown
@@ -14,7 +14,7 @@ for(i = 0; i < array.length; i++) {
 }
 ```
 
-In the example above, we are mutating the array which is not possible in Elixir. Therefore, functional languages rely on recursion: a function is called recursively until a condition is reached. Consider the example below that manually sums all the items in the list:
+In the example above we are mutating the array which is not possible in Elixir. Instead functional languages rely on recursion: a function is called recursively until a condition is reached. Consider the example below that manually sums all the items in the list:
 
 ```elixir
 defmodule Math do
@@ -27,7 +27,7 @@ defmodule Math do
   end
 end
 
-Math.sum_list([1,2,3], 0) #=> 6
+Math.sum_list([1, 2, 3], 0) #=> 6
 ```
 
 In the example above, we invoke `sum_list` giving a list `[1,2,3]` and the initial value `0` as arguments. When a function has many clauses, we will try each clause until we find one that matches according to the pattern matching rules. In this case, the list `[1,2,3]` matches against `[h|t]` which assigns `h = 1` and `t = [2,3]` while `acc` is set to `0`.
@@ -35,8 +35,8 @@ In the example above, we invoke `sum_list` giving a list `[1,2,3]` and the initi
 Then, we add the head of the list to the accumulator `h + acc` and call `sum_list` again, recursively, passing the tail of the list as argument. The tail will once again match `[h|t]` until the list is empty, as seen below:
 
 ```elixir
-sum_list [1,2,3], 0
-sum_list [2,3], 1
+sum_list [1, 2, 3], 0
+sum_list [2, 3], 1
 sum_list [3], 3
 sum_list [], 6
 ```
@@ -46,14 +46,21 @@ When the list is empty, it will match the final clause which returns the final r
 Recursion and tail call optimization are an important part of Elixir and are commonly used to create loops, especially in cases where processes need to wait and respond to messages. However, recursion as above is rarely used to manipulate lists, since [the `Enum` module](/docs/stable/Enum.html) already provides many conveniences for working not only with lists but different kinds of Enumerables. For instance, the example above could be simply written as:
 
 ```iex
-iex> Enum.reduce([1,2,3], 0, fn(x, acc) -> x + acc end)
+iex> Enum.reduce([1, 2, 3], 0, fn(x, acc) -> x + acc end)
 6
 ```
 
 Or using the capture syntax:
 
 ```iex
-iex> Enum.reduce([1,2,3], 0, &+/2)
+iex> Enum.reduce([1, 2, 3], 0, &+/2)
+6
+```
+
+Or finally the `sum/1` function:
+
+```iex
+iex> Enum.sum([1, 2, 3])
 6
 ```
 
diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index 5cd2d8710..ccb5430ec 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -21,23 +21,14 @@ end
 From now on, any reference to `List` will automatically expand to `Math.List`. In case one wants to access the original `List`, it can be done by accessing the module via `Elixir`:
 
 ```elixir
-List.values             #=> uses Math.List.values
-Elixir.List.values      #=> uses List.values
-Elixir.Math.List.values #=> uses Math.List.values
+List.flatten             #=> uses Math.List.flatten
+Elixir.List.flatten      #=> uses List.flatten
+Elixir.Math.List.flatten #=> uses Math.List.flatten
 ```
 
-> Note: All modules defined in Elixir are defined inside a main Elixir namespace. However, for convenience, you can omit the Elixir main namespace.
+> Note: All modules defined in Elixir are defined inside a main Elixir namespace. However, for convenience, you can omit "Elixir." when referencing them.
 
-Aliases are frequently used to define shortcuts:
-
-```iex
-iex> alias String, as: S
-nil
-iex> S.length "hello"
-5
-```
-
-Calling `alias` without an `as` option sets the alias automatically to the last part of the module name, for example:
+Aliases are frequently used to define shortcuts. In fact, calling `alias` without an `as` option sets the alias automatically to the last part of the module name, for example:
 
 ```elixir
 alias Math.List
@@ -68,7 +59,7 @@ In the example above, since we are invoking `alias` inside the function `plus/2`
 
 ### 11.2 require
 
-Elixir provides macros.
+Elixir provides macros as a mechanism for meta-programming (writing code that generates code).
 
 Macros are chunks of code that are executed and expanded at compilation time. This means, in order to use a macro, we need to guarantee its module and implementation are available during compilation. This is done with the `require` directive:
 
@@ -83,7 +74,7 @@ true
 
 In Elixir, `Integer.odd?/1` is defined as a macro so it can be used as guards. This means that, in order to invoke `Integer.odd?/1`, we need to first require the `Integer` module.
 
-In general, a module does not need to be required before usage, except if we want to use the macros available in that module. An attempt to call a macro that was not loaded will raise an error. Note that like the `alias` directive, `require` is also lexically scoped. We will talk more about macros in a later chapter.
+In general a module does not need to be required before usage, except if we want to use the macros available in that module. An attempt to call a macro that was not loaded will raise an error. Note that like the `alias` directive, `require` is also lexically scoped. We will talk more about macros in a later chapter.
 
 ### 11.3 import
 
@@ -127,9 +118,9 @@ Note that importing a module automatically requires it.
 
 ## 11.4 Aliases
 
-At this point, you may be wondering, what exactly an Elixir alias is an how it is represented?
+At this point, you may be wondering, what exactly an Elixir alias is and how it is represented?
 
-An alias in Elixir is a capitalized identifier (like `String`, `Keyword`, etc) which is converted to an atom representing a module during compilation. For instance, the `String` alias translates by default to the atom `:"Elixir.String"`:
+An alias in Elixir is a capitalized identifier (like `String`, `Keyword`, etc) which is converted to an atom during compilation. For instance, the `String` alias translates by default to the atom `:"Elixir.String"`:
 
 ```iex
 iex> is_atom(String)
@@ -183,4 +174,4 @@ defmodule Elixir.Foo do
 end
 ```
 
-As we will see in later chapters, aliases also play a crucial role in macros, to guarantee they are hygienic. With this, we are almost finishing our tour about Elixir modules, the last topic to cover is module attributes.
+As we will see in later chapters, aliases also play a crucial role in macros, to guarantee they are hygienic. With this we are almost finishing our tour about Elixir modules, the last topic to cover is module attributes.
diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index c15557148..c2b92cf00 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -99,7 +99,7 @@ end
 
 > Note: Unlike Erlang, user defined attributes are not stored in the module by default. The value exists only during compilation time. A developer can configure an attribute to behave closer to Erlang by calling [`Module.register_attribute/3`](/docs/stable/Module.html#register_attribute/3).
 
-Trying to access an attribute that was not previously defined will raise a warning:
+Trying to access an attribute that was not defined will print a warning:
 
 ```elixir
 defmodule MyServer do
@@ -150,9 +150,9 @@ IO.puts "Running MyPlug with Cowboy on http://localhost:4000"
 Plug.Adapters.Cowboy.http MyPlug, []
 ```
 
-In the example above, we have used the `plug/1` macro to connect functions that will be invoked when there is a web request. Internally, every time you call `plug/1`, the Plug library stores the given arguments as a list in a `@plugs` attribute. At the end, before the module is compiled, Plug runs a callback (registered via the `@before_compile` module attribute) that will then compile all `@plugs` into actual function calls.
+In the example above, we have used the `plug/1` macro to connect functions that will be invoked when there is a web request. Internally, every time you call `plug/1`, the Plug library stores the given arguments as a list in a `@plugs` attribute. At the end, before the module is compiled, Plug runs a callback that will then compile all `@plugs` into actual function calls.
 
-In order to understand the underlying code, we'd need macros, so we will revisit this pattern later on. However, the focus here is exactly on how using module attributes as storage allow developers to create DSLs. Note only they are elegant DSLs but using them with a combination of `@before_compile` callbacks allows developers to generate code that performs well.
+In order to understand the underlying code, we'd need macros, so we will revisit this pattern later on. However, the focus here is exactly on how using module attributes as storage allow developers to create DSLs.
 
 Another example comes from the ExUnit framework, that uses module attributes as annotation and storage:
 
@@ -167,6 +167,6 @@ defmodule MyTest do
 end
 ```
 
-Tags in ExUnit are used to annotate tests. Tags can be later used to filter tests, so you don't run external tests by default locally, since they can be slow, while you can leave them enabled in your builds. Internally, those tags are stored in temporary module attributes, associating each test to their respective tags, so it can be later fetched and filtered by the test framework.
+Tags in ExUnit are used to annotate tests. Tags can be later used to filter tests, so you don't run external tests by default locally unless explicitly desired. Internally, those tags are stored in temporary module attributes, associating each test to their respective tags, so it can be later fetched and filtered by the test framework.
 
-We hope this section shows some light on how Elixir supports meta-programming and how module attributes play an important role when doing so. In the next chapters, we will talk about some common modules in Elixir, like `IO` and `Enum`, before finally going into more advanced topics, like macros.
+We hope this section shines some light on how Elixir supports meta-programming and how module attributes play an important role when doing so. In the next chapters, we will talk about some common modules in Elixir, like `IO` and `Enum`, before finally going into more advanced topics, like macros.
diff --git a/getting_started/13.markdown b/getting_started/13.markdown
index 78d828566..f8235642f 100644
--- a/getting_started/13.markdown
+++ b/getting_started/13.markdown
@@ -28,9 +28,9 @@ iex> Enum.reduce(1..3, 0, &+/2)
 6
 ```
 
-Since the Enum module was designed to work across different data types, its API is limited to functions that are useful across many data types. For specific operations, you may need to reach to modules specific to the data types. For example, if you want to insert an element at a given position in a list, you should use the `List.insert_at/3` function from [the `List` module](/docs/stable/List.html), as it would make little sense to insert a value into , for example, a range.
+Since the Enum module was designed to work across different data types, its API is limited to functions that are useful across many data types. For specific operations, you may need to reach to modules specific to the data types. For example, if you want to insert an element at a given position in a list, you should use the `List.insert_at/3` function from [the `List` module](/docs/stable/List.html), as it would make little sense to insert a value into, for example, a range.
 
-We say the functions in the `Enum` module are polymorphic because they can work with diverse data types. In particular, the functions in the `Enum` module can work with any data type that implements [the `Enumerable` protocol](/docs/stable/Enumerable.html). We are going to discuss Protocols in a later chapter, now we are going to move on to a specific kind of enumerable called streams.
+We say the functions in the `Enum` module are polymorphic because they can work with diverse data types. In particular, the functions in the `Enum` module can work with any data type that implements [the `Enumerable` protocol](/docs/stable/Enumerable.html). We are going to discuss Protocols in a later chapter, for now we are going to move on to a specific kind of enumerable called streams.
 
 ## 13.2 Eager vs Lazy
 
@@ -46,16 +46,16 @@ iex> Enum.filter(1..3, &Integer.odd?/1)
 This means that when performing multiple operations with `Enum`, each operation is going to generate an intermediate list until we reach the result:
 
 ```iex
-iex> 1..100_000 |> Enum.map(&(&1 * 3)) |> Enum.filter(&Integer.odd?/1) |> Enum.reduce(&+/2)
+iex> 1..100_000 |> Enum.map(&(&1 * 3)) |> Enum.filter(&Integer.odd?/1) |> Enum.sum
 7500000000
 ```
 
-The example above has a pipeline of operations. We start with a range and then multiply each element in the range by 3. This first operation will now create and return a list with `100_000` items. Then we retrieve keep all odd elements from the list, generating a new list, now with `50_000` items, and then we sum all entries.
+The example above has a pipeline of operations. We start with a range and then multiply each element in the range by 3. This first operation will now create and return a list with `100_000` items. Then we keep all odd elements from the list, generating a new list, now with `50_000` items, and then we sum all entries.
 
 As an alternative, Elixir provides [the `Stream` module](/docs/stable/Stream.html) which supports lazy operations:
 
 ```iex
-iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(&Integer.odd?/1) |> Enum.reduce(&+/2)
+iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(&Integer.odd?/1) |> Enum.sum
 7500000000
 ```
 
@@ -69,17 +69,17 @@ They are lazy because, as shown in the example above, `1..100_000 |> Stream.map(
 
 ```iex
 iex> 1..100_000 |> Stream.map(&(&1 * 3))
-#Stream<1..100_000, chain: [#Function<34.16982430/1 in Stream.map/2>]>
+#Stream<1..100_000, funs: [#Function<34.16982430/1 in Stream.map/2>]>
 ```
 
 Furthermore, they are composable because we can pipe many stream operations:
 
 ```iex
 iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(&Integer.odd?/1)
-#Stream<1..100_000, chain: [...]>
+#Stream<1..100_000, funs: [...]>
 ```
 
-Many functions in the `Stream` module accept any enumerable as argument and return a stream as result. It also provides functions for creating streams, possibly infinite. For example, `Stream.cycle/1` can be used to create a stream that cycles around a given enumerable. Be careful to not call a function like `Enum.map/2` on such streams, as they would cycle forever:
+Many functions in the `Stream` module accept any enumerable as argument and return a stream as result. It also provides functions for creating streams, possibly infinite. For example, `Stream.cycle/1` can be used to create a stream that cycles a given enumerable infinitely. Be careful to not call a function like `Enum.map/2` on such streams, as they would cycle forever:
 
     ```iex
     iex> stream = Stream.cycle([1, 2, 3])
@@ -97,7 +97,7 @@ On the other hand, `Stream.unfold/2` can be used to generate values from a given
     ["h", "e", "ł"]
     ```
 
-Another interesting function is `Stream.resource/3`, which can be used to wrap around resources, guaranteeing they are opened right before enumeration and closed afterwards, even in case of failures. For example, we can use it to stream a file:
+Another interesting function is `Stream.resource/3` which can be used to wrap around resources, guaranteeing they are opened right before enumeration and closed afterwards, even in case of failures. For example, we can use it to stream a file:
 
 ```iex
 iex> stream = File.stream!("path/to/file")
@@ -107,4 +107,4 @@ iex> Enum.take(stream, 10)
 
 The example above will fetch the first 10 lines of the file you have selected. This means streams can be very useful for handling large files or even slow resources like network resources.
 
-The amount of functions and functionality in [`Enum`](/docs/stable/Enum.html) and [`Stream`](/docs/stable/Stream.html) modules can be daunting at first, but you will get familiar with them case by case when needed. In particular, focus on the `Enum` module first and only move to `Stream` for the particular scenarios where laziness is required to either deal with slow resources or infinite collections.
+The amount of functions and functionality in [`Enum`](/docs/stable/Enum.html) and [`Stream`](/docs/stable/Stream.html) modules can be daunting at first but you will get familiar with them case by case. In particular, focus on the `Enum` module first and only move to `Stream` for the particular scenarios where laziness is required to either deal with slow resources or large, possibly infinite, collections.
diff --git a/getting_started/14.markdown b/getting_started/14.markdown
index 20c82f09d..98eed7428 100644
--- a/getting_started/14.markdown
+++ b/getting_started/14.markdown
@@ -26,7 +26,7 @@ iex> Process.alive?(pid)
 false
 ```
 
-> Note: you will likely get different process identifiers than the ones we are getting in the tutorial.
+> Note: you will likely get different process identifiers than the ones we are getting in this guide.
 
 We can retrieve the PID of the current process by calling `self/0`:
 
@@ -123,6 +123,6 @@ end
 
 This time the process failed and brought the parent process down as they are linked. Linking can also be done manually by calling `Process.link/2`. We recommend you to take a look at [the `Process` module](/docs/stable/Process.html) for other functionality provided by processes.
 
-Process and links play an important role when building fault-tolerant systems. In Elixir applications, we often link our processes to supervisors which will detect when a process die and start a new process in its place.
+Process and links play an important role when building fault-tolerant systems. In Elixir applications we often link our processes to supervisors which will detect when a process die and start a new process in its place. This is only possible because processes don't share anything by default so there is no way the crash of a process can corrupt the state of another process!
 
 While other languages would require us to catch/handle exceptions, in Elixir we are actually fine with letting process fail because we expect supervisors to properly restart our systems. "Failing fast" is a common philosophy when writing Elixir software!
diff --git a/getting_started/15.markdown b/getting_started/15.markdown
index e8c910674..593188a43 100644
--- a/getting_started/15.markdown
+++ b/getting_started/15.markdown
@@ -46,7 +46,7 @@ iex> File.read "hello"
 {:ok, "world"}
 ```
 
-A file can also be opened with `:utf8` encoding which allows the remaining function in the `IO` module to be used:
+A file can also be opened with `:utf8` encoding which allows the remaining functions in the `IO` module to be used:
 
 ```iex
 iex> {:ok, file} = File.open "another", [:write, :utf8]
@@ -55,7 +55,7 @@ iex> {:ok, file} = File.open "another", [:write, :utf8]
 
 Besides functions for opening, reading and writing files, the `File` module has many functions that work on the filesystem. Those functions are named after their UNIX equivalents. For example, `File.rm/1` can be used to remove files, `File.mkdir/1` to create directories, `File.mkdir_p/1` creates directories guaranteeing their parents exists and there is even `File.cp_r/2` and `File.rm_rf/2` which copy and remove files and directories recursively.
 
-You will also notice that functions in the File module have two variants, one with `!` (bang) in its name and others without. For example, when we read the "hello" file above, we have used the one without `!`. Let's try some new examples:
+You will also notice that functions in the `File` module have two variants, one with `!` (bang) in its name and others without. For example, when we read the "hello" file above, we have used the one without `!`. Let's try some new examples:
 
 ```iex
 iex> File.read "hello"
@@ -123,7 +123,7 @@ iex> IO.write(pid, "hello")
 ** (ErlangError) erlang error: :terminated
 ```
 
-After `IO.write/2`, we can see the request sent by the IO module, which then fails since the IO module expected some kind of result, which we did not supply.
+After `IO.write/2`, we can see the request sent by the IO module printed, which then fails since the IO module expected some kind of result, which we did not supply.
 
 The [`StringIO`](/docs/stable/StringIO.html) module provides an implementation of the IO device messages on top of a string:
 
@@ -134,7 +134,7 @@ iex> IO.read(pid, 2)
 "he"
 ```
 
-By modelling IO devices with processes, the Erlang VM allows different nodes in the same network to, for example, exchange file processes and read/write files in between nodes. Of all IO devices, there  is one that is special to each process, called group leader.
+By modelling IO devices with processes, the Erlang VM allows different nodes in the same network to exchange file processes and read/write files in between nodes. Of all IO devices, there is one that is special to each process, called group leader.
 
 When you write to `:stdio`, you are actually sending a message to the group leader, which writes to `:stdio`:
 
@@ -147,7 +147,7 @@ hello
 :ok
 ```
 
-The group leader can be configured per process and is used in many situations, for example, to redirect input and output when connected to another node remotely.
+The group leader can be configured per process and is used in different situations, for example, when executing code in remote nodes, it guarantees messages printed in the remote node are redirected and printed in the "executor" one.
 
 ## 15.5 `iodata` and `char_data`
 
@@ -172,6 +172,6 @@ Although this is a subtle difference, you only need to worry about those details
 
 When working with iodata and char data, Elixir provides `iodata_to_binary/1` to convert any `iodata` to binary. The functions `String.from_char_data!/1` and `List.from_char_data!/1` can be used to convert char data into strings or char lists respectively. Unless you are working closely with some devices, you will rarely need to use those functions.
 
-This finishes our tour on IO devices and IO related functionality. We have learned about four Elixir modules, [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html), [`Path`](/docs/stable/Path.html) and [`StringIO`](/docs/stable/StringIO.html), as well as how the VM uses processes for the underlying IO mechanisms and when how to use lists for IO operations.
+This finishes our tour on IO devices and IO related functionality. We have learned about four Elixir modules, [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html), [`Path`](/docs/stable/Path.html) and [`StringIO`](/docs/stable/StringIO.html), as well as how the VM uses processes for the underlying IO mechanisms and how to use (char and io) lists for IO operations.
 
 In the next chapters, we will explore structs and protocols, before moving to exception handling and other constructs like sigils and comprehensions.
diff --git a/getting_started/16.markdown b/getting_started/16.markdown
index b2c84be07..993230966 100644
--- a/getting_started/16.markdown
+++ b/getting_started/16.markdown
@@ -60,7 +60,7 @@ iex> %{user | oops: :field}
 ** (ArgumentError) argument error
 ```
 
-By using the update syntax, the VM is aware no new keys will be added to the map/struct, leading the different maps created a long the way to share their structure. In the example above, both `jose` and `eric` share the same structure.
+By using the update syntax, the VM is aware no new keys will be added to the map/struct, allowing the maps to share their structure in memory. In the example above, both `jose` and `eric` share the same key structure in memory.
 
 Structs can also be used in pattern matching and they guarantee the structs are of the same type:
 
@@ -89,4 +89,11 @@ iex> user[:name]
 ** (Protocol.UndefinedError) protocol Access not implemented for %User{age: 27, name: "jose"}
 ```
 
+A struct also is not a dictionary and therefore can't be used with the `Dict` module:
+
+```iex
+iex> Dict.get(%User{}, :name)
+** (ArgumentError) unsupported dict: %User{name: "jose", age: 27}
+```
+
 We will cover how structs interacts with protocols in the next chapter.
diff --git a/getting_started/17.markdown b/getting_started/17.markdown
index f0360fcaf..6f92e5763 100644
--- a/getting_started/17.markdown
+++ b/getting_started/17.markdown
@@ -63,7 +63,7 @@ And we would do so for all native data types. The types available are:
 * `Reference`
 * `Tuple`
 
-Now, with the protocol defined and implementations in hand, we can invoke it:
+Now with the protocol defined and implementations in hand, we can invoke it:
 
 ```iex
 iex> Blank.blank?(0)
@@ -74,7 +74,7 @@ iex> Blank.blank?([1, 2, 3])
 false
 ```
 
-Notice however that passing a data type that does not implement the protocol raises an error:
+Passing a data type that does not implement the protocol raises an error:
 
 ```iex
 iex> Blank.blank?("hello")
@@ -85,7 +85,7 @@ iex> Blank.blank?("hello")
 
 The power of Elixir's extensibility comes when protocols and structs are used together.
 
-In the previous chapter, we have learned that, although structs are maps, they do not share protocol implementations with maps. Let's define a `User` struct as in the previous chapter:
+In the previous chapter, we have learned that although structs are maps, they do not share protocol implementations with maps. Let's define a `User` struct as in the previous chapter:
 
 ```iex
 iex> defmodule User do
@@ -107,14 +107,14 @@ iex> Blank.blank?(%User{})
 Instead of sharing protocol implementation with maps, structs require their own protocol implementation:
 
 ```elixir
-defprotocol User, for: Any do
+defprotocol Blank, for: User do
   def blank?(_), do: false
 end
 ```
 
-If desired you could come up with your own semantics for a user being blank. Not only that, you could use structs to build more robust data types, like queues, and implemented all relevant protocols, like `Enumerable` and possibly `Blank`.
+If desired you could come up with your own semantics for a user being blank. Not only that, you could use structs to build more robust data types, like queues, and implemented all relevant protocols, like `Enumerable` and possibly `Blank` for such data type.
 
-In many cases though, developers may still want to provide a default implementation for structs or any other data type. That's when falling back to Any comes in hand.
+In many cases though, developers may want to provide a default implementation for structs, as explicitly implementing the protocol for all structs can be tedious. That's when falling back to Any comes in hand.
 
 ### 17.2 Falling back to Any
 
@@ -142,7 +142,7 @@ Now all data types (including structs) that we have not implemented the `Blank`
 Elixir ships with some built-in protocols. In a previous chapter, we have discussed the `Enum` module which provides many functions that work with any data structure that implements the `Enumerable` protocol:
 
 ```iex
-iex> Enum.map [1,2,3], fn(x) -> x * 2 end
+iex> Enum.map [1, 2, 3], fn(x) -> x * 2 end
 [2,4,6]
 iex> Enum.reduce 1..3, 0, fn(x, acc) -> x + acc end
 6
@@ -157,7 +157,7 @@ iex> %User{}
 %User{name: "jose", age: 27}
 ```
 
-Keep in mind that, by convention, whenever the inspected value starts with `#`, it is representing a data structure in non-valid Elixir syntax. This means the inspect protocol is not reversible. Information may be lost along the way:
+Keep in mind that, by convention, whenever the inspected value starts with `#`, it is representing a data structure in non-valid Elixir syntax. This means the inspect protocol is not reversible as information may be lost along the way:
 
 ```iex
 iex> inspect &(&1+2)
diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 1f676f0b4..70d057d19 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -253,7 +253,7 @@ iex> tl(list)
 [2, 3]
 ```
 
-Asking a head or a tail of an empty list leads to an error:
+Getting the head or the tail of an empty list is an error:
 
 ```iex
 iex> hd []
@@ -262,8 +262,6 @@ iex> hd []
 
 Oops!
 
-We will revisit lists a couple of times in the following chapters. If you want to look ahead, the "Pattern matching", "Binaries, strings and char lists" and "Enumerables and streams" chapters are particularly interesting.
-
 ## 2.7 Tuples
 
 Elixir uses curly brackets to define tuples. As lists, tuples can hold any value:
@@ -275,28 +273,57 @@ iex> size {:ok, "hello"}
 2
 ```
 
-The `elem/2` and `set_elem/3` functions can be used to read or set a value in a tuple:
+Tuples stores elements contiguously in memory. This means accessing a tuple element per index or getting the tuple size is a fast operation (indexes start from zero):
 
 ```iex
 iex> tuple = {:ok, "hello"}
 {:ok, "hello"}
 iex> elem(tuple, 1)
 "hello"
+iex> tuple_size(tuple)
+2
+```
+
+It is also possible to set an element at a particular index in a tuple with `set_elem/3`:
+
+```iex
+iex> tuple = {:ok, "hello"}
+{:ok, "hello"}
 iex> set_elem(tuple, 1, "world")
 {:ok, "world"}
 iex> tuple
 {:ok, "hello"}
 ```
 
-Notice that `set_elem/3` returned a new tuple. The original tuple stored in the `tuple` variable was not modified. This is true for all language data types because Elixir is an immutable language. By being immutable, Elixir reduces the amount mutable shared state in your code, which eliminates many problems when writing code concurrently or when building fault-tolerant applications.
+Notice that `set_elem/3` returned a new tuple. The original tuple stored in the `tuple` variable was not modified because Elixir data types are immutable. By being immutable, Elixir code is easier to reason about as you never need to worry if a particular code is mutating your data structure in place.
+
+By being immutable, Elixir also helps eliminate common cases where concurrent code have race conditions because two different entities are trying to change a data structure at the same time.
 
 ## 2.8 Lists or tuples?
 
-You are probably wondering what the difference is between lists and tuples?
+What is the difference between lists and tuples?
+
+Lists are stored in memory as linked lists. This means each element in a list points to the next element, and then to the next element, until it reaches the end of a list. We call each of those pairs in a list a **cons cell**:
 
-Tuples are useful when you have a fixed number of fields or when you usually access those items by position. Lists, on the other hand, are useful when the items need to be enumerated.
+```iex
+iex> list = [1|[2|[3|[]]]]
+[1, 2, 3]
+```
+
+This means accessing the length of a list is a linear operation: we need to traverse the whole list in order to figure out its size. Updating a list as fast as long as we are prepending elements:
+
+```iex
+iex> [0] ++ list
+[0, 1, 2, 3]
+iex> list ++ [4]
+[1, 2, 3, 4]
+```
+
+The first operation is fast because we are simply adding a new cons that points to the remaining of `list`. The second one is slow because we need to rebuild the whole list and add a new element to the end.
+
+Tuples, on the other hand, are stored contiguously in memory. This means getting the tuple size or accessing an element by index is fast. However, updating or adding element to tuples is expensive because it requires copying the whole tuple in memory.
 
-One very common use case for tuples is to use them to return extra information from a function. For example, we can use the `File.read/1` function to read a file:
+Those performance characteristics dictates the usage of those data structures. For example, one very common use case for tuples is to use them to return extra information from a function, as seen in the `File.read/1` function:
 
 ```iex
 iex> File.read("path/to/existing/file")
@@ -305,23 +332,19 @@ iex> File.read("path/to/unknown/file")
 {:error, :enoent}
 ```
 
-If the path given to `File.read/1` exists, it returns a tuple with the atom `:ok` as first element and the contents as second. Otherwise, it returns `:error` and the error reason.
+If the path given to `File.read/1` exists, it returns a tuple with the atom `:ok` as first element and the file contents as second. Otherwise, it returns `:error` and the error reason.
 
-The difference between tuples and lists is important because it reflects on the operations you will perform on them. Tuples are fast when you need to get its size or access one element in a particular position. On the other hand, those operations are linear on lists: if you need to access the nth-item of a list, Elixir needs to go item by item until we retrieve the desired one.
-
-This is the reason there is a `elem/2` function to access a tuple item but there is no built-in equivalent for lists:
+Most of the time, Elixir is going to guide you to do the right thing. For example, there is a `elem/2` function to access a tuple item but there is no built-in equivalent for lists:
 
 ```iex
 iex> tuple = {:ok, "hello"}
 {:ok, "hello"}
-iex> size(tuple)
-2
 iex> elem(tuple, 1)
 "hello"
 ```
 
-Finally, notice we have used 4 counting functions so far: `byte_size/1` (for the number of bytes in a string), `size/1` (for the tuple size), `length/1` (for the list length) and `String.length/1` (for the number of characters in a string). Their naming is not arbitrary.
+When "counting" the number of elements in a data structure, Elixir also abides to a simple rule: the function should be named `size` if the operation is in constant time (i.e. the value is pre-calculated) or `length` if the operation requires explicit counting.
 
-`length` is used when the number of elements needs to be calculated. For example, calling `length` will iterate the whole list to find the number of elements in that list. `size` is the opposite, it means the value is pre-calculated and stored somewhere, therefore retrieving it is a cheap operation. That said, we use `byte_size` to get the number of bytes in a string, which is cheap, but retrieving the number of unicode characters uses `String.length`, since the whole string needs to be iterated.
+For example, we have used 4 counting functions so far: `byte_size/1` (for the number of bytes in a string), `tuple_size/1` (for the tuple size), `length/1` (for the list length) and `String.length/1` (for the number of characters in a string). That said, we use `byte_size` to get the number of bytes in a string, which is cheap, but retrieving the number of unicode characters uses `String.length`, since the whole string needs to be iterated.
 
-Elixir also provides `Port`, `Reference` and `PID` as data types (usually used in process communication), and we will take a quick look at them when talking about processes. For now, let's take a look at some of the basic operators to use with our basic types.
+Elixir also provides `Port`, `Reference` and `PID` as data types (usually used in process communication), and we will take a quick look at them when talking about processes. For now, let's take a look at some of the basic operators that go with our basic types.
diff --git a/getting_started/4.markdown b/getting_started/4.markdown
index f340a8f81..61e1c2fa8 100644
--- a/getting_started/4.markdown
+++ b/getting_started/4.markdown
@@ -30,7 +30,7 @@ iex> 2 = x
 
 Notice that `1 = x` is a valid expression and it matched because both the left and right side are equal to 1. When the sides do not match, a `MatchError` is raised.
 
-Also, in Elixir parlance, we don't say a variable is assigned. We say a variable is bound or not. A variable can only be bound while on the left side:
+Also, in Elixir parlance, we don't say a variable is assigned. We say a variable is bound or not. A variable can only be bound just on the left side of `=`:
 
 ```iex
 iex> 1 = unknown
@@ -41,7 +41,7 @@ Since there is no variable unknown previously defined, Elixir imagined you were
 
 ## 4.2 Pattern matching
 
-The match operator cannot only be used to match against direct values but they are also useful for destructuring more complex data types. For example, we can pattern match on tuples:
+The match operator is not only used to match against simple values but they are also useful for destructuring more complex data types. For example, we can pattern match on tuples:
 
 ```iex
 iex> {a, b, c} = {:hello, "world", 42}
@@ -114,7 +114,7 @@ iex> [0|list]
 [0, 1, 2, 3]
 ```
 
-Pattern matching allows developers to easily destruct data types such as tuples and lists. As we will see in following chapters, it is one of the foundations of recursion in Elixir and applies to other types as well, like maps and binaries.
+Pattern matching allows developers to easily destructure data types such as tuples and lists. As we will see in following chapters, it is one of the foundations of recursion in Elixir and applies to other types as well, like maps and binaries.
 
 ## 4.3 The pin operator
 
@@ -127,7 +127,7 @@ iex> x = 2
 2
 ```
 
-The pin operator `^` can be used when there is no interest in rebinding a variable but rather matching against its value (prior to the match):
+The pin operator `^` can be used when there is no interest in rebinding a variable but rather in matching against its value prior to the match:
 
 ```iex
 iex> x = 1
@@ -172,6 +172,4 @@ iex> length([1,[2],3]) = 3
 ** (ErlangError) erlang error :illegal_pattern
 ```
 
-This finishes our introduction to pattern matching. As we will see in the next chapter, pattern matching is very common in many language constructs. If you are not familiar with it from other languages, you will get the hang of it with just a bit of practice!
-
-So let's talk some control flow structures, like `case` and `cond`, before we move towards more advanced data-types, likes binaries, keyword lists and maps.
+This finishes our introduction to pattern matching. As we will see in the next chapter, pattern matching is very common in many language constructs.
diff --git a/getting_started/5.markdown b/getting_started/5.markdown
index ac8463c86..b1858a8ed 100644
--- a/getting_started/5.markdown
+++ b/getting_started/5.markdown
@@ -6,7 +6,7 @@ guide: 5
 
 # {{ page.title }}
 
-In this chapter, we will learn about `case`, `cond` and `if` control-flow structures.
+In this chapter we will learn about `case`, `cond` and `if` control-flow structures.
 
 ## 5.1 case
 
@@ -34,7 +34,7 @@ iex> case 10 do
 ...> end
 ```
 
-Clauses also support special conditions to be specified via guards:
+Clauses also allow extra conditions to be specified via guards:
 
 ```iex
 iex> case {1, 2, 3} do
@@ -90,7 +90,7 @@ The first clause above will only match when `x` is positive. The Erlang VM only
     * `trunc(number)`
     * `tuple_size(tuple)`
 
-Keep in mind errors in guards do not leak but simply let the guard fail:
+Keep in mind errors in guards do not leak but simply make the guard fail:
 
 ```iex
 iex> hd(1)
@@ -135,7 +135,7 @@ The number of arguments in each anonymous function clause needs to be the same,
 ```iex
 iex> cond do
 ...>   2 + 2 == 5 ->
-...>     "This will be true"
+...>     "This will not be true"
 ...>   2 * 2 == 3 ->
 ...>     "Nor this"
 ...>   1 + 1 == 2 ->
@@ -144,9 +144,9 @@ iex> cond do
 "But this will"
 ```
 
-This is equivalent to `else if` clauses in many imperative languages.
+This is equivalent to `else if` clauses in many imperative languages (although used way less frequently here).
 
-If none of the conditions return true, an error is raised. For this reason, it is common to see a last condition equal to `true`, which will always match:
+If none of the conditions return true, an error is raised. For this reason, it may be necessary to add a last condition equal to `true`, which will always match:
 
 ```iex
 iex> cond do
@@ -197,7 +197,7 @@ iex> if nil do
 "This will"
 ```
 
-An interesting thing about `if/2` and `unless/2` is that they are implemented as macros in the language, they are not keywords (as they would be in many languages). You can check the documentation and the source of `if/2` in [the `Kernel` module docs](/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
+An interesting note regarding `if/2` and `unless/2` is that they are implemented as macros in the language, they are not keywords (as they would be in many languages). You can check the documentation and the source of `if/2` in [the `Kernel` module docs](/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
 
 ### 5.4 `do` blocks
 
@@ -246,7 +246,7 @@ iex> is_number(if true) do
 ...> end
 ```
 
-Which leads to an undefined function error, since `do` is being passed to the `is_number` function, which is then being called with two arguments, and `if` is being called with only one argument. Adding explicit parentheses is enough to resolve the ambiguity:
+Which leads to an undefined function error, since `do` is being passed to the `is_number` function, which is then called with two arguments while `if` is called with only one. Adding explicit parentheses is enough to resolve the ambiguity:
 
 ```iex
 iex> is_number(if true do
@@ -262,4 +262,4 @@ iex> case 1, do: (x -> "Got #{x}")
 "Got 1"
 ```
 
-Although it is rare to use the keyword syntax with `case` and `cond`, we will see keyword lists play an important role in the language and are quite common in my functions and macros. We will explore them a bit more in a future chapter, but before, it is time to talk about "Binaries, strings and char lists".
+Although it is rare to use the keyword syntax with `case` and `cond`, we will see keyword lists play an important role in the language and are quite common in many functions and macros. We will explore them a bit more in a future chapter, now it is time to talk about "Binaries, strings and char lists".
diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index 32184ef43..c6c9b696b 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -118,7 +118,7 @@ iex> bit_size(<< 1 :: size(1)>>)
 1
 ```
 
-Interesting... the value is no longer a binary, but a bitstring! I.e. it is just a bunch of bits. So a binary is a bitstring when the number of bits is divisible by 8!
+Interesting... the value is no longer a binary, but a bitstring! I.e. it is just a bunch of bits. So a binary is a bitstring where the number of bits is divisible by 8!
 
 We can also pattern match on binaries / bitstrings:
 
@@ -140,7 +140,7 @@ iex> x
 <<2, 3>>
 ```
 
-The pattern above only works if the binary is at the end of the `<<>>`. Similar results can retrieved with the string concatenation operator `<>`:
+The pattern above only works if the binary is at the end of `<<>>`. Similar results can retrieved with the string concatenation operator `<>`:
 
 ```iex
 iex> "he" <> rest = "hello"
@@ -163,7 +163,7 @@ iex> is_list 'hełło'
 
 You can see that, instead of containing bytes, a char list contains the codepoints of the characters in between single-quotes. So while a double-quotes represents a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
 
-In practice, char lists are used mostly when interfacing with Erlang, in particular older libraries that do not accept binaries as arguments. You can convert a char list to a string and back by using the `to_string/1` and `to_char_list/1` functions:
+In practice, char lists are used mostly when interfacing with Erlang, in particular old libraries that do not accept binaries as arguments. You can convert a char list to a string and back by using the `to_string/1` and `to_char_list/1` functions:
 
 ```iex
 iex> to_char_list "hełło"
diff --git a/getting_started/7.markdown b/getting_started/7.markdown
index be6e02055..abfd3e28f 100644
--- a/getting_started/7.markdown
+++ b/getting_started/7.markdown
@@ -6,7 +6,7 @@ guide: 7
 
 # {{ page.title }}
 
-So far, we haven't discussed any associative data structures, i.e. data structures that are able to associate a certain value (or multiple values) to a key. Different languages call them different names, like dictionaries, hashes, associative arrays, maps, etc.
+So far we haven't discussed any associative data structures, i.e. data structures that are able to associate a certain value (or multiple values) to a key. Different languages call them different names, like dictionaries, hashes, associative arrays, maps, etc.
 
 In Elixir, we have two main associative data structures: keyword lists and maps. It is time to learn more about them!
 
@@ -45,7 +45,7 @@ iex> new_list[:a]
 
 Keyword lists are important because they have two special characteristics:
 
-* They keep the user order;
+* They keep the keys ordered as given by the developer;
 * They allow a key to be given more than once;
 
 For example, [the Ecto library](https://github.com/elixir-lang/ecto) makes use of both features to provide an elegant DSL for writing database queries:
@@ -71,9 +71,9 @@ iex> if(false, [do: :this, else: :that])
 :that
 ```
 
-I.e. when the keyword list is the last argument of a function, the square brackets are optional.
+In general, when the keyword list is the last argument of a function, the square brackets are optional.
 
-In order to manipulate keyword lists, Elixir provides [the `Keyword` module](/docs/stable/Keyword.html). Remember though keyword lists are simply lists and as such they provide the same linear performance characteristics as lists. The longer the list, the longer it will take to find a key, to count how many items, and so on. For this reason, keyword lists are used in Elixir mainly as options. If you need to store many items or guarantee one-key maps to at maximum one-value, you should use maps instead.
+In order to manipulate keyword lists, Elixir provides [the `Keyword` module](/docs/stable/Keyword.html). Remember though keyword lists are simply lists and as such they provide the same linear performance characteristics as lists. The longer the list, the longer it will take to find a key, to count how many items, and so on. For this reason, keyword lists are used in Elixir mainly as options. If you need to store many items or guarantee one-key associates with at maximum one-value, you should use maps instead.
 
 Note we can also pattern match on keyword lists:
 
@@ -88,7 +88,7 @@ iex> [b: b, a: a] = [a: 1, b: 2]
 ** (MatchError) no match of right hand side value: [a: 1, b: 2]
 ```
 
-However this is rarely done in practice since pattern matching on lists require the number of items and their internal order to match.
+However this is rarely done in practice since pattern matching on lists require the number of items and their order to match.
 
 ## 7.2 Maps
 
@@ -106,7 +106,7 @@ iex> map[2]
 Compared to keyword lists, we can already see two differences:
 
 * Maps allow any value as key;
-* Maps do not have any specific order;
+* Maps keys do not follow any ordering;
 
 If you pass duplicate keys when creating a map, the last one wins:
 
@@ -137,7 +137,7 @@ iex> %{:c => c} = %{:a => 1, 2 => :b}
 
 As shown above, a map matches as long as the given keys exist on the given map. Therefore, an empty map matches all maps.
 
-One interesting property about maps is that they provide syntaxes for update and accessing atom keys:
+One interesting property about maps is that they provide a particular syntax for updating and accessing atom keys:
 
 ```iex
 iex> map = %{:a => 1, 2 => :b}
@@ -160,7 +160,7 @@ Manipulating maps is done via [the `Map` module](/docs/stable/Map.html), it prov
 
 ## 7.3 Dicts
 
-In Elixir, both keyword lists and maps are called dictionaries. In other words, a dictionary is like an interface (we call them behaviours in Elixir) and both keyword lists and maps implement this interface.
+In Elixir, both keyword lists and maps are called dictionaries. In other words, a dictionary is like an interface (we call them behaviours in Elixir) and both keyword lists and maps modules implement this interface.
 
 This interface is defined in the [the `Dict` module](/docs/stable/Dict.html) module which also provides an API that delegates to the underlying implementations:
 
@@ -177,7 +177,7 @@ iex> Dict.put(map, :a, 1)
 
 The `Dict` module allows any developer to implement their own variation of `Dict`, with specific characteristics, and hook into existing Elixir code. The `Dict` module also provides functions that are meant to work across dictionaries. For example, `Dict.equal?/2` can compare two dictionaries of any kind.
 
-That said, you may be wondering, which of `Keyword`, `Map` or `Dict` modules you should use in your code? The answer is: it depends.
+That said, you may be wondering, which of `Keyword`, `Map` or `Dict` modules should you use in your code? The answer is: it depends.
 
 If your code is expecting a keyword as argument, explicitly use the `Keyword` module. If a map, the `Map` module. However, if your API is meant to work with any dictionary, use the `Dict` module (and make sure to write tests that pass different dict implementations as arguments).
 

From 7b19eac9752975efbaf3e1500dfee8e905582514 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Mon, 24 Mar 2014 11:30:20 +0100
Subject: [PATCH 066/160] Merge default arguments into the module chapter

---
 _layouts/getting_started.html |  24 ++--
 getting_started/10.markdown   | 168 +++++++++++++++++++++-----
 getting_started/11.markdown   | 215 +++++++++++++++++-----------------
 getting_started/12.markdown   | 194 +++++++++++-------------------
 getting_started/13.markdown   | 142 ++++++++++++----------
 getting_started/14.markdown   | 189 +++++++++++++++++++-----------
 getting_started/15.markdown   | 186 +++++++++--------------------
 getting_started/16.markdown   | 193 ++++++++++++++++++++++--------
 getting_started/17.markdown   | 191 +-----------------------------
 getting_started/18.markdown   |   2 +-
 getting_started/19.markdown   |   2 +-
 getting_started/20.markdown   |   2 +-
 getting_started/8.markdown    |  97 ++++++++++++++-
 getting_started/9.markdown    |  97 ++++++---------
 14 files changed, 852 insertions(+), 850 deletions(-)

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index 866384b8f..f69e1c474 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -19,18 +19,18 @@ <h3 class="widget-title">Index</h3>
       <li><a class="spec" href="/getting_started/6.html">Binaries, strings and char lists</a></li>
       <li><a class="spec" href="/getting_started/7.html">Keywords, maps and dicts</a></li>
       <li><a class="spec" href="/getting_started/8.html">Modules</a></li>
-      <li><a class="spec" href="/getting_started/9.html">Default arguments</a></li>
-      <li><a class="spec" href="/getting_started/10.html">Recursion</a></li>
-      <li><a class="spec" href="/getting_started/11.html">alias, require and import</a></li>
-      <li><a class="spec" href="/getting_started/12.html">Module attributes</a></li>
-      <li><a class="spec" href="/getting_started/13.html">Enumerables and streams</a></li>
-      <li><a class="spec" href="/getting_started/14.html">Processes</a></li>
-      <li><a class="spec" href="/getting_started/15.html">IO</a></li>
-      <li><a class="spec" href="/getting_started/16.html">Structs</a></li>
-      <li><a class="spec" href="/getting_started/17.html">Protocols</a></li>
-      <li><a class="spec" href="/getting_started/18.html">try, catch and rescue</a></li>
-      <li><a class="spec" href="/getting_started/19.html">Comprehensions</a></li>
-      <li><a class="spec" href="/getting_started/20.html">Sigils</a></li>
+      <li><a class="spec" href="/getting_started/9.html">Recursion</a></li>
+      <li><a class="spec" href="/getting_started/10.html">alias, require and import</a></li>
+      <li><a class="spec" href="/getting_started/11.html">Module attributes</a></li>
+      <li><a class="spec" href="/getting_started/12.html">Enumerables and streams</a></li>
+      <li><a class="spec" href="/getting_started/13.html">Processes</a></li>
+      <li><a class="spec" href="/getting_started/14.html">IO</a></li>
+      <li><a class="spec" href="/getting_started/15.html">Structs</a></li>
+      <li><a class="spec" href="/getting_started/16.html">Protocols</a></li>
+      <li><a class="spec" href="/getting_started/17.html">try, catch and rescue</a></li>
+      <li><a class="spec" href="/getting_started/18.html">Comprehensions</a></li>
+      <li><a class="spec" href="/getting_started/19.html">Sigils</a></li>
+      <li><a class="spec" href="/getting_started/20.html">Quote and unquote</a></li>
       <li><a class="spec" href="/getting_started/21.html">Macros</a></li>
     </ol>
   </div>
diff --git a/getting_started/10.markdown b/getting_started/10.markdown
index 90c49f39d..407c11858 100644
--- a/getting_started/10.markdown
+++ b/getting_started/10.markdown
@@ -1,67 +1,177 @@
 ---
 layout: getting_started
-title: 10 Recursion
+title: 10 alias, require and import
 guide: 10
 ---
 
 # {{ page.title }}
 
-Due to immutability, loops in Elixir (and in functional programming languages) are written differently from conventional imperative languages. For example, in an imperative language, one would write:
+In order to facilitate software reuse, Elixir provides three directives. As we are going to see below, they are called directives because they have **lexical scope**.
 
-```c
-for(i = 0; i < array.length; i++) {
-  array[i] = array[i] * 2
-}
+### 10.1 alias
+
+`alias` allows you to setup aliases for any given module name. Imagine our `Math` module uses a special list implementation for doing math specific operations:
+
+```elixir
+defmodule Math do
+  alias Math.List, as: List
+end
+```
+
+From now on, any reference to `List` will automatically expand to `Math.List`. In case one wants to access the original `List`, it can be done by accessing the module via `Elixir`:
+
+```elixir
+List.flatten             #=> uses Math.List.flatten
+Elixir.List.flatten      #=> uses List.flatten
+Elixir.Math.List.flatten #=> uses Math.List.flatten
+```
+
+> Note: All modules defined in Elixir are defined inside a main Elixir namespace. However, for convenience, you can omit "Elixir." when referencing them.
+
+Aliases are frequently used to define shortcuts. In fact, calling `alias` without an `as` option sets the alias automatically to the last part of the module name, for example:
+
+```elixir
+alias Math.List
 ```
 
-In the example above we are mutating the array which is not possible in Elixir. Instead functional languages rely on recursion: a function is called recursively until a condition is reached. Consider the example below that manually sums all the items in the list:
+Is the same as:
+
+```elixir
+alias Math.List, as: List
+```
+
+Note that `alias` is **lexically scoped**, which allows you to set aliases inside specific functions:
 
 ```elixir
 defmodule Math do
-  def sum_list([h|t], acc) do
-    sum_list(t, h + acc)
+  def plus(a, b) do
+    alias Math.List
+    # ...
   end
 
-  def sum_list([], acc) do
-    acc
+  def minus(a, b) do
+    # ...
   end
 end
+```
+
+In the example above, since we are invoking `alias` inside the function `plus/2`, the alias will just be valid inside the function `plus/2`. `minus/2` won't be affected at all.
 
-Math.sum_list([1, 2, 3], 0) #=> 6
+### 10.2 require
+
+Elixir provides macros as a mechanism for meta-programming (writing code that generates code).
+
+Macros are chunks of code that are executed and expanded at compilation time. This means, in order to use a macro, we need to guarantee its module and implementation are available during compilation. This is done with the `require` directive:
+
+```iex
+iex> Integer.odd?(3)
+** (CompileError) iex:1: you must require Integer before invoking the macro Integer.odd?/1
+iex> require Integer
+nil
+iex> Integer.odd?(3)
+true
+```
+
+In Elixir, `Integer.odd?/1` is defined as a macro so it can be used as guards. This means that, in order to invoke `Integer.odd?/1`, we need to first require the `Integer` module.
+
+In general a module does not need to be required before usage, except if we want to use the macros available in that module. An attempt to call a macro that was not loaded will raise an error. Note that like the `alias` directive, `require` is also lexically scoped. We will talk more about macros in a later chapter.
+
+### 10.3 import
+
+We use `import` whenever we want to easily access functions or macros from other modules without using the qualified name. For instance, if we want to use the `duplicate` function from `List` several times, we can simply import it:
+
+```iex
+iex> import List, only: [duplicate: 2]
+nil
+iex> duplicate :ok, 3
+[:ok, :ok, :ok]
 ```
 
-In the example above, we invoke `sum_list` giving a list `[1,2,3]` and the initial value `0` as arguments. When a function has many clauses, we will try each clause until we find one that matches according to the pattern matching rules. In this case, the list `[1,2,3]` matches against `[h|t]` which assigns `h = 1` and `t = [2,3]` while `acc` is set to `0`.
+In this case, we are importing only the function `duplicate` (with arity 2) from `List`. Although `only:` is optional, its usage is recommended. `except` could also be given as an option.
 
-Then, we add the head of the list to the accumulator `h + acc` and call `sum_list` again, recursively, passing the tail of the list as argument. The tail will once again match `[h|t]` until the list is empty, as seen below:
+`import` also supports `:macros` and `:functions` to be given to `:only`. For example, to import all macros, one could write:
 
 ```elixir
-sum_list [1, 2, 3], 0
-sum_list [2, 3], 1
-sum_list [3], 3
-sum_list [], 6
+import Integer, only: :macros
 ```
 
-When the list is empty, it will match the final clause which returns the final result of `6`. In imperative languages, such implementation would usually fail for large lists because the stack (in which our execution path is kept) would grow until it reaches a limit. Elixir, however, does tail call optimization in which the stack does not grow when a function exits by calling another function.
+Or to import all functions, you could write:
 
-Recursion and tail call optimization are an important part of Elixir and are commonly used to create loops, especially in cases where processes need to wait and respond to messages. However, recursion as above is rarely used to manipulate lists, since [the `Enum` module](/docs/stable/Enum.html) already provides many conveniences for working not only with lists but different kinds of Enumerables. For instance, the example above could be simply written as:
+```elixir
+import Integer, only: :functions
+```
+
+Note that `import` is also **lexically scoped**, this means we can import specific macros inside specific functions:
+
+```elixir
+defmodule Math do
+  def some_function do
+    import List, only: [duplicate: 2]
+    # call duplicate
+  end
+end
+```
+
+In the example above, the imported `List.duplicate/2` is only visible within that specific function. `duplicate/2` won't be available in any other function in that module (or any other module for that matter).
+
+Note that importing a module automatically requires it.
+
+## 10.4 Aliases
+
+At this point, you may be wondering, what exactly an Elixir alias is and how it is represented?
+
+An alias in Elixir is a capitalized identifier (like `String`, `Keyword`, etc) which is converted to an atom during compilation. For instance, the `String` alias translates by default to the atom `:"Elixir.String"`:
 
 ```iex
-iex> Enum.reduce([1, 2, 3], 0, fn(x, acc) -> x + acc end)
-6
+iex> is_atom(String)
+true
+iex> to_string(String)
+"Elixir.String"
+iex> :"Elixir.String"
+String
 ```
 
-Or using the capture syntax:
+By using the `alias/2` directive, we are simply changing what an alias translates to.
+
+Aliases work as described because in the Erlang VM (and consequently Elixir), modules are represented by atoms. For example, that's the mechanism we use to call Erlang modules:
 
 ```iex
-iex> Enum.reduce([1, 2, 3], 0, &+/2)
-6
+iex> :lists.flatten([1,[2],3])
+[1, 2, 3]
 ```
 
-Or finally the `sum/1` function:
+This is also the mechanism that allows us to dynamically call a given function in a module:
 
 ```iex
-iex> Enum.sum([1, 2, 3])
-6
+iex> mod = :lists
+:lists
+iex> mod.flatten([1,[2],3])
+[1,2,3]
+```
+
+In other words, we are simply calling the function `flatten` on the atom `:lists`.
+
+## 10.5 Nesting
+
+Now that we have talked about aliases, we can talk about nesting and how it works in Elixir. Consider the following example:
+
+```elixir
+defmodule Foo do
+  defmodule Bar do
+  end
+end
+```
+
+The example above will define two modules `Foo` and `Foo.Bar`. The second can be accessed as `Bar` inside `Foo` as long as they are in the same lexical scope. If later the developer decides to move `Bar` to another file, it will need to be referenced by its full name (`Foo.Bar`) or an alias needs to be set using the `alias` directive discussed above.
+
+In other words, the code above is exactly the same as:
+
+```elixir
+defmodule Elixir.Foo do
+  defmodule Elixir.Foo.Bar do
+  end
+  alias Elixir.Foo.Bar, as: Bar
+end
 ```
 
-We will learn more about Enumerables in the "Enumerables and streams" chapter.
+As we will see in later chapters, aliases also play a crucial role in macros, to guarantee they are hygienic. With this we are almost finishing our tour about Elixir modules, the last topic to cover is module attributes.
diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index ccb5430ec..7ef5bccc4 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -1,177 +1,172 @@
 ---
 layout: getting_started
-title: 11 alias, require and import
+title: 11 Module attributes
 guide: 11
 ---
 
 # {{ page.title }}
 
-In order to facilitate software reuse, Elixir provides three directives. As we are going to see below, they are called directives because they have **lexical scope**.
+Module attributes in Elixir serves three purposes:
 
-### 11.1 alias
+1. They serve to annotate the module, often with information to be used by the user or the VM;
+2. They work as constants;
+3. They work as a temporary module storage to be used during compilation;
 
-`alias` allows you to setup aliases for any given module name. Imagine our `Math` module uses a special list implementation for doing math specific operations:
+Let's check each case, one by one.
 
-```elixir
-defmodule Math do
-  alias Math.List, as: List
-end
-```
+## 11.1 As annotations
 
-From now on, any reference to `List` will automatically expand to `Math.List`. In case one wants to access the original `List`, it can be done by accessing the module via `Elixir`:
+Elixir brings the concept of module attributes from Erlang. For example:
 
 ```elixir
-List.flatten             #=> uses Math.List.flatten
-Elixir.List.flatten      #=> uses List.flatten
-Elixir.Math.List.flatten #=> uses Math.List.flatten
+defmodule MyServer do
+  @vsn 2
+end
 ```
 
-> Note: All modules defined in Elixir are defined inside a main Elixir namespace. However, for convenience, you can omit "Elixir." when referencing them.
+In the example above, we are explicitly setting the version attribute for that module. `@vsn` is used by the code reloading mechanism in the Erlang VM to check if a module has been updated or not. If no version is specified, the version is set to the MD5 checksum of the module functions.
 
-Aliases are frequently used to define shortcuts. In fact, calling `alias` without an `as` option sets the alias automatically to the last part of the module name, for example:
+Elixir has a handful of reserved attributes. Here are just a few of them, the most commonly used ones:
 
-```elixir
-alias Math.List
-```
+* `@moduledoc` - provides documentation for the current module;
+* `@doc` - provides documentation for the function or macro that follows the attribute;
+* `@behaviour` - (notice the British spelling) used for specifying an OTP or user-defined behaviour;
+* `@before_compile` - provides a hook that will be invoked before the module is compiled. This makes it possible to inject functions inside the module exactly before compilation;
 
-Is the same as:
+`@moduledoc` and `@doc` are by far the most used attributes and we expect you to use them a lot. Elixir treats documentation as first-class and provide many functions to access documentation:
 
-```elixir
-alias Math.List, as: List
-```
+```iex
+iex> defmodule MyModule do
+...>  @moduledoc "It does **x**"
+...>
+...>  @doc """
+...>  Returns the version
+...>  """
+...>  def version, do: 1
+...> end
+{:module, MyModule, <<70, 79, 82, ...>>, {:version, 0}}
+iex> h MyModule
+* MyModule
 
-Note that `alias` is **lexically scoped**, which allows you to set aliases inside specific functions:
+It does **x**
 
-```elixir
-defmodule Math do
-  def plus(a, b) do
-    alias Math.List
-    # ...
-  end
+iex> h MyModule.version
+* def version()
+
+Returns the version
 
-  def minus(a, b) do
-    # ...
-  end
-end
 ```
 
-In the example above, since we are invoking `alias` inside the function `plus/2`, the alias will just be valid inside the function `plus/2`. `minus/2` won't be affected at all.
+Elixir promotes the use of markdown with heredocs to write readable documentation:
 
-### 11.2 require
+```elixir
+defmodule Math do
+  @moduledoc """
+  This module provides mathematical functions
+  as sin, cos and constants like pi.
 
-Elixir provides macros as a mechanism for meta-programming (writing code that generates code).
+  ## Examples
 
-Macros are chunks of code that are executed and expanded at compilation time. This means, in order to use a macro, we need to guarantee its module and implementation are available during compilation. This is done with the `require` directive:
+      Math.pi
+      #=> 3.1415...
 
-```iex
-iex> Integer.odd?(3)
-** (CompileError) iex:1: you must require Integer before invoking the macro Integer.odd?/1
-iex> require Integer
-nil
-iex> Integer.odd?(3)
-true
+  """
+end
 ```
 
-In Elixir, `Integer.odd?/1` is defined as a macro so it can be used as guards. This means that, in order to invoke `Integer.odd?/1`, we need to first require the `Integer` module.
+We also provide a tool called [ExDoc](https://github.com/elixir-lang/ex_doc) which is used to generate HTML pages with the documentation.
 
-In general a module does not need to be required before usage, except if we want to use the macros available in that module. An attempt to call a macro that was not loaded will raise an error. Note that like the `alias` directive, `require` is also lexically scoped. We will talk more about macros in a later chapter.
+You can take a look at the docs for [Module](/docs/stable/Module.html) for a complete list of supported attributes. Elixir also uses attributes to define [typespecs](/docs/stable/Kernel.Typespec.html), via:
 
-### 11.3 import
+* `@spec` - provides a specification for a function;
+* `@callback` - provides a specification for the behavior callback;
+* `@type` - defines a type to be used in `@spec`;
+* `@typep` - defines a private type to be used in `@spec`;
+* `@opaque` - defines an opaque type to be used in `@spec`;
 
-We use `import` whenever we want to easily access functions or macros from other modules without using the qualified name. For instance, if we want to use the `duplicate` function from `List` several times, we can simply import it:
-
-```iex
-iex> import List, only: [duplicate: 2]
-nil
-iex> duplicate :ok, 3
-[:ok, :ok, :ok]
-```
+This section covers built-in attributes. However, attributes can also be used by developers or extended by libraries to support custom behaviour.
 
-In this case, we are importing only the function `duplicate` (with arity 2) from `List`. Although `only:` is optional, its usage is recommended. `except` could also be given as an option.
+## 11.2 As constants
 
-`import` also supports `:macros` and `:functions` to be given to `:only`. For example, to import all macros, one could write:
+Elixir developers will often use module attributes to be used as constants:
 
 ```elixir
-import Integer, only: :macros
+defmodule MyServer do
+  @initial_state %{host: "117.0.0.1", port: 3456}
+  IO.inspect @initial_state
+end
 ```
 
-Or to import all functions, you could write:
-
-```elixir
-import Integer, only: :functions
-```
+> Note: Unlike Erlang, user defined attributes are not stored in the module by default. The value exists only during compilation time. A developer can configure an attribute to behave closer to Erlang by calling [`Module.register_attribute/3`](/docs/stable/Module.html#register_attribute/3).
 
-Note that `import` is also **lexically scoped**, this means we can import specific macros inside specific functions:
+Trying to access an attribute that was not defined will print a warning:
 
 ```elixir
-defmodule Math do
-  def some_function do
-    import List, only: [duplicate: 2]
-    # call duplicate
-  end
+defmodule MyServer do
+  @unknown
 end
+warning: undefined module attribute @unknown, please remove access to @unknown or explicitly set it to nil before access
 ```
 
-In the example above, the imported `List.duplicate/2` is only visible within that specific function. `duplicate/2` won't be available in any other function in that module (or any other module for that matter).
-
-Note that importing a module automatically requires it.
+Finally, attributes can also be read inside functions:
 
-## 11.4 Aliases
-
-At this point, you may be wondering, what exactly an Elixir alias is and how it is represented?
-
-An alias in Elixir is a capitalized identifier (like `String`, `Keyword`, etc) which is converted to an atom during compilation. For instance, the `String` alias translates by default to the atom `:"Elixir.String"`:
+```elixir
+defmodule MyServer do
+  @my_data 11
+  def first_data, do: @my_data
+  @my_data 13
+  def second_data, do: @my_data
+end
 
-```iex
-iex> is_atom(String)
-true
-iex> to_string(String)
-"Elixir.String"
-iex> :"Elixir.String"
-String
+MyServer.first_data #=> 11
+MyServer.second_data #=> 13
 ```
 
-By using the `alias/2` directive, we are simply changing what an alias translates to.
+Notice that reading an attribute inside a function takes a snapshot of its current value. In other words, the value is read at compilation time and not at runtime. As we are going to see, this makes attributes useful to be used as storage during the module compilation.
 
-Aliases work as described because in the Erlang VM (and consequently Elixir), modules are represented by atoms. For example, that's the mechanism we use to call Erlang modules:
+## 11.3 As temporary storage
 
-```iex
-iex> :lists.flatten([1,[2],3])
-[1, 2, 3]
-```
-
-This is also the mechanism that allows us to dynamically call a given function in a module:
+One of the projects in the Elixir organization is [the `Plug` project](https://github.com/elixir-lang/plug), which is meant to be a common foundation for building web libraries and frameworks in Elixir.
 
-```iex
-iex> mod = :lists
-:lists
-iex> mod.flatten([1,[2],3])
-[1,2,3]
-```
+The Plug library also allows developers to define their own plugs which can be run in a web server:
 
-In other words, we are simply calling the function `flatten` on the atom `:lists`.
+```elixir
+defmodule MyPlug do
+  use Plug.Builder
 
-## 11.5 Nesting
+  plug :set_header
+  plug :send_ok
 
-Now that we have talked about aliases, we can talk about nesting and how it works in Elixir. Consider the following example:
+  def set_header(conn, _opts) do
+    put_resp_header(conn, "x-header", "set")
+  end
 
-```elixir
-defmodule Foo do
-  defmodule Bar do
+  def send_ok(conn, _opts) do
+    send(conn, 200, "ok")
   end
 end
+
+IO.puts "Running MyPlug with Cowboy on http://localhost:4000"
+Plug.Adapters.Cowboy.http MyPlug, []
 ```
 
-The example above will define two modules `Foo` and `Foo.Bar`. The second can be accessed as `Bar` inside `Foo` as long as they are in the same lexical scope. If later the developer decides to move `Bar` to another file, it will need to be referenced by its full name (`Foo.Bar`) or an alias needs to be set using the `alias` directive discussed above.
+In the example above, we have used the `plug/1` macro to connect functions that will be invoked when there is a web request. Internally, every time you call `plug/1`, the Plug library stores the given arguments as a list in a `@plugs` attribute. At the end, before the module is compiled, Plug runs a callback that will then compile all `@plugs` into actual function calls.
+
+In order to understand the underlying code, we'd need macros, so we will revisit this pattern later on. However, the focus here is exactly on how using module attributes as storage allow developers to create DSLs.
 
-In other words, the code above is exactly the same as:
+Another example comes from the ExUnit framework, that uses module attributes as annotation and storage:
 
 ```elixir
-defmodule Elixir.Foo do
-  defmodule Elixir.Foo.Bar do
+defmodule MyTest do
+  use ExUnit.Case
+
+  @tag :external
+  test "contacts external service" do
+    # ...
   end
-  alias Elixir.Foo.Bar, as: Bar
 end
 ```
 
-As we will see in later chapters, aliases also play a crucial role in macros, to guarantee they are hygienic. With this we are almost finishing our tour about Elixir modules, the last topic to cover is module attributes.
+Tags in ExUnit are used to annotate tests. Tags can be later used to filter tests, so you don't run external tests by default unless explicitly desired. Internally, those tags are stored in temporary module attributes, associating each test to their respective tags, so tests with particular tags can be later fetched and filtered by the test framework.
+
+We hope this section shines some light on how Elixir supports meta-programming and how module attributes play an important role when doing so. In the next chapters, we will talk about some common modules in Elixir, like `IO` and `Enum`, before finally going into more advanced topics, like macros.
diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index c2b92cf00..0c1b78c3f 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -1,172 +1,110 @@
 ---
 layout: getting_started
-title: 12 Module attributes
+title: 12 Enumerables and Streams
 guide: 12
 ---
 
 # {{ page.title }}
 
-Module attributes in Elixir serves three purposes:
+## 12.1 Enumerables
 
-1. They serve to annotate the module, often with information to be used by the user or the VM;
-2. They work as constants;
-3. They work as a temporary module storage to be used during compilation;
-
-Let's check each case, one by one.
-
-## 12.1 As annotations
-
-Elixir brings the concept of module attributes from Erlang. For example:
-
-```elixir
-defmodule MyServer do
-  @vsn 2
-end
-```
-
-In the example above, we are explicitly setting the version attribute for that module. `@vsn` is used by the code reloading mechanism in the Erlang VM to check if a module has been updated or not. If no version is specified, the version is set to the MD5 checksum of the module functions.
-
-Elixir has a handful of reserved attributes. Here are just a few of them, the most commonly used ones:
-
-* `@moduledoc` - provides documentation for the current module;
-* `@doc` - provides documentation for the function or macro that follows the attribute;
-* `@behaviour` - (notice the British spelling) used for specifying an OTP or user-defined behaviour;
-* `@before_compile` - provides a hook that will be invoked before the module is compiled. This makes it possible to inject functions inside the module exactly before compilation;
-
-`@moduledoc` and `@doc` are by far the most used attributes and we expect you to use them a lot. Elixir treats documentation as first-class and provide many functions to access documentation:
+Elixir provides the concept of enumerables and [the `Enum` module](/docs/stable/Enum.html) to work with them. We have already learned two enumerables: lists and maps.
 
 ```iex
-iex> defmodule MyModule do
-...>  @moduledoc "It does **x**"
-...>
-...>  @doc """
-...>  Returns the version
-...>  """
-...>  def version, do: 1
-...> end
-{:module, MyModule, <<70, 79, 82, ...>>, {:version, 0}}
-iex> h MyModule
-* MyModule
-
-It does **x**
-
-iex> h MyModule.version
-* def version()
-
-Returns the version
-
+iex> Enum.map([1, 2, 3], fn x -> x * 2 end)
+[2, 4, 6]
+iex> Enum.map(%{1 => 2, 3 => 4}, fn {k, v} -> k * v end)
+[2, 12]
 ```
 
-Elixir promotes the use of markdown with heredocs to write readable documentation:
-
-```elixir
-defmodule Math do
-  @moduledoc """
-  This module provides mathematical functions
-  as sin, cos and constants like pi.
-
-  ## Examples
+The `Enum` module provides a huge range of functions to transform, sort, group, filter and retrieve items from enumerables. It is one of the modules developers use frequently in their Elixir code.
 
-      Math.pi
-      #=> 3.1415...
+Elixir also provides ranges:
 
-  """
-end
+```iex
+iex> Enum.map(1..3, fn x -> x * 2 end)
+[2, 4, 6]
+iex> Enum.reduce(1..3, 0, &+/2)
+6
 ```
 
-We also provide a tool called [ExDoc](https://github.com/elixir-lang/ex_doc) which is used to generate HTML pages with the documentation.
-
-You can take a look at the docs for [Module](/docs/stable/Module.html) for a complete list of supported attributes. Elixir also uses attributes to define [typespecs](/docs/stable/Kernel.Typespec.html), via:
+Since the Enum module was designed to work across different data types, its API is limited to functions that are useful across many data types. For specific operations, you may need to reach to modules specific to the data types. For example, if you want to insert an element at a given position in a list, you should use the `List.insert_at/3` function from [the `List` module](/docs/stable/List.html), as it would make little sense to insert a value into, for example, a range.
 
-* `@spec` - provides a specification for a function;
-* `@callback` - provides a specification for the behavior callback;
-* `@type` - defines a type to be used in `@spec`;
-* `@typep` - defines a private type to be used in `@spec`;
-* `@opaque` - defines an opaque type to be used in `@spec`;
+We say the functions in the `Enum` module are polymorphic because they can work with diverse data types. In particular, the functions in the `Enum` module can work with any data type that implements [the `Enumerable` protocol](/docs/stable/Enumerable.html). We are going to discuss Protocols in a later chapter, for now we are going to move on to a specific kind of enumerable called streams.
 
-This section covers built-in attributes. However, attributes can also be used by developers or extended by libraries to support custom behaviour.
+## 12.2 Eager vs Lazy
 
-## 12.2 As constants
+All the functions in the `Enum` module are eager. Many functions expect an enumerable and return a list back:
 
-Elixir developers will often use module attributes to be used as constants:
-
-```elixir
-defmodule MyServer do
-  @initial_state %{host: "127.0.0.1", port: 3456}
-  IO.inspect @initial_state
-end
+```iex
+iex> require Integer
+nil
+iex> Enum.filter(1..3, &Integer.odd?/1)
+[1, 3]
 ```
 
-> Note: Unlike Erlang, user defined attributes are not stored in the module by default. The value exists only during compilation time. A developer can configure an attribute to behave closer to Erlang by calling [`Module.register_attribute/3`](/docs/stable/Module.html#register_attribute/3).
+This means that when performing multiple operations with `Enum`, each operation is going to generate an intermediate list until we reach the result:
 
-Trying to access an attribute that was not defined will print a warning:
-
-```elixir
-defmodule MyServer do
-  @unknown
-end
-warning: undefined module attribute @unknown, please remove access to @unknown or explicitly set it to nil before access
+```iex
+iex> 1..100_000 |> Enum.map(&(&1 * 3)) |> Enum.filter(&Integer.odd?/1) |> Enum.sum
+7500000000
 ```
 
-Finally, attributes can also be read inside functions:
+The example above has a pipeline of operations. We start with a range and then multiply each element in the range by 3. This first operation will now create and return a list with `100_000` items. Then we keep all odd elements from the list, generating a new list, now with `50_000` items, and then we sum all entries.
 
-```elixir
-defmodule MyServer do
-  @my_data 11
-  def first_data, do: @my_data
-  @my_data 13
-  def second_data, do: @my_data
-end
+As an alternative, Elixir provides [the `Stream` module](/docs/stable/Stream.html) which supports lazy operations:
 
-MyServer.first_data #=> 11
-MyServer.second_data #=> 13
+```iex
+iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(&Integer.odd?/1) |> Enum.sum
+7500000000
 ```
 
-Notice that reading an attribute inside a function takes a snapshot of its current value. In other words, the value is read at compilation time and not at runtime. As we are going to see, this makes attributes useful to be used as storage during the module compilation.
+Instead of generating intermediate lists, streams create a series of computations that are invoked only when we pass it to the `Enum` module. Streams are useful when working with large, *possibly infinite*, collections.
 
-## 12.3 As temporary storage
+## 12.3 Streams
 
-One of the projects in the Elixir organization is [the `Plug` project](https://github.com/elixir-lang/plug), which is meant to be a common foundation for building web libraries and frameworks in Elixir.
+Streams are lazy, composable enumerables.
 
-The Plug library also allows developers to define their own plugs which can be run in a web server:
+They are lazy because, as shown in the example above, `1..100_000 |> Stream.map(&(&1 * 3))` returns a data type, an actual stream, that represents the `map` computation over the range `1..100_000`:
 
-```elixir
-defmodule MyPlug do
-  use Plug.Builder
-
-  plug :set_header
-  plug :send_ok
-
-  def set_header(conn, _opts) do
-    put_resp_header(conn, "x-header", "set")
-  end
+```iex
+iex> 1..100_000 |> Stream.map(&(&1 * 3))
+#Stream<1..100_000, funs: [#Function<34.16982430/1 in Stream.map/2>]>
+```
 
-  def send_ok(conn, _opts) do
-    send(conn, 200, "ok")
-  end
-end
+Furthermore, they are composable because we can pipe many stream operations:
 
-IO.puts "Running MyPlug with Cowboy on http://localhost:4000"
-Plug.Adapters.Cowboy.http MyPlug, []
+```iex
+iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(&Integer.odd?/1)
+#Stream<1..100_000, funs: [...]>
 ```
 
-In the example above, we have used the `plug/1` macro to connect functions that will be invoked when there is a web request. Internally, every time you call `plug/1`, the Plug library stores the given arguments as a list in a `@plugs` attribute. At the end, before the module is compiled, Plug runs a callback that will then compile all `@plugs` into actual function calls.
+Many functions in the `Stream` module accept any enumerable as argument and return a stream as result. It also provides functions for creating streams, possibly infinite. For example, `Stream.cycle/1` can be used to create a stream that cycles a given enumerable infinitely. Be careful to not call a function like `Enum.map/2` on such streams, as they would cycle forever:
+
+    ```iex
+    iex> stream = Stream.cycle([1, 2, 3])
+    #Function<15.16982430/2 in Stream.cycle/1>
+    iex> Enum.take(stream, 10)
+    [1, 2, 3, 1, 2, 3, 1, 2, 3, 1]
+    ```
 
-In order to understand the underlying code, we'd need macros, so we will revisit this pattern later on. However, the focus here is exactly on how using module attributes as storage allow developers to create DSLs.
+On the other hand, `Stream.unfold/2` can be used to generate values from a given initial value:
 
-Another example comes from the ExUnit framework, that uses module attributes as annotation and storage:
+    ```iex
+    iex> stream = Stream.unfold("hełło", &String.next_codepoint/1)
+    #Function<15.16982430/2 in Stream.cycle/1>
+    iex> Enum.take(stream, 3)
+    ["h", "e", "ł"]
+    ```
 
-```elixir
-defmodule MyTest do
-  use ExUnit.Case
+Another interesting function is `Stream.resource/3` which can be used to wrap around resources, guaranteeing they are opened right before enumeration and closed afterwards, even in case of failures. For example, we can use it to stream a file:
 
-  @tag :external
-  test "contacts external service" do
-    # ...
-  end
-end
+```iex
+iex> stream = File.stream!("path/to/file")
+#Function<18.16982430/2 in Stream.resource/3>
+iex> Enum.take(stream, 10)
 ```
 
-Tags in ExUnit are used to annotate tests. Tags can be later used to filter tests, so you don't run external tests by default locally unless explicitly desired. Internally, those tags are stored in temporary module attributes, associating each test to their respective tags, so it can be later fetched and filtered by the test framework.
+The example above will fetch the first 10 lines of the file you have selected. This means streams can be very useful for handling large files or even slow resources like network resources.
 
-We hope this section shines some light on how Elixir supports meta-programming and how module attributes play an important role when doing so. In the next chapters, we will talk about some common modules in Elixir, like `IO` and `Enum`, before finally going into more advanced topics, like macros.
+The amount of functions and functionality in [`Enum`](/docs/stable/Enum.html) and [`Stream`](/docs/stable/Stream.html) modules can be daunting at first but you will get familiar with them case by case. In particular, focus on the `Enum` module first and only move to `Stream` for the particular scenarios where laziness is required to either deal with slow resources or large, possibly infinite, collections.
diff --git a/getting_started/13.markdown b/getting_started/13.markdown
index f8235642f..e85e569e6 100644
--- a/getting_started/13.markdown
+++ b/getting_started/13.markdown
@@ -1,110 +1,128 @@
 ---
 layout: getting_started
-title: 13 Enumerables and Streams
+title: 13 Processes
 guide: 13
 ---
 
 # {{ page.title }}
 
-## 13.1 Enumerables
+In Elixir, all of your code run inside processes. Those processes are isolated from each other and they communicate with message passing. In this chapter, we will learn about the basic constructs for spawning new processes, sending and receiving messages.
 
-Elixir provides the concept of enumerables and [the `Enum` module](/docs/stable/Enum.html) to work with them. We have already learned two enumerables: lists and maps.
+## 13.1 spawn
+
+The basic mechanism for spawning new processes is with the auto-imported `spawn/1` function:
 
 ```iex
-iex> Enum.map([1, 2, 3], fn x -> x * 2 end)
-[2, 4, 6]
-iex> Enum.map(%{1 => 2, 3 => 4}, fn {k, v} -> k * v end)
-[2, 12]
+iex> spawn fn -> 1 + 2 end
+#PID<0.43.0>
 ```
 
-The `Enum` module provides a huge range of functions to transform, sort, group, filter and retrieve items from enumerables. It is one of the modules developers use frequently in their Elixir code.
-
-Elixir also provides ranges:
+Notice `spawn/1` returns a PID (process identifier). At this point, the process you spawned is very likely dead. The spawned process will execute the given function and exit after the function is done:
 
 ```iex
-iex> Enum.map(1..3, fn x -> x * 2 end)
-[2, 4, 6]
-iex> Enum.reduce(1..3, 0, &+/2)
-6
+iex> pid = spawn fn -> 1 + 2 end
+#PID<0.44.0>
+iex> Process.alive?(pid)
+false
 ```
 
-Since the Enum module was designed to work across different data types, its API is limited to functions that are useful across many data types. For specific operations, you may need to reach to modules specific to the data types. For example, if you want to insert an element at a given position in a list, you should use the `List.insert_at/3` function from [the `List` module](/docs/stable/List.html), as it would make little sense to insert a value into, for example, a range.
-
-We say the functions in the `Enum` module are polymorphic because they can work with diverse data types. In particular, the functions in the `Enum` module can work with any data type that implements [the `Enumerable` protocol](/docs/stable/Enumerable.html). We are going to discuss Protocols in a later chapter, for now we are going to move on to a specific kind of enumerable called streams.
-
-## 13.2 Eager vs Lazy
+> Note: you will likely get different process identifiers than the ones we are getting in this guide.
 
-All the functions in the `Enum` module are eager. Many functions expect an enumerable and return a list back:
+We can retrieve the PID of the current process by calling `self/0`:
 
 ```iex
-iex> require Integer
-nil
-iex> Enum.filter(1..3, &Integer.odd?/1)
-[1, 3]
+iex> self()
+#PID<0.41.0>
+iex> Process.alive?(self())
+true
 ```
 
-This means that when performing multiple operations with `Enum`, each operation is going to generate an intermediate list until we reach the result:
+Processes get much more interesting when we are able to send and receive messages.
+
+## 13.2 send and receive
+
+We can send messages with `send/2` and receive them with `receive/1`:
 
 ```iex
-iex> 1..100_000 |> Enum.map(&(&1 * 3)) |> Enum.filter(&Integer.odd?/1) |> Enum.sum
-7500000000
+iex> send self(), {:hello, "world"}
+{:hello, "world"}
+iex> receive do
+...>   {:hello, msg}  -> msg
+...>   {:world, msg} -> "won't match"
+...> end
+"world"
 ```
 
-The example above has a pipeline of operations. We start with a range and then multiply each element in the range by 3. This first operation will now create and return a list with `100_000` items. Then we keep all odd elements from the list, generating a new list, now with `50_000` items, and then we sum all entries.
+When a message is sent to a process, the message is stored in the process mailbox. The `receive/2` block goes through the current process mailbox searching for a message that matches any of the given patterns. `receive/1` supports many clauses, like `case/2`, as well as guards in the clauses.
 
-As an alternative, Elixir provides [the `Stream` module](/docs/stable/Stream.html) which supports lazy operations:
+If there is no message in the mailbox matching any of the patterns, the current process will wait until a matching message arrives. A timeout can also be specified:
 
 ```iex
-iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(&Integer.odd?/1) |> Enum.sum
-7500000000
+iex> receive do
+...>   {:hello, msg}  -> msg
+...> after
+...>   1_000 -> "nothing after 1s"
+...> end
+"nothing after 1s"
 ```
 
-Instead of generating intermediate lists, streams create a series of computations that are invoked only when we pass it to the `Enum` module. Streams are useful when working with large, *possibly infinite*, collections.
-
-## 13.3 Streams
-
-Streams are lazy, composable enumerables.
+A timeout of 0 can be given when you already expect the message to be in the mailbox.
 
-They are lazy because, as shown in the example above, `1..100_000 |> Stream.map(&(&1 * 3))` returns a data type, an actual stream, that represents the `map` computation over the range `1..100_000`:
+Let's put all together and send messages in between processes:
 
 ```iex
-iex> 1..100_000 |> Stream.map(&(&1 * 3))
-#Stream<1..100_000, funs: [#Function<34.16982430/1 in Stream.map/2>]>
+iex> parent = self()
+#PID<0.41.0>
+iex> spawn fn -> send(parent, {:hello, self()}) end
+#PID<0.48.0>
+iex> receive do
+...>   {:hello, pid} -> "Got hello from #{inspect pid}"
+...> end
+"Got hello from #PID<0.48.0>"
 ```
 
-Furthermore, they are composable because we can pipe many stream operations:
+While in the shell, you may find the helper `flush/0` quite useful. It flushes and prints all the messages in the mailbox.
 
 ```iex
-iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(&Integer.odd?/1)
-#Stream<1..100_000, funs: [...]>
+iex> send self(), :hello
+:hello
+iex> flush()
+:hello
+:ok
 ```
 
-Many functions in the `Stream` module accept any enumerable as argument and return a stream as result. It also provides functions for creating streams, possibly infinite. For example, `Stream.cycle/1` can be used to create a stream that cycles a given enumerable infinitely. Be careful to not call a function like `Enum.map/2` on such streams, as they would cycle forever:
+Before we finish this chapter, let's talk about process links.
 
-    ```iex
-    iex> stream = Stream.cycle([1, 2, 3])
-    #Function<15.16982430/2 in Stream.cycle/1>
-    iex> Enum.take(stream, 10)
-    [1, 2, 3, 1, 2, 3, 1, 2, 3, 1]
-    ```
+## 13.3 Links
 
-On the other hand, `Stream.unfold/2` can be used to generate values from a given initial value:
+The most common form of spawning in Elixir is actually via `spawn_link/1`. Before we show an example with `spawn_link/1`, let's try to see what happens when a process fail:
 
-    ```iex
-    iex> stream = Stream.unfold("hełło", &String.next_codepoint/1)
-    #Function<15.16982430/2 in Stream.cycle/1>
-    iex> Enum.take(stream, 3)
-    ["h", "e", "ł"]
-    ```
+```iex
+iex> spawn fn -> raise "oops" end
+#PID<0.58.0>
+```
+
+Well... nothing happened. That's because processes are isolated. If we want the failure in one process to propagate to another one, we should link them. This can be done with `spawn_link/1`:
+
+```iex
+iex> spawn_link fn -> raise "oops" end
+#PID<0.60.0>
+** (EXIT from #PID<0.60.0>) {RuntimeError[message: "oops"], [{:erlang, :apply, 2, []}]}
+```
 
-Another interesting function is `Stream.resource/3` which can be used to wrap around resources, guaranteeing they are opened right before enumeration and closed afterwards, even in case of failures. For example, we can use it to stream a file:
+When a failure happens in the shell, the shell automatically traps the failure and shows it nicely formatted. In order to understand what would really happen in our code, let's use `spawn_link/1` inside a file and run it:
 
 ```iex
-iex> stream = File.stream!("path/to/file")
-#Function<18.16982430/2 in Stream.resource/3>
-iex> Enum.take(stream, 10)
+# spawn.exs
+spawn_link fn -> raise "oops" end
+
+receive do
+  :hello -> "let's wait until the process fails"
+end
 ```
 
-The example above will fetch the first 10 lines of the file you have selected. This means streams can be very useful for handling large files or even slow resources like network resources.
+This time the process failed and brought the parent process down as they are linked. Linking can also be done manually by calling `Process.link/2`. We recommend you to take a look at [the `Process` module](/docs/stable/Process.html) for other functionality provided by processes.
+
+Process and links play an important role when building fault-tolerant systems. In Elixir applications we often link our processes to supervisors which will detect when a process die and start a new process in its place. This is only possible because processes don't share anything by default so there is no way the crash of a process can corrupt the state of another process!
 
-The amount of functions and functionality in [`Enum`](/docs/stable/Enum.html) and [`Stream`](/docs/stable/Stream.html) modules can be daunting at first but you will get familiar with them case by case. In particular, focus on the `Enum` module first and only move to `Stream` for the particular scenarios where laziness is required to either deal with slow resources or large, possibly infinite, collections.
+While other languages would require us to catch/handle exceptions, in Elixir we are actually fine with letting process fail because we expect supervisors to properly restart our systems. "Failing fast" is a common philosophy when writing Elixir software!
diff --git a/getting_started/14.markdown b/getting_started/14.markdown
index 98eed7428..bfdf3a815 100644
--- a/getting_started/14.markdown
+++ b/getting_started/14.markdown
@@ -1,128 +1,177 @@
 ---
 layout: getting_started
-title: 14 Processes
+title: 14 IO
 guide: 14
 ---
 
 # {{ page.title }}
 
-In Elixir, all of your code run inside processes. Those processes are isolated from each other and they communicate with message passing. In this chapter, we will learn about the basic constructs for spawning new processes, sending and receiving messages.
+This chapter is a quick introduction to input/output mechanisms in Elixir and related modules, like [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html) and [`Path`](/docs/stable/Path.html).
 
-## 14.1 spawn
+We have originally sketched this chapter to come much earlier in the getting started guide. However, we noticed the IO system provides a great opportunity to bring some philosophies and curiosities about Elixir and the VM.
 
-The basic mechanism for spawning new processes is with the auto-imported `spawn/1` function:
+## 14.1 The IO module
+
+The `IO` module in Elixir is the main mechanism for reading and writing to the standard io (`:stdio`), standard error (`:stderr`), files and other IO devices. Usage of the module is pretty straight-forward:
 
 ```iex
-iex> spawn fn -> 1 + 2 end
-#PID<0.43.0>
+iex> IO.puts "hello world"
+"hello world"
+:ok
+iex> IO.gets "yes or no? "
+yes or no? yes
+"yes\n"
 ```
 
-Notice `spawn/1` returns a PID (process identifier). At this point, the process you spawned is very likely dead. The spawned process will execute the given function and exit after the function is done:
+By default, the functions in the IO module use the standard input and output. We can pass the `:stderr` as argument to write to the standard error device:
 
 ```iex
-iex> pid = spawn fn -> 1 + 2 end
-#PID<0.44.0>
-iex> Process.alive?(pid)
-false
+iex> IO.puts :stderr, "hello world"
+"hello world"
+:ok
 ```
 
-> Note: you will likely get different process identifiers than the ones we are getting in this guide.
+## 14.2 The File module
 
-We can retrieve the PID of the current process by calling `self/0`:
+The [`File`](/docs/stable/File.html) module contains functions that allows us to open files as IO devices. By default, files are opened in binary mode, which requires developers to use the specific `IO.binread/2` and `IO.binwrite/2` functions from the `IO` module:
 
 ```iex
-iex> self()
-#PID<0.41.0>
-iex> Process.alive?(self())
-true
+iex> {:ok, file} = File.open "hello", [:write]
+{:ok, #PID<0.47.0>}
+iex> IO.binwrite file, "world"
+:ok
+iex> File.close file
+:ok
+iex> File.read "hello"
+{:ok, "world"}
 ```
 
-Processes get much more interesting when we are able to send and receive messages.
+A file can also be opened with `:utf8` encoding which allows the remaining functions in the `IO` module to be used:
 
-## 14.2 send and receive
+```iex
+iex> {:ok, file} = File.open "another", [:write, :utf8]
+{:ok, #PID<0.48.0>}
+```
+
+Besides functions for opening, reading and writing files, the `File` module has many functions that work on the filesystem. Those functions are named after their UNIX equivalents. For example, `File.rm/1` can be used to remove files, `File.mkdir/1` to create directories, `File.mkdir_p/1` creates directories guaranteeing their parents exists and there is even `File.cp_r/2` and `File.rm_rf/2` which copy and remove files and directories recursively.
 
-We can send messages with `send/2` and receive them with `receive/1`:
+You will also notice that functions in the `File` module have two variants, one with `!` (bang) in its name and others without. For example, when we read the "hello" file above, we have used the one without `!`. Let's try some new examples:
 
 ```iex
-iex> send self(), {:hello, "world"}
-{:hello, "world"}
-iex> receive do
-...>   {:hello, msg}  -> msg
-...>   {:world, msg} -> "won't match"
-...> end
+iex> File.read "hello"
+{:ok, "world"}
+iex> File.read! "hello"
 "world"
+iex> File.read "unknwon"
+{:error, :enoent}
+iex> File.read! "unknown"
+** (File.Error) could not read file unknown: no such file or directory
 ```
 
-When a message is sent to a process, the message is stored in the process mailbox. The `receive/2` block goes through the current process mailbox searching for a message that matches any of the given patterns. `receive/1` supports many clauses, like `case/2`, as well as guards in the clauses.
+Notice that when the file does not exist, the version with `!` raises an error. That said, the version without `!` is preferred when you want to handle different outcomes with pattern matching. However, if you expect the file to be there, the bang variation is more useful as it raises a meaningful error message. That said, never write:
 
-If there is no message in the mailbox matching any of the patterns, the current process will wait until a matching message arrives. A timeout can also be specified:
+```elixir
+{:ok, body} = File.read(file)
+```
 
-```iex
-iex> receive do
-...>   {:hello, msg}  -> msg
-...> after
-...>   1_000 -> "nothing after 1s"
-...> end
-"nothing after 1s"
+Instead write:
+
+```elixir
+case File.read(file) do
+  {:ok, body} -> # handle ok
+  {:error, r} -> # handle error
+end
 ```
 
-A timeout of 0 can be given when you already expect the message to be in the mailbox.
+or
 
-Let's put all together and send messages in between processes:
+```elixir
+File.read!(file)
+```
+
+## 14.3 The Path module
+
+The majority of the functions in the File module expects paths as arguments. Most commonly, those paths will be binaries and they can be manipulated with the [`Path`](/docs/stable/Path.html) module:
 
 ```iex
-iex> parent = self()
-#PID<0.41.0>
-iex> spawn fn -> send(parent, {:hello, self()}) end
-#PID<0.48.0>
-iex> receive do
-...>   {:hello, pid} -> "Got hello from #{inspect pid}"
-...> end
-"Got hello from #PID<0.48.0>"
+iex> Path.join("foo", "bar")
+"foo/bar"
+iex> Path.expand("~/hello")
+"/Users/jose/hello"
 ```
 
-While in the shell, you may find the helper `flush/0` quite useful. It flushes and prints all the messages in the mailbox.
+With this, we have covered the main modules for doing IO and interacting with the filesystem. However there are some advanced topics to discuss regarding IO but feel free to skip them if you are in a hurry.
+
+## 14.4 Processes and group leaders
+
+You may have noticed that `File.open/2` returned a tuple containing a PID:
 
 ```iex
-iex> send self(), :hello
-:hello
-iex> flush()
-:hello
-:ok
+iex> {:ok, file} = File.open "hello", [:write]
+{:ok, #PID<0.47.0>}
 ```
 
-Before we finish this chapter, let's talk about process links.
+That's because the IO module actually works with processes. When you say `IO.write(pid, binary)`, the IO module will send a message to the process to the desired operation. Let's see what happens if we use our own process:
+
+```iex
+iex> pid = spawn fn ->
+...>  receive do: (msg -> IO.inspect msg)
+...> end
+#PID<0.57.0>
+iex> IO.write(pid, "hello")
+{:io_request, #PID<0.41.0>, #PID<0.57.0>, {:put_chars, :unicode, "hello"}}
+** (ErlangError) erlang error: :terminated
+```
 
-## 14.3 Links
+After `IO.write/2`, we can see the request sent by the IO module printed, which then fails since the IO module expected some kind of result, which we did not supply.
 
-The most common form of spawning in Elixir is actually via `spawn_link/1`. Before we show an example with `spawn_link/1`, let's try to see what happens when a process fail:
+The [`StringIO`](/docs/stable/StringIO.html) module provides an implementation of the IO device messages on top of a string:
 
 ```iex
-iex> spawn fn -> raise "oops" end
-#PID<0.58.0>
+iex> {:ok, pid} = StringIO.start("hello")
+{:ok, #PID<0.43.0>}
+iex> IO.read(pid, 2)
+"he"
 ```
 
-Well... nothing happened. That's because processes are isolated. If we want the failure in one process to propagate to another one, we should link them. This can be done with `spawn_link/1`:
+By modelling IO devices with processes, the Erlang VM allows different nodes in the same network to exchange file processes and read/write files in between nodes. Of all IO devices, there is one that is special to each process, called group leader.
+
+When you write to `:stdio`, you are actually sending a message to the group leader, which writes to `:stdio`:
 
 ```iex
-iex> spawn_link fn -> raise "oops" end
-#PID<0.60.0>
-** (EXIT from #PID<0.60.0>) {RuntimeError[message: "oops"], [{:erlang, :apply, 2, []}]}
+iex> IO.puts :stdio, "hello"
+hello
+:ok
+iex> IO.puts Process.group_leader, "hello"
+hello
+:ok
 ```
 
-When a failure happens in the shell, the shell automatically traps the failure and shows it nicely formatted. In order to understand what would really happen in our code, let's use `spawn_link/1` inside a file and run it:
+The group leader can be configured per process and is used in different situations, for example, when executing code in remote nodes, it guarantees messages printed in the remote node are redirected and printed in the "executor" one.
 
-```iex
-# spawn.exs
-spawn_link fn -> raise "oops" end
+## 14.5 `iodata` and `char_data`
 
-receive do
-  :hello -> "let's wait until the process fails"
-end
+In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
+
+The functions in `IO` and `File` also allow lists to given as arguments. Not only that, they also allow a mixed list of lists, integers and binaries to be given:
+
+```iex
+iex> IO.puts 'hello world'
+hello world
+:ok
+iex> IO.puts ['hello', ?\s, "world"]
+hello world
+:ok
 ```
 
-This time the process failed and brought the parent process down as they are linked. Linking can also be done manually by calling `Process.link/2`. We recommend you to take a look at [the `Process` module](/docs/stable/Process.html) for other functionality provided by processes.
+However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
+
+On the other hand, `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
+
+Although this is a subtle difference, you only need to worry about those details if you intend to pass lists to those functions. Binaries are already represented by the underlying bytes and as such their representation is always raw.
+
+When working with iodata and char data, Elixir provides `iodata_to_binary/1` to convert any `iodata` to binary. The functions `String.from_char_data!/1` and `List.from_char_data!/1` can be used to convert char data into strings or char lists respectively. Unless you are working closely with some devices, you will rarely need to use those functions.
 
-Process and links play an important role when building fault-tolerant systems. In Elixir applications we often link our processes to supervisors which will detect when a process die and start a new process in its place. This is only possible because processes don't share anything by default so there is no way the crash of a process can corrupt the state of another process!
+This finishes our tour on IO devices and IO related functionality. We have learned about four Elixir modules, [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html), [`Path`](/docs/stable/Path.html) and [`StringIO`](/docs/stable/StringIO.html), as well as how the VM uses processes for the underlying IO mechanisms and how to use (char and io) lists for IO operations.
 
-While other languages would require us to catch/handle exceptions, in Elixir we are actually fine with letting process fail because we expect supervisors to properly restart our systems. "Failing fast" is a common philosophy when writing Elixir software!
+In the next chapters, we will explore structs and protocols, before moving to exception handling and other constructs like sigils and comprehensions.
diff --git a/getting_started/15.markdown b/getting_started/15.markdown
index 593188a43..2f8286c3a 100644
--- a/getting_started/15.markdown
+++ b/getting_started/15.markdown
@@ -1,177 +1,99 @@
 ---
 layout: getting_started
-title: 15 IO
+title: 15 Structs
 guide: 15
 ---
 
 # {{ page.title }}
 
-This chapter is a quick introduction to input/output mechanisms in Elixir and related modules, like [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html) and [`Path`](/docs/stable/Path.html).
-
-We have originally sketched this chapter to come much earlier in the getting started guide. However, we noticed the IO system provides a great opportunity to bring some philosophies and curiosities about Elixir and the VM.
-
-## 15.1 The IO module
-
-The `IO` module in Elixir is the main mechanism for reading and writing to the standard io (`:stdio`), standard error (`:stderr`), files and other IO devices. Usage of the module is pretty straight-forward:
+In early chapters, we have learned about maps:
 
 ```iex
-iex> IO.puts "hello world"
-"hello world"
-:ok
-iex> IO.gets "yes or no? "
-yes or no? yes
-"yes\n"
+iex> map = %{a: 1, b: 2}
+%{a: 1, b: 2}
+iex> map[:a]
+1
+iex> %{map | a: 3}
+%{a: 3, b: 2}
 ```
 
-By default, the functions in the IO module use the standard input and output. We can pass the `:stderr` as argument to write to the standard error device:
+Structs are extensions on top of maps that bring default values, compile-time guarantees and polymorphism into Elixir.
 
-```iex
-iex> IO.puts :stderr, "hello world"
-"hello world"
-:ok
-```
-
-## 15.2 The File module
-
-The [`File`](/docs/stable/File.html) module contains functions that allows us to open files as IO devices. By default, files are opened in binary mode, which requires developers to use the specific `IO.binread/2` and `IO.binwrite/2` functions from the `IO` module:
+To define a struct, we just need to call `defstruct/1` inside a module:
 
 ```iex
-iex> {:ok, file} = File.open "hello", [:write]
-{:ok, #PID<0.47.0>}
-iex> IO.binwrite file, "world"
-:ok
-iex> File.close file
-:ok
-iex> File.read "hello"
-{:ok, "world"}
+iex> defmodule User do
+...>   defstruct name: "jose", age: 27
+...> end
+{:module, User,
+ <<70, 79, 82, ...>>, {:__struct__, 0}}
 ```
 
-A file can also be opened with `:utf8` encoding which allows the remaining functions in the `IO` module to be used:
+We can now create "instances" of this struct by using the `%User{}` syntax:
 
 ```iex
-iex> {:ok, file} = File.open "another", [:write, :utf8]
-{:ok, #PID<0.48.0>}
+iex> %User{}
+%User{name: "jose", age: 27}
+iex> %User{name: "eric"}
+%User{name: "eric", age: 27}
+iex> is_map(%User{})
+true
 ```
 
-Besides functions for opening, reading and writing files, the `File` module has many functions that work on the filesystem. Those functions are named after their UNIX equivalents. For example, `File.rm/1` can be used to remove files, `File.mkdir/1` to create directories, `File.mkdir_p/1` creates directories guaranteeing their parents exists and there is even `File.cp_r/2` and `File.rm_rf/2` which copy and remove files and directories recursively.
-
-You will also notice that functions in the `File` module have two variants, one with `!` (bang) in its name and others without. For example, when we read the "hello" file above, we have used the one without `!`. Let's try some new examples:
+Structs give compile-time guarantees that the provided fields exist in the struct:
 
 ```iex
-iex> File.read "hello"
-{:ok, "world"}
-iex> File.read! "hello"
-"world"
-iex> File.read "unknwon"
-{:error, :enoent}
-iex> File.read! "unknown"
-** (File.Error) could not read file unknown: no such file or directory
-```
-
-Notice that when the file does not exist, the version with `!` raises an error. That said, the version without `!` is preferred when you want to handle different outcomes with pattern matching. However, if you expect the file to be there, the bang variation is more useful as it raises a meaningful error message. That said, never write:
-
-```elixir
-{:ok, body} = File.read(file)
-```
-
-Instead write:
-
-```elixir
-case File.read(file) do
-  {:ok, body} -> # handle ok
-  {:error, r} -> # handle error
-end
-```
-
-or
-
-```elixir
-File.read!(file)
+iex> %User{oops: :field}
+** (CompileError) iex:3: unknown key :oops for struct User
 ```
 
-## 15.3 The Path module
-
-The majority of the functions in the File module expects paths as arguments. Most commonly, those paths will be binaries and they can be manipulated with the [`Path`](/docs/stable/Path.html) module:
+When discussing maps, we demonstrated how we can access and update existing fields of a map. The same applies to structs:
 
 ```iex
-iex> Path.join("foo", "bar")
-"foo/bar"
-iex> Path.expand("~/hello")
-"/Users/jose/hello"
+iex> jose = %User{}
+%User{name: "jose", age: 27}
+iex> jose.name
+"jose"
+iex> eric = %{jose | name: "eric"}
+%User{name: "eric", age: 27}
+iex> %{user | oops: :field}
+** (ArgumentError) argument error
 ```
 
-With this, we have covered the main modules for doing IO and interacting with the filesystem. However there are some advanced topics to discuss regarding IO but feel free to skip them if you are in a hurry.
-
-## 15.4 Processes and group leaders
+By using the update syntax, the VM is aware no new keys will be added to the map/struct, allowing the maps to share their structure in memory. In the example above, both `jose` and `eric` share the same key structure in memory.
 
-You may have noticed that `File.open/2` returned a tuple containing a PID:
+Structs can also be used in pattern matching and they guarantee the structs are of the same type:
 
 ```iex
-iex> {:ok, file} = File.open "hello", [:write]
-{:ok, #PID<0.47.0>}
+iex> %User{name: name} = jose
+%User{name: "jose", age: 27}
+iex> name
+"jose"
+iex> %User{} = %{}
+** (MatchError) no match of right hand side value: %{}
 ```
 
-That's because the IO module actually works with processes. When you say `IO.write(pid, binary)`, the IO module will send a message to the process to the desired operation. Let's see what happens if we use our own process:
+Matching works because structs store a field named `__struct__` inside the map:
 
 ```iex
-iex> pid = spawn fn ->
-...>  receive do: (msg -> IO.inspect msg)
-...> end
-#PID<0.57.0>
-iex> IO.write(pid, "hello")
-{:io_request, #PID<0.41.0>, #PID<0.57.0>, {:put_chars, :unicode, "hello"}}
-** (ErlangError) erlang error: :terminated
+iex> jose.__struct__
+User
 ```
 
-After `IO.write/2`, we can see the request sent by the IO module printed, which then fails since the IO module expected some kind of result, which we did not supply.
-
-The [`StringIO`](/docs/stable/StringIO.html) module provides an implementation of the IO device messages on top of a string:
+Overall, a struct is just a bare map with default fields. Notice we say it is a bare map because none of the protocols implemented for maps are available for structs. For example, you can't enumerate nor access a struct:
 
 ```iex
-iex> {:ok, pid} = StringIO.start("hello")
-{:ok, #PID<0.43.0>}
-iex> IO.read(pid, 2)
-"he"
+iex> user = %User{}
+%User{name: "jose", age: 27}
+iex> user[:name]
+** (Protocol.UndefinedError) protocol Access not implemented for %User{age: 27, name: "jose"}
 ```
 
-By modelling IO devices with processes, the Erlang VM allows different nodes in the same network to exchange file processes and read/write files in between nodes. Of all IO devices, there is one that is special to each process, called group leader.
-
-When you write to `:stdio`, you are actually sending a message to the group leader, which writes to `:stdio`:
+A struct also is not a dictionary and therefore can't be used with the `Dict` module:
 
 ```iex
-iex> IO.puts :stdio, "hello"
-hello
-:ok
-iex> IO.puts Process.group_leader, "hello"
-hello
-:ok
+iex> Dict.get(%User{}, :name)
+** (ArgumentError) unsupported dict: %User{name: "jose", age: 27}
 ```
 
-The group leader can be configured per process and is used in different situations, for example, when executing code in remote nodes, it guarantees messages printed in the remote node are redirected and printed in the "executor" one.
-
-## 15.5 `iodata` and `char_data`
-
-In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
-
-The functions in `IO` and `File` also allow lists to given as arguments. Not only that, they also allow a mixed list of lists, integers and binaries to be given:
-
-```iex
-iex> IO.puts 'hello world'
-hello world
-:ok
-iex> IO.puts ['hello', ?\s, "world"]
-hello world
-:ok
-```
-
-However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
-
-On the other hand, `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
-
-Although this is a subtle difference, you only need to worry about those details if you intend to pass lists to those functions. Binaries are already represented by the underlying bytes and as such their representation is always raw.
-
-When working with iodata and char data, Elixir provides `iodata_to_binary/1` to convert any `iodata` to binary. The functions `String.from_char_data!/1` and `List.from_char_data!/1` can be used to convert char data into strings or char lists respectively. Unless you are working closely with some devices, you will rarely need to use those functions.
-
-This finishes our tour on IO devices and IO related functionality. We have learned about four Elixir modules, [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html), [`Path`](/docs/stable/Path.html) and [`StringIO`](/docs/stable/StringIO.html), as well as how the VM uses processes for the underlying IO mechanisms and how to use (char and io) lists for IO operations.
-
-In the next chapters, we will explore structs and protocols, before moving to exception handling and other constructs like sigils and comprehensions.
+We will cover how structs interacts with protocols in the next chapter.
diff --git a/getting_started/16.markdown b/getting_started/16.markdown
index 993230966..fb2fb7cbb 100644
--- a/getting_started/16.markdown
+++ b/getting_started/16.markdown
@@ -1,25 +1,91 @@
 ---
 layout: getting_started
-title: 16 Structs
+title: 16 Protocols
 guide: 16
 ---
 
 # {{ page.title }}
 
-In early chapters, we have learned about maps:
+Protocols are a mechanism to achieve polymorphism in Elixir. Dispatching on a protocol is available to any data type as long as it implements the protocol. Let's see an example.
+
+In Elixir, only `false` and `nil` are treated as false. Everything else evaluates to true. Depending on the application, it may be important to specify a `blank?` protocol that returns a boolean for other data types that should be considered blank. For instance, an empty list or an empty binary could be considered blanks.
+
+We could define this protocol as follows:
+
+```elixir
+defprotocol Blank do
+  @doc "Returns true if data is considered blank/empty"
+  def blank?(data)
+end
+```
+
+The protocol expects a function called `blank?` that receives one argument to be implemented. We can implement this protocol for different Elixir data types as follows:
+
+```elixir
+# Integers are never blank
+defimpl Blank, for: Integer do
+  def blank?(_), do: false
+end
+
+# Just empty list is blank
+defimpl Blank, for: List do
+  def blank?([]), do: true
+  def blank?(_),  do: false
+end
+
+# Just empty map is blank
+defimpl Blank, for: Map do
+  # Keep in mind we could not pattern match on %{} because
+  # it matches on all maps. We can however check if the size
+  # is zero (and size is a fast operation).
+  def blank?(map), do: map_size(map) == 0
+end
+
+# Just the atoms false and nil are blank
+defimpl Blank, for: Atom do
+  def blank?(false), do: true
+  def blank?(nil),   do: true
+  def blank?(_),     do: false
+end
+```
+
+And we would do so for all native data types. The types available are:
+
+* `Atom`
+* `BitString`
+* `Float`
+* `Function`
+* `Integer`
+* `List`
+* `Map`
+* `PID`
+* `Port`
+* `Reference`
+* `Tuple`
+
+Now with the protocol defined and implementations in hand, we can invoke it:
 
 ```iex
-iex> map = %{a: 1, b: 2}
-%{a: 1, b: 2}
-iex> map[:a]
-1
-iex> %{map | a: 3}
-%{a: 3, b: 2}
+iex> Blank.blank?(0)
+false
+iex> Blank.blank?([])
+true
+iex> Blank.blank?([1, 2, 3])
+false
 ```
 
-Structs are extensions on top of maps that bring default values, compile-time guarantees and polymorphism into Elixir.
+Passing a data type that does not implement the protocol raises an error:
 
-To define a struct, we just need to call `defstruct/1` inside a module:
+```iex
+iex> Blank.blank?("hello")
+** (Protocol.UndefinedError) protocol Blank not implemented for "hello"
+```
+
+## 16.1 Protocols and structs
+
+The power of Elixir's extensibility comes when protocols and structs are used together.
+
+In the previous chapter, we have learned that although structs are maps, they do not share protocol implementations with maps. Let's define a `User` struct as in the previous chapter:
 
 ```iex
 iex> defmodule User do
@@ -29,71 +95,102 @@ iex> defmodule User do
  <<70, 79, 82, ...>>, {:__struct__, 0}}
 ```
 
-We can now create "instances" of this struct by using the `%User{}` syntax:
+And then check:
 
 ```iex
-iex> %User{}
-%User{name: "jose", age: 27}
-iex> %User{name: "eric"}
-%User{name: "eric", age: 27}
-iex> is_map(%User{})
+iex> Blank.blank?(%{})
 true
+iex> Blank.blank?(%User{})
+** (Protocol.UndefinedError) protocol Blank not implemented for %User{age: 27, name: "jose"}
 ```
 
-Structs give compile-time guarantees that the provided fields exist in the struct:
+Instead of sharing protocol implementation with maps, structs require their own protocol implementation:
 
-```iex
-iex> %User{oops: :field}
-** (CompileError) iex:3: unknown key :oops for struct User
+```elixir
+defprotocol Blank, for: User do
+  def blank?(_), do: false
+end
+```
+
+If desired you could come up with your own semantics for a user being blank. Not only that, you could use structs to build more robust data types, like queues, and implemented all relevant protocols, like `Enumerable` and possibly `Blank` for such data type.
+
+In many cases though, developers may want to provide a default implementation for structs, as explicitly implementing the protocol for all structs can be tedious. That's when falling back to Any comes in hand.
+
+### 16.2 Falling back to Any
+
+It may be convenient to provide a default implementation for all types. This can be achieved by setting `@fallback_to_any` to `true` in the protocol definition:
+
+```elixir
+defprotocol Blank do
+  @fallback_to_any true
+  def blank?(data)
+end
 ```
 
-When discussing maps, we demonstrated how we can access and update existing fields of a map. The same applies to structs:
+Which can now be implemented as:
+
+```elixir
+defimpl Blank, for: Any do
+  def blank?(_), do: false
+end
+```
+
+Now all data types (including structs) that we have not implemented the `Blank` protocol for will be considered non-blank.
+
+### 16.3 Built-in protocols
+
+Elixir ships with some built-in protocols. In previous chapters, we have discussed the `Enum` module which provides many functions that work with any data structure that implements the `Enumerable` protocol:
 
 ```iex
-iex> jose = %User{}
-%User{name: "jose", age: 27}
-iex> jose.name
-"jose"
-iex> eric = %{jose | name: "eric"}
-%User{name: "eric", age: 27}
-iex> %{user | oops: :field}
-** (ArgumentError) argument error
+iex> Enum.map [1, 2, 3], fn(x) -> x * 2 end
+[2,4,6]
+iex> Enum.reduce 1..3, 0, fn(x, acc) -> x + acc end
+6
 ```
+Another useful example is the `String.Chars` protocol, which specifies how to convert a data structure with characters to a string. It's exposed via the `to_string` function:
 
-By using the update syntax, the VM is aware no new keys will be added to the map/struct, allowing the maps to share their structure in memory. In the example above, both `jose` and `eric` share the same key structure in memory.
+```iex
+iex> to_string :hello
+"hello"
+```
 
-Structs can also be used in pattern matching and they guarantee the structs are of the same type:
+Notice that string interpolation in Elixir calls the `to_string` function:
 
 ```iex
-iex> %User{name: name} = jose
-%User{name: "jose", age: 27}
-iex> name
-"jose"
-iex> %User{} = %{}
-** (MatchError) no match of right hand side value: %{}
+iex> "age: #{25}"
+"age: 25"
 ```
 
-Matching works because structs store a field named `__struct__` inside the map:
+The snippet above only works because numbers implement the `String.Chars` protocol. Passing a tuple, for example, will lead to an error:
 
 ```iex
-iex> jose.__struct__
-User
+iex> tuple = {1, 2, 3}
+{1, 2, 3}
+iex> "tuple: #{tuple}"
+** (Protocol.UndefinedError) protocol String.Chars not implemented for {1, 2, 3}
 ```
 
-Overall, a struct is just a bare map with default fields. Notice we say it is a bare map because none of the protocols implemented for maps are available for structs. For example, you can't enumerate nor access a struct:
+When there is a need to "print" a more complex data structure, one can simply use the `inspect` function, based on the `Inspect` protocol:
 
 ```iex
-iex> user = %User{}
+iex> "tuple: #{inspect tuple}"
+"tuple: {1, 2, 3}"
+```
+
+The `Inspect` protocol is the protocol used to transform any data structure into a readable textual representation. This is what tools like IEx use to print results:
+
+```iex
+iex> {1, 2, 3}
+{1,2,3}
+iex> %User{}
 %User{name: "jose", age: 27}
-iex> user[:name]
-** (Protocol.UndefinedError) protocol Access not implemented for %User{age: 27, name: "jose"}
 ```
 
-A struct also is not a dictionary and therefore can't be used with the `Dict` module:
+Keep in mind that, by convention, whenever the inspected value starts with `#`, it is representing a data structure in non-valid Elixir syntax. This means the inspect protocol is not reversible as information may be lost along the way:
 
 ```iex
-iex> Dict.get(%User{}, :name)
-** (ArgumentError) unsupported dict: %User{name: "jose", age: 27}
+iex> inspect &(&1+2)
+"#Function<6.71889879/1 in :erl_eval.expr/5>"
 ```
 
-We will cover how structs interacts with protocols in the next chapter.
+There are other protocols in Elixir but this covers the most common ones. In the next chapter we will learn a bit more about error handling and exceptions in Elixir.
diff --git a/getting_started/17.markdown b/getting_started/17.markdown
index 6f92e5763..43645b764 100644
--- a/getting_started/17.markdown
+++ b/getting_started/17.markdown
@@ -1,197 +1,8 @@
 ---
 layout: getting_started
-title: 17 Protocols
+title: 17 try, catch and rescue
 guide: 17
 ---
 
 # {{ page.title }}
 
-Protocols are a mechanism to achieve polymorphism in Elixir. Dispatching on a protocol is available to any data type as long as it implements the protocol. Let's see an example.
-
-In Elixir, only `false` and `nil` are treated as false. Everything else evaluates to true. Depending on the application, it may be important to specify a `blank?` protocol that returns a boolean for other data types that should be considered blank. For instance, an empty list or an empty binary could be considered blanks.
-
-We could define this protocol as follows:
-
-```elixir
-defprotocol Blank do
-  @doc "Returns true if data is considered blank/empty"
-  def blank?(data)
-end
-```
-
-The protocol expects a function called `blank?` that receives one argument to be implemented. We can implement this protocol for different Elixir data types as follows:
-
-```elixir
-# Integers are never blank
-defimpl Blank, for: Integer do
-  def blank?(_), do: false
-end
-
-# Just empty list is blank
-defimpl Blank, for: List do
-  def blank?([]), do: true
-  def blank?(_),  do: false
-end
-
-# Just empty map is blank
-defimpl Blank, for: Map do
-  # Keep in mind we could not pattern match on %{} because
-  # it matches on all maps. We can however check if the size
-  # is zero (and size is a fast operation).
-  def blank?(map), do: map_size(map) == 0
-end
-
-# Just the atoms false and nil are blank
-defimpl Blank, for: Atom do
-  def blank?(false), do: true
-  def blank?(nil),   do: true
-  def blank?(_),     do: false
-end
-```
-
-And we would do so for all native data types. The types available are:
-
-* `Atom`
-* `BitString`
-* `Float`
-* `Function`
-* `Integer`
-* `List`
-* `Map`
-* `PID`
-* `Port`
-* `Reference`
-* `Tuple`
-
-Now with the protocol defined and implementations in hand, we can invoke it:
-
-```iex
-iex> Blank.blank?(0)
-false
-iex> Blank.blank?([])
-true
-iex> Blank.blank?([1, 2, 3])
-false
-```
-
-Passing a data type that does not implement the protocol raises an error:
-
-```iex
-iex> Blank.blank?("hello")
-** (Protocol.UndefinedError) protocol Blank not implemented for "hello"
-```
-
-## 17.1 Protocols and structs
-
-The power of Elixir's extensibility comes when protocols and structs are used together.
-
-In the previous chapter, we have learned that although structs are maps, they do not share protocol implementations with maps. Let's define a `User` struct as in the previous chapter:
-
-```iex
-iex> defmodule User do
-...>   defstruct name: "jose", age: 27
-...> end
-{:module, User,
- <<70, 79, 82, ...>>, {:__struct__, 0}}
-```
-
-And then check:
-
-```iex
-iex> Blank.blank?(%{})
-true
-iex> Blank.blank?(%User{})
-** (Protocol.UndefinedError) protocol Blank not implemented for %User{age: 27, name: "jose"}
-```
-
-Instead of sharing protocol implementation with maps, structs require their own protocol implementation:
-
-```elixir
-defprotocol Blank, for: User do
-  def blank?(_), do: false
-end
-```
-
-If desired you could come up with your own semantics for a user being blank. Not only that, you could use structs to build more robust data types, like queues, and implemented all relevant protocols, like `Enumerable` and possibly `Blank` for such data type.
-
-In many cases though, developers may want to provide a default implementation for structs, as explicitly implementing the protocol for all structs can be tedious. That's when falling back to Any comes in hand.
-
-### 17.2 Falling back to Any
-
-It may be convenient to provide a default implementation for all types. This can be achieved by setting `@fallback_to_any` to `true` in the protocol definition:
-
-```elixir
-defprotocol Blank do
-  @fallback_to_any true
-  def blank?(data)
-end
-```
-
-Which can now be implemented as:
-
-```elixir
-defimpl Blank, for: Any do
-  def blank?(_), do: false
-end
-```
-
-Now all data types (including structs) that we have not implemented the `Blank` protocol for will be considered non-blank.
-
-### 17.3 Sample protocols
-
-Elixir ships with some built-in protocols. In a previous chapter, we have discussed the `Enum` module which provides many functions that work with any data structure that implements the `Enumerable` protocol:
-
-```iex
-iex> Enum.map [1, 2, 3], fn(x) -> x * 2 end
-[2,4,6]
-iex> Enum.reduce 1..3, 0, fn(x, acc) -> x + acc end
-6
-```
-
-Another example is the `Inspect` protocol which is used to transform any data structure into a readable textual representation. This is what tools like IEx use to print results:
-
-```iex
-iex> {1, 2, 3}
-{1,2,3}
-iex> %User{}
-%User{name: "jose", age: 27}
-```
-
-Keep in mind that, by convention, whenever the inspected value starts with `#`, it is representing a data structure in non-valid Elixir syntax. This means the inspect protocol is not reversible as information may be lost along the way:
-
-```iex
-iex> inspect &(&1+2)
-"#Function<6.71889879/1 in :erl_eval.expr/5>"
-```
-
-Another useful example is the `String.Chars` protocol, which specifies how to convert a data structure with characters to a string. It's exposed via the `to_string` function:
-
-```iex
-iex> to_string :hello
-"hello"
-```
-
-Notice that string interpolation in Elixir calls the `to_string` function:
-
-```iex
-iex> "age: #{25}"
-"age: 25"
-```
-
-The snippet above only works because numbers implement the `String.Chars` protocol. Passing a tuple, for example, will lead to an error:
-
-```iex
-iex> tuple = {1, 2, 3}
-{1, 2, 3}
-iex> "tuple: #{tuple}"
-** (Protocol.UndefinedError) protocol String.Chars not implemented for {1, 2, 3}
-```
-
-When there is a need to "print" a more complex data structure, one can simply use the `inspect` function, based on the `Inspect` protocol above:
-
-```iex
-iex> "tuple: #{inspect tuple}"
-"tuple: {1, 2, 3}"
-```
-
-There are other protocols in Elixir but this covers the most common ones. In the next chapter we will learn a bit more about error handling and exceptions in Elixir.
diff --git a/getting_started/18.markdown b/getting_started/18.markdown
index 45649c5ba..7d8e0fbc0 100644
--- a/getting_started/18.markdown
+++ b/getting_started/18.markdown
@@ -1,6 +1,6 @@
 ---
 layout: getting_started
-title: 18 try, catch and rescue
+title: 18 Comprehensions
 guide: 18
 ---
 
diff --git a/getting_started/19.markdown b/getting_started/19.markdown
index db2abf221..1ca94cd03 100644
--- a/getting_started/19.markdown
+++ b/getting_started/19.markdown
@@ -1,6 +1,6 @@
 ---
 layout: getting_started
-title: 19 Comprehensions
+title: 19 Sigils
 guide: 19
 ---
 
diff --git a/getting_started/20.markdown b/getting_started/20.markdown
index 440ac3caf..833b7dc33 100644
--- a/getting_started/20.markdown
+++ b/getting_started/20.markdown
@@ -1,6 +1,6 @@
 ---
 layout: getting_started
-title: 20 Sigils
+title: 20 Quote and unquote
 guide: 20
 ---
 
diff --git a/getting_started/8.markdown b/getting_started/8.markdown
index bf4c95997..1d165898a 100644
--- a/getting_started/8.markdown
+++ b/getting_started/8.markdown
@@ -122,7 +122,7 @@ Giving an argument that does not match any of the clauses raises an error.
 
 ## 8.4 Function capturing
 
-Throughout this tutorial, we have been using the notation `name/arity` to refer to functions. It happens this notation can actually be used to retrieve a module function as a function type. Let's start `iex` and run the `math.exs` file defined above:
+Throughout this tutorial, we have been using the notation `name/arity` to refer to functions. It happens this notation can actually be used to retrieve a named function as a function type. Let's start `iex` and run the `math.exs` file defined above:
 
     $ iex math.exs
 
@@ -146,7 +146,7 @@ iex> (&is_function/1).(fun)
 true
 ```
 
-Note the capture syntax can also be used as a shortcut for defining functions:
+Note the capture syntax can also be used as a shortcut for creating functions:
 
 ```iex
 iex> fun = &(&1 + 1)
@@ -155,6 +155,95 @@ iex> fun.(1)
 2
 ```
 
-The `&1` represents the first argument passed into the function. The syntax above is useful for short function definitions. You can read more about the capture operator `&` in [the `Kernel.SpecialForms` documentation](/docs/stable/Kernel.SpecialForms.html).
+The `&1` represents the first argument passed into the function. `&(&1+1)` above is exactly the same as `fn x -> x + 1 end`. The syntax above is useful for short function definitions. You can read more about the capture operator `&` in [the `Kernel.SpecialForms` documentation](/docs/stable/Kernel.SpecialForms.html).
 
-This finishes our short introduction to modules. In the next chapters, we will learn how to define default arguments, how to use functions for recursion, explore Elixir lexical directives that can be used for importing functions from other modules, as well as module attributes.
+## 8.5 Default arguments
+
+Named functions in Elixir also support default arguments:
+
+```elixir
+defmodule Concat do
+  def join(a, b, sep \\ " ") do
+    a <> sep <> b
+  end
+end
+
+IO.puts Concat.join("Hello", "world")      #=> Hello world
+IO.puts Concat.join("Hello", "world", "_") #=> Hello_world
+```
+
+Any expression is allowed to serve as a default value but it won't be evaluated during the function definition; it will simply be stored for later use. Every time the function is invoked and any of its default values have to be used, the expression for that default value will be evaluated:
+
+```elixir
+defmodule DefaultTest do
+  def dowork(x \\ IO.puts "hello") do
+    x
+  end
+end
+```
+
+```iex
+iex> DefaultTest.dowork 123
+123
+iex> DefaultTest.dowork
+hello
+:ok
+```
+
+If a function with default values has multiple clauses, it is recommended to create a separate clause without an actual body, just for declaring defaults:
+
+```elixir
+defmodule Concat do
+  def join(a, b \\ nil, sep \\ " ")
+
+  def join(a, b, _sep) when nil?(b) do
+    a
+  end
+
+  def join(a, b, sep) do
+    a <> sep <> b
+  end
+end
+
+IO.puts Concat.join("Hello", "world")      #=> Hello world
+IO.puts Concat.join("Hello", "world", "_") #=> Hello_world
+IO.puts Concat.join("Hello")               #=> Hello
+```
+
+When using default values, one must be careful to avoid overlapping function definitions. Consider the following example:
+
+```elixir
+defmodule Concat do
+  def join(a, b) do
+    IO.puts "***First join"
+    a <> b
+  end
+
+  def join(a, b, sep \\ " ") do
+    IO.puts "***Second join"
+    a <> sep <> b
+  end
+end
+```
+
+If we save the code above in a file named "concat.ex" and compile it, Elixir will emit the following warning:
+
+    concat.exs:7: this clause cannot match because a previous clause at line 2 always matches
+
+The compiler is telling us that invoking the `join` function with two arguments will always choose the first definition of `join` whereas the second one will only be invoked when three arguments are passed:
+
+    $ iex concat.exs
+
+```iex
+iex> Concat.join "Hello", "world"
+***First join
+"Helloworld"
+```
+
+```iex
+iex> Concat.join "Hello", "world", "_"
+***Second join
+"Hello_world"
+```
+
+This finishes our short introduction to modules. In the next chapters, we will learn how to use named functions for recursion, explore Elixir lexical directives that can be used for importing functions from other modules, as well as module attributes.
diff --git a/getting_started/9.markdown b/getting_started/9.markdown
index 36ae767b0..6a7c8917c 100644
--- a/getting_started/9.markdown
+++ b/getting_started/9.markdown
@@ -1,94 +1,67 @@
 ---
 layout: getting_started
-title: 9 Default arguments
+title: 9 Recursion
 guide: 9
 ---
 
 # {{ page.title }}
 
-Named functions in Elixir also support default arguments:
+Due to immutability, loops in Elixir (and in functional programming languages) are written differently from conventional imperative languages. For example, in an imperative language, one would write:
 
-```elixir
-defmodule Concat do
-  def join(a, b, sep \\ " ") do
-    a <> sep <> b
-  end
-end
-
-IO.puts Concat.join("Hello", "world")      #=> Hello world
-IO.puts Concat.join("Hello", "world", "_") #=> Hello_world
+```c
+for(i = 0; i < array.length; i++) {
+  array[i] = array[i] * 2
+}
 ```
 
-Any expression is allowed to serve as a default value but it won't be evaluated during the function definition; it will simply be stored for later use. Every time the function is invoked and any of its default values have to be used, the expression for that default value will be evaluated:
+In the example above we are mutating the array which is not possible in Elixir. Instead functional languages rely on recursion: a function is called recursively until a condition is reached. Consider the example below that manually sums all the items in the list:
 
 ```elixir
-defmodule DefaultTest do
-  def dowork(x \\ IO.puts "hello") do
-    x
+defmodule Math do
+  def sum_list([h|t], acc) do
+    sum_list(t, h + acc)
   end
-end
-```
-
-```iex
-iex> DefaultTest.dowork 123
-123
-iex> DefaultTest.dowork
-hello
-:ok
-```
-
-If a function with default values has multiple clauses, it is recommended to create a separate clause without an actual body, just for declaring defaults:
-
-```elixir
-defmodule Concat do
-  def join(a, b \\ nil, sep \\ " ")
 
-  def join(a, b, _sep) when nil?(b) do
-    a
-  end
-
-  def join(a, b, sep) do
-    a <> sep <> b
+  def sum_list([], acc) do
+    acc
   end
 end
 
-IO.puts Concat.join("Hello", "world")      #=> Hello world
-IO.puts Concat.join("Hello", "world", "_") #=> Hello_world
-IO.puts Concat.join("Hello")               #=> Hello
+Math.sum_list([1, 2, 3], 0) #=> 6
 ```
 
-When using default values, one must be careful to avoid overlapping function definitions. Consider the following example:
+In the example above, we invoke `sum_list` giving a list `[1,2,3]` and the initial value `0` as arguments. When a function has many clauses, we will try each clause until we find one that matches according to the pattern matching rules. In this case, the list `[1,2,3]` matches against `[h|t]` which assigns `h = 1` and `t = [2,3]` while `acc` is set to `0`.
 
-```elixir
-defmodule Concat do
-  def join(a, b) do
-    IO.puts "***First join"
-    a <> b
-  end
+Then, we add the head of the list to the accumulator `h + acc` and call `sum_list` again, recursively, passing the tail of the list as argument. The tail will once again match `[h|t]` until the list is empty, as seen below:
 
-  def join(a, b, sep \\ " ") do
-    IO.puts "***Second join"
-    a <> sep <> b
-  end
-end
+```elixir
+sum_list [1, 2, 3], 0
+sum_list [2, 3], 1
+sum_list [3], 3
+sum_list [], 6
 ```
 
-If we save the code above in a file named "concat.ex" and compile it, Elixir will emit the following warning:
+When the list is empty, it will match the final clause which returns the final result of `6`. In imperative languages, such implementation would usually fail for large lists because the stack (in which our execution path is kept) would grow until it reaches a limit. Elixir, however, does tail call optimization in which the stack does not grow when a function exits by calling another function.
 
-    concat.exs:7: this clause cannot match because a previous clause at line 2 always matches
+Recursion and tail call optimization are an important part of Elixir and are commonly used to create loops, especially in cases where processes need to wait and respond to messages. However, recursion as above is rarely used to manipulate lists, since [the `Enum` module](/docs/stable/Enum.html) already provides many conveniences for working not only with lists but different kinds of Enumerables. For instance, the example above could be simply written as:
 
-The compiler is telling us that invoking the `join` function with two arguments will always choose the first definition of `join` whereas the second one will only be invoked when three arguments are passed:
+```iex
+iex> Enum.reduce([1, 2, 3], 0, fn(x, acc) -> x + acc end)
+6
+```
 
-    $ iex concat.exs
+Or using the capture syntax:
 
 ```iex
-iex> Concat.join "Hello", "world"
-***First join
-"Helloworld"
+iex> Enum.reduce([1, 2, 3], 0, &+/2)
+6
 ```
 
+Or finally the `sum/1` function:
+
 ```iex
-iex> Concat.join "Hello", "world", "_"
-***Second join
-"Hello_world"
+iex> Enum.sum([1, 2, 3])
+6
 ```
+
+We will learn more about Enumerables in the "Enumerables and streams" chapter.

From 5c013c57707f0a472cdf7128862ac2406f9b4e4a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Mon, 24 Mar 2014 13:04:43 +0100
Subject: [PATCH 067/160] Chapter about try/catch/rescue

---
 getting_started/11.markdown |   2 +-
 getting_started/17.markdown | 167 ++++++++++++++++++++++++++++++++++++
 2 files changed, 168 insertions(+), 1 deletion(-)

diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index 7ef5bccc4..14c77ce9b 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -57,7 +57,7 @@ Returns the version
 
 ```
 
-Elixir promotes the use of markdown with heredocs to write readable documentation:
+Elixir promotes the use of markdown with heredocs to write readable documentation. Heredocs are multiline strings, they start and end with triple quotes, keeping the formatting of the inner text:
 
 ```elixir
 defmodule Math do
diff --git a/getting_started/17.markdown b/getting_started/17.markdown
index 43645b764..f7ee2402f 100644
--- a/getting_started/17.markdown
+++ b/getting_started/17.markdown
@@ -6,3 +6,170 @@ guide: 17
 
 # {{ page.title }}
 
+Elixir has three error mechanisms: errors, throws and exits. In this chapter we will explore each of them and include remarks when each should be used.
+
+## 17.1 Errors
+
+A sample error can be retrieved by trying to add a number into an atom:
+
+```iex
+iex> :foo + 1
+** (ArithmeticError) bad argument in arithmetic expression
+     :erlang.+(:foo, 1)
+```
+
+A runtime error can be raised any time by using the `raise/1` macro:
+
+```iex
+iex> raise "oops"
+** (RuntimeError) oops
+```
+
+Other error can be raised with `raise/2` passing the error name and a list of keyword arguments:
+
+```iex
+iex> raise ArgumentError, message: "invalid argument foo"
+** (ArgumentError) invalid argument foo
+```
+
+You can also define your own errors using the `defexception/2` macro. The most common case is to define an exception with a message field:
+
+```iex
+iex> defexception MyError, message: "default message"
+iex> raise MyError
+** (MyError) default message
+iex> raise MyError, message: "custom message"
+** (MyError) custom message
+```
+
+Exceptions can be rescued by using the `try/rescue` construct:
+
+```iex
+iex> try do
+...>   raise "oops"
+...> rescue
+...>   e in RuntimeError -> e
+...> end
+RuntimeError[message: "oops"]
+```
+
+The example above rescues the runtime error and returns the error itself which is then printed in the `iex` session. In practice Elixir developers rarely use the `try/rescue` construct though. For example, many languages would force you to rescue an error when a file cannot open succcessfully. Elixir instead provides a `File.read/1` function which returns a tuple containing information if the file was open with success or not:
+
+```iex
+iex> File.read "hello"
+{:error, :enoent}
+iex. File.write "hello", "world"
+:ok
+iex> File.read "hello"
+{:ok, "world"}
+````
+
+There is no `try/rescue` here. In case you want to handle multiple outcomes of opening a file, you can simply use pattern matching with `case`:
+
+```iex
+iex> case File.read "hello" do
+...>   {:ok, body} -> IO.puts "got ok"
+...>   {:error, body} -> IO.puts "got error"
+...> end
+```
+
+At the end of the day, it is up to your application to decide if an error while opening a file is exceptional or not. That's why Elixir doesn't impose in exceptions on `File.read/1` and many other functions. Instead we leave it up to the developer to choose the best way to proceed.
+
+For the cases where you do expect a file to exist (and the lack of a file is truly an error) you can simply use `File.read!/1`:
+
+```iex
+iex> File.read! "unknown"
+** (File.Error) could not read file unknown: no such file or directory
+    (elixir) lib/file.ex:305: File.read!/1
+```
+
+In other words, we avoid using `try/rescue` because **we don't use errors for control flow**. In Elixir, we take errors literally: they are reserved to unexpected and/or exceptional situations. In case you actually need flow control constructs, throws must be used. That's what we are going to see next.
+
+## 17.2 Throws
+
+In Elixir, one can throw a value to be caught later. `throw` and `catch` are reserved to situations where it is not possible to retrieve a value unless by using `throw` and `catch`.
+
+Those situations are quite uncommon in practice unless when interfacing with a library that does not provide the proper APIs. For example, let's imagine the `Enum` module did not provide any API for finding a value and we need to find the first number that is a multiple of 13:
+
+```iex
+iex> try do
+...>   Enum.each -50..50, fn(x) ->
+...>     if rem(x, 13) == 0, do: throw(x)
+...>   end
+...>   "Got nothing"
+...> catch
+...>   x -> "Got #{x}"
+...> end
+"Got -39"
+```
+
+However, in practice one can simply use `Enum.find/2`:
+
+```iex
+iex> Enum.find -50..50, &(rem(&1, 13) == 0)
+-39
+```
+
+## 17.3 Exits
+
+Every Elixir code runs inside processes that communicates with each other. When a process dies, it sends an `exit` signal. A process can also die by explicitly sending an exit signal:
+
+```iex
+iex> spawn_link fn -> exit(1) end
+#PID<0.56.0>
+** (EXIT from #PID<0.56.0>) 1
+```
+
+In the example above, the linked process died by sending an `exit` signal with value of 1. The Elixir shell automatically handles those messages and prints them to the terminal.
+
+`exit` can also be "caught" using `try/catch`:
+
+```iex
+iex> try do
+...>   exit "I am exiting"
+...> catch
+...>   :exit, _ -> "not really"
+...> end
+"not really"
+```
+
+Using `try/catch` is already uncommon and using it to catch exits is even more rare.
+
+`exit` signals are an important part of the fault tolerant system provided by the Erlang VM. Processes usually run under supervision trees which are themselves processes that just wait for `exit` signals of the supervised processes. Once an exit signal is received, the supervision strategy kicks in and the supervised process is restarted.
+
+It is exactly this supervision system that makes constructs like `try/catch` and `try/rescue` so uncommon in Elixir. Instead of rescuing a certain error, we'd rather "fail fast" since the supervision tree will guarantee our application will go back to a known initial state after the error.
+
+## 17.4 After
+
+Somtimes it is necessary to use `try/after` to guarantee a resource is cleaned up after some particular action. For example, we can open a file and guarantee it is closed with `try/after` block:
+
+```iex
+iex> {:ok, file} = File.open "sample", [:utf8, :write]
+iex> try do
+...>   IO.write file, "josé"
+...>   raise "oops, something went wrong"
+...> after
+...>   File.close(file)
+...> end
+** (RuntimeError) oops, something went wrong
+```
+
+## 17.5 Variables scope
+
+It is important to bear in mind that variables defined inside `try/catch/rescue/after` blocks do not leak to the outer context. This is because the `try` block may fail and as such the variables may never be bound in the first place. In other words, this code is invalid:
+
+```iex
+iex> try do
+...>   from_try = true
+...> after
+...>   from_after = true
+...> end
+iex> from_try
+** (RuntimeError) undefined function: from_try/0
+iex> from_after
+** (RuntimeError) undefined function: from_after/0
+```
+
+This finishes our introduction to `try`, `catch` and `rescue`. You will find they are used less frequently in Elixir than in other languages although they may be handy in some situations where a library or some particular code is not playing "by the rules".
+
+It is time to talk about some Elixir constructs like comprehensions and sigils.

From 8634ef000f9dcb1b75dced9c013a4a5e5f65c72c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Mon, 24 Mar 2014 22:41:11 +0100
Subject: [PATCH 068/160] Comprehensions chapter

---
 getting_started/18.markdown | 87 +++++++++++++++++++++++++++++++++++++
 1 file changed, 87 insertions(+)

diff --git a/getting_started/18.markdown b/getting_started/18.markdown
index 7d8e0fbc0..545516744 100644
--- a/getting_started/18.markdown
+++ b/getting_started/18.markdown
@@ -5,3 +5,90 @@ guide: 18
 ---
 
 # {{ page.title }}
+
+In Elixir, it is common to loop over Enumerables, often filtering some results, and mapping to another list of values. Comprehensions are syntax sugar for such constructs, grouping those common tasks into the `for` special form.
+
+For example, we can get all the square values of elements in a list as follows:
+
+```iex
+iex> for n <- [1, 2, 3, 4], do: n * n
+[1, 4, 9, 16]
+```
+
+A comprehension is made of three parts: generators, filters and collectables.
+
+## 18.1 Generators and filters
+
+In the expression above, `n <- [1, 2, 3, 4]` is the generator. It is literally generating values to be used in the comprehensions. Any enumerable can be passed in the right-hand side the generator expression:
+
+```iex
+iex> for n <- 1..4, do: n * n
+[1, 4, 9, 16]
+```
+
+Generator expressions also support pattern matching, ignoring all non-matching patterns. Imagine that instead of a range, we have a keyword list where the key is the atom `:good` or `:bad` and we only want to calculate the square of the good values:
+
+```iex
+iex> values = [good: 1, good: 2, bad: 3, good: 4]
+iex> for {:good, n} <- values, do: n * n
+[1, 4, 16]
+```
+
+Alternatively, filters can be used to filter some particular elements out. For example, we can get the square of only odd numbers:
+
+```iex
+iex> require Integer
+iex> for n <- 1..4, Integer.odd?(n), do: n * n
+[1, 9]
+```
+
+A filter will keep all values except `nil` or `false`.
+
+Comprehensions in general provide a much more concise representation than using the equivalent functions from the `Enum` and `Stream` modules. Furthermore, comprehensions also allow multiple generators and filters to be given. Here is an example that receives a list of directories and deletes all files in those directories:
+
+```elixir
+for dir  <- dirs,
+    file <- File.ls!(dir),
+    path = Path.join(dir, file),
+    File.regular?(path) do
+  File.rm!(path)
+end
+```
+
+Keep in mind that variable assignments inside the comprehension, be it in generators, filters or inside the block, are not reflected outside of the comprehension.
+
+## 18.2 Bitstring generators
+
+Bitstring generators are also supported and are very useful when you need to organize bitstring streams. The example below receives a list of pixels from a binary with their respective red, green and blue values and convert them into triplets:
+
+```iex
+iex> pixels = <<213, 45, 132, 64, 76, 32, 76, 0, 0, 234, 32, 15>>
+iex> for <<r::8, g::8, b::8 <- pixels>>, do: {r, g, b}
+[{213,45,132},{64,76,32},{76,0,0},{234,32,15}]
+```
+
+A bitstring generator can be mixed with the "regular" enumerable generators and provide filters as well.
+
+## 18.3 Into
+
+In the examples above, the comprehension was return a list as a result.
+
+However, the result of a comprehension can be inserted into different data structures by passing the `:into` option. For example, we can use bitstring generators with the `:into` option to easily remove all spaces in a string:
+
+```iex
+iex> for <<c <- " hello world ">>, c != ?\s, into: "", do: <<c>>
+"helloworld"
+```
+
+Sets, maps and other dictionaries can also be given with the `:into` option. In general, the `:into` accepts any structure as long as it implements the `Collectable` protocol.
+
+For example, the `IO` module provides streams, that are both `Enumerable` and `Collectable`. You can easily implement an upcase echo terminal using comprehensions:
+
+```iex
+iex> stream = IO.stream(:stdio, :line)
+iex> for line <- stream, into: stream do
+...>   String.upcase(line) <> "\n"
+...> end
+```
+
+Now type any string into the terminal and you will see the same value will be printed in upcase. Unfortunately, this example also got your shell stuck in the comprehension, so you will need to hit `Ctrl+C` twice to get out of it. :)

From 1af3c2beb98c2e9516daf24350ac6596c5d2043c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Tue, 25 Mar 2014 11:32:28 +0100
Subject: [PATCH 069/160] Add sigils chapter

---
 getting_started/19.markdown | 174 ++++++++++++++++++++++++++++++++++++
 1 file changed, 174 insertions(+)

diff --git a/getting_started/19.markdown b/getting_started/19.markdown
index 1ca94cd03..c2b8d12e8 100644
--- a/getting_started/19.markdown
+++ b/getting_started/19.markdown
@@ -5,3 +5,177 @@ guide: 19
 ---
 
 # {{ page.title }}
+
+We have already learned Elixir provides double-quoted strings and single-quoted char lists. However, this only covers the surface of structures that have textual representation in the language. Atoms are, for example, another structure which are mostly created via the `:atom` representation.
+
+One of Elixir's goals is extensibility: developers should be able to extend the language to particular domains. Computer science has become such a wide field that it is impossible for a language to tackle many fields as part of its core. Our best bet is to rather make the language extensible, so developers, companies and communities can extend the language to their relevant domains.
+
+In the chapter, we are going to explore sigils, which are one of the mechanisms provided by the language for working with textual representations.
+
+## 19.1 Regular expressions
+
+Sigils start with the tilde (`~`) character which is followed by a letter and then a separator. The most common sigil in Elixir is `~r` for [regular expressions](https://en.wikipedia.org/wiki/Regular_Expressions):
+
+```iex
+# A regular expression that returns true if the text has foo or bar
+iex> regex = ~r/foo|bar/
+~r/foo|bar/
+iex> "foo" =~ regex
+true
+iex> "bat" =~ regex
+false
+```
+
+Elixir provides Perl-compatible regular expressions (regexes), as provided by the [PCRE](http://www.pcre.org/) library. Regexes also support modifiers. For example, the `i` modifier makes a regular expression case insensitive:
+
+```iex
+iex> "HELLO" =~ ~r/hello/
+false
+iex> "HELLO" =~ ~r/hello/i
+true
+```
+
+Check out the [`Regex` module](/docs/stable/Regex.html) for more information on other modifiers and the supported operations with regular expressions.
+
+So far, all examples have used `/` to delimit a regular expression. However sigils support 8 different separators:
+
+```
+~r/hello/
+~r|hello|
+~r"hello"
+~r'hello'
+~r(hello)
+~r[hello]
+~r{hello}
+~r<hello>
+```
+
+The reasoning in supporting different operators is that different separators can be more convenient to different sigils. For example, using parentheses for regular expressions may be a confusing choice as they can get mixed with the parentheses inside the regex. However, parentheses can be handy for for other sigils, as we will see in the next section.
+
+## 19.2 Strings, char lists and words sigils
+
+Besides regular expressions, Elixir ships with three other sigils.
+
+The `~s` sigil is used to generate strings, similar to double quotes:
+
+```iex
+iex> ~s(this is a string with "quotes")
+"this is a string with \"quotes\""
+```
+
+While `~c` is used to generate char lists:
+
+```iex
+iex> ~c(this is a string with "quotes")
+'this is a string with "quotes"'
+```
+
+The `~w` sigil is used to generate a list of words separated by white space:
+
+```iex
+iex> ~w(foo bar bat)
+["foo", "bar", "bat"]
+```
+
+The `~w` sigil also accepts the `c`, `s` and `a` modifiers to choose the format of the result:
+
+```iex
+iex> ~w(foo bar bat)a
+[:foo, :bar, :bat]
+```
+
+Besides lowercase sigils, Elixir supports uppercase sigils. While both `~s` and `~S` will return strings, the first one allows escape codes and interpolation while the second does not:
+
+```elixir
+iex> ~s(String with escape codes \x26 interpolation)
+"String with escape codes & interpolation"
+iex> ~S(String without escape codes and without #{interpolation})
+"String without escape codes and without \#{interpolation}"
+```
+
+The following escape codes applies to strings and char lists:
+
+* `\"` – double quote
+* `\'` – single quote
+* `\\` – single backslash
+* `\a` – bell/alert
+* `\b` – backspace
+* `\d` - delete
+* `\e` - escape
+* `\f` - form feed
+* `\n` – newline
+* `\r` – carriage return
+* `\s` – space
+* `\t` – tab
+* `\v` – vertial tab
+* `\DDD`, `\DD`, `\D` - character with octal representation DDD, DD or D (example: `\377`)
+* `\xDD`	- character with hexadecimal representation DD (example: `\x13`)
+* `\x{D...}` -	character with hexadecimal representation with one or more hexadecimal characters (example: `\x{abc13}`)
+
+Sigils also support heredocs which is when tripe double- or single-quotes are used as separators:
+
+```iex
+iex> ~s"""
+...> this is
+...> a heredoc string
+...> """
+```
+
+The most common case for heredoc sigils is when writing documentation. For example, if you need to write escape characters in your documentation, it can become error prone as we would need to double escape some characters:
+
+```elixir
+@doc """
+Converts double-quotes to single-quotes.
+
+## Examples
+
+    iex> convert("\\\"foo\\\"")
+    "'foo'"
+
+"""
+def convert(...)
+```
+
+By using using `~S`, we can avoid this problem altogether:
+
+```elixir
+@doc ~S"""
+Converts double-quotes to single-quotes.
+
+## Examples
+
+    iex> convert("\"foo\"")
+    "'foo'"
+
+"""
+def convert(...)
+```
+
+## 19.3 Custom sigils
+
+As hinted at the beginning of this chapter, sigils in Elixir are extensible. In fact, the sigil `~r/foo/i` is equivalent to calling the `sigil_r` function with two arguments:
+
+```iex
+iex> sigil_r(<<"foo">>, 'i')
+~r"foo"i
+```
+
+That said, we can access the documentation for the `~r` sigil via the `sigil_r` function:
+
+```iex
+iex> h sigil_r
+...
+```
+
+We can also provide our own sigils by simply implementing the proper function. For example, let's implement the `~i(13)` sigil that returns an integer:
+
+```iex
+iex> defmodule MySigils do
+...>   def sigil_i(binary, []), do: binary_to_integer(binary)
+...> end
+iex> import MySigils
+iex> ~i(13)
+13
+```
+
+Sigils can also be used to do compile-time work when required. For example, regular expressions in Elixir are compiled during compilation time, therefore avoiding doing repetitive work at runtime. However, in order to understand how such works, we need to talk about macros. And that's the direction we will take in the next chapters.

From fccb3173151d8d4fefb8b09b6b5c89b365579b8d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Tue, 25 Mar 2014 14:36:56 +0100
Subject: [PATCH 070/160] Macros and where to go next chapters

---
 _layouts/getting_started.html |   2 +
 getting_started/20.markdown   | 137 +++++++++++++++++++
 getting_started/21.markdown   | 247 ++++++++++++++++++++++++++++++++++
 getting_started/22.markdown   |   6 +
 getting_started/23.markdown   |  40 ++++++
 5 files changed, 432 insertions(+)
 create mode 100644 getting_started/22.markdown
 create mode 100644 getting_started/23.markdown

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index f69e1c474..05621fd31 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -32,6 +32,8 @@ <h3 class="widget-title">Index</h3>
       <li><a class="spec" href="/getting_started/19.html">Sigils</a></li>
       <li><a class="spec" href="/getting_started/20.html">Quote and unquote</a></li>
       <li><a class="spec" href="/getting_started/21.html">Macros</a></li>
+      <li><a class="spec" href="/getting_started/22.html">Domain Specific Languages</a></li>
+      <li><a class="spec" href="/getting_started/23.html">Where to go next</a></li>
     </ol>
   </div>
   <div class="widget">
diff --git a/getting_started/20.markdown b/getting_started/20.markdown
index 833b7dc33..27e009a4b 100644
--- a/getting_started/20.markdown
+++ b/getting_started/20.markdown
@@ -5,3 +5,140 @@ guide: 20
 ---
 
 # {{ page.title }}
+
+An Elixir program can be represented by its own data structures. In this chapter, we will learn how those structures look like and how to compose them. The concepts learned in this chapter are the building blocks for macros, which we are going to take a deeper look at the next chapter.
+
+## 20.1 Quoting
+
+The building block of an Elixir program is a tuple with three elements. For example, the function call `sum(1,2,3)` is represented internally as:
+
+```elixir
+{:sum, [], [1, 2, 3]}
+```
+
+You can get the representation of any expression by using the `quote` macro:
+
+```iex
+iex> quote do: sum(1, 2, 3)
+{:sum, [], [1, 2, 3]}
+```
+
+The first element is the function name, the second is a keyword list containing metadata and the third is the arguments list.
+
+Operators are also represented as such tuples:
+
+```iex
+iex> quote do: 1 + 2
+{:+, [context: Elixir, import: Kernel], [1, 2]}
+```
+
+Even a map is represented as a call to `%{}`:
+
+```iex
+iex> quote do: %{1 => 2}
+{:%{}, [], [{1, 2}]}
+```
+
+Variables are also represented using such triplets, except the last element is an atom, instead of a list:
+
+```iex
+iex> quote do: x
+{ :x, [], Elixir }
+```
+
+When quoting more complex expressions, we can see the code is represented in such tuples, often nested inside each other resembling a tree. Many languages would call those representations the Abstract Syntax Tree (AST). Elixir calls them quoted expressions:
+
+```iex
+iex> quote do: sum(1, 2 + 3, 4)
+{:sum, [], [1, {:+, [context: Elixir, import: Kernel], [2, 3]}, 4]}
+```
+
+Sometimes when working with quoted expressions, it may be useful to get the textual code representation back. This can be done with `Macro.to_string/1`:
+
+```iex
+iex> Macro.to_string(quote do: sum(1, 2 + 3, 4))
+"sum(1, 2 + 3, 4)"
+```
+
+In general, the tuples above follow the following format:
+
+```elixir
+{ tuple | atom, list, list | atom }
+```
+
+* The first element is an atom or another tuple in the same representation;
+* The second element is a keyword list containing information like metadata like numbers and contexts;
+* The third element is either a list of arguments for the function call or an atom. When an atom, it means the tuple represents a variable.
+
+Besides the tuple defined above, there are five Elixir literals that when quoted return themselves (and not a tuple). They are:
+
+```elixir
+:sum         #=> Atoms
+1.0          #=> Numbers
+[1,2]        #=> Lists
+"strings"    #=> Strings
+{key, value} #=> Tuples with two elements
+```
+
+Most of Elixir code has straight-forward translation to its underlying quoted expression. We recommend you to try out different code samples and see what gets out of it. For example, what `String.upcase("foo")` expands to? We have also learned that `if(true, do: this, else: that)` is the same as `if true do this else that end`. How does this affirmation hold with quoted expressions?
+
+## 20.2 Unquoting
+
+Quote is about retrieving the inner representation of some particular chunk of code. However, sometimes it may be necessary to inject some other particular chunk of code inside the representation we want to retrieve.
+
+For example, imagine you have a variable `number` which contains the number you want to inject inside a quoted expression. The number can be injected into the quoted representation by using `unquote`:
+
+```iex
+iex> number = 13
+iex> Macro.to_string(quote do: 11 + unquote(number))
+"11 + 13"
+```
+
+`unquote` can even be used to inject function names:
+
+```iex
+iex> fun = :hello
+iex> Macro.to_string(quote do: unquote(hello)(:world))
+"hello(:world)"
+```
+
+In some cases, it may be necessary to inject many values inside a list. For example, imagine you have a list containing `[1, 2, 6]` and we want to inject `[3, 4, 5]` into it. Using `unquote` won't yield the desired result:
+
+```iex
+iex> inner = [3, 4, 5]
+iex> Macro.to_string(quote do: [1, 2, unquote(inner), 6])
+[1, 2, [3, 4, 5], 6]
+```
+
+That's when `unquote_splicing` becomes handy:
+
+```iex
+iex> inner = [3, 4, 5]
+iex> Macro.to_string(quote do: [1, 2, unquote_splicing(inner), 6])
+[1, 2, 3, 4, 5, 6]
+```
+
+Unquoting is very useful when working with macros. When writing macros, developers are able to receive code chunks and inject them inside other code chunks, being able to transform code or write code that generates code during compilation.
+
+## 20.3 Escaping
+
+As we have seen at the beginning of this chapter, only some values are valid quoted expressions. For example, a map is not a valid quoted expression. Nor a tuple with three elements. However, we have seen before those values *can* be expressed as a quoted expression:
+
+```iex
+iex> quote do: %{1 => 2}
+{:%{}, [], [{1, 2}]}
+```
+
+In some cases, you may need to inject such *values* into *quoted expressions*. To do that, we need to first escape those values into quoted expressions with the help of `Macro.escape/1`:
+
+```iex
+iex> map = %{hello: :world}
+iex> Macro.escape(map)
+{%{}, [], [hello: :world]}
+```
+
+In other words, it is important to make a distinction in between a regular Elixir value (like a list, a map, a process, a reference, etc) and a quoted expression. Some values like integers, atoms and strings have a quoted expression equal to the value itself. Other values like maps needs to be explicitly converted. Finally, some values like functions and references cannot be converted to a quoted expression at all.
+
+Macros receive quoted expressions and must return quoted expressions. However, sometimes during the function of a macro, you may need to work with values and making a distinction in between them may be required.
+
+With this introduction we have laid the ground to finally write out first macro, so let's move to the next chapter.
\ No newline at end of file
diff --git a/getting_started/21.markdown b/getting_started/21.markdown
index 2c42b07da..b72d2eadc 100644
--- a/getting_started/21.markdown
+++ b/getting_started/21.markdown
@@ -5,3 +5,250 @@ guide: 21
 ---
 
 # {{ page.title }}
+
+Macros can be defined in Elixir using `defmacro/2`.
+
+> For this chapter, we will be using files instead of running code samples in IEx. That's because the code samples will spawn multiple lines of code and typing them all in IEx can be counter-productive. You should be able to run the code samples by saving them into a `macros.exs` file and running it with `elixir macros.exs` or `iex macros.exs`.
+
+## 21.1 Our first macro
+
+In order to better understand how macros work, let's create a new module where we are going to implement `unless`, which does the opposite of `if`, as a macro and as a function:
+
+```elixir
+defmodule Unless do
+  def fun_unless(clause, expression) do
+    if(!clause, do: expression)
+  end
+
+  defmacro macro_unless(clause, expression) do
+    quote do
+      if(!unquote(clause), do: unquote(expression))
+    end
+  end
+end
+```
+
+The function receives the arguments and pass them to `if`. However, the macro will receive quoted expressions, as we have learned in the previous chapter, inject them into the quote, finally returning another quoted expression.
+
+Let's start `iex` with the module above:
+
+    $ iex macros.exs
+
+And play with those definitions:
+
+```iex
+iex> require Unless
+iex> Unless.macro_unless true, IO.puts "this should never be printed"
+nil
+iex> Unless.fun_unless true, IO.puts "this should never be printed"
+"this should never be printed"
+nil
+```
+
+Note that in our macro implementation, the sentence was not printed, although it was printed in our function implementation. That's because the arguments to a function call are evaluated before calling the function. However macros do not evaluate the arguments, instead they receive the arguments as quoted expressions which are then transformed into other quoted expressions. In this case, we have rewriten our `unless` macro to become an `if` behind the scenes.
+
+In other words, when invoked as:
+
+```elixir
+Unless.macro_unless true, IO.puts "this should never be printed"
+```
+
+Our `macro_unless` macro received the following:
+
+```elixir
+macro_unless(true, {{:., [], [IO, :puts], [], ["this should never be printed"]}})
+```
+
+And it then return a quoted expression as follows:
+
+```elixir
+{:if, [], [
+  {:!, [], [true]},
+  {{:., [], [IO, :puts], [], ["this should never be printed"]}}]}
+```
+
+We can actually verify this is the case by using `Macro.expand_once/2`:
+
+```iex
+iex> expr = quote do: Unless.macro_unless(true, IO.puts "this should never be printed")
+iex> res  = Macro.expand_once(expr, __ENV__)
+iex> IO.puts Macro.to_string(res)
+if(!true) do
+  IO.puts("this should never be printed")
+end
+:ok
+```
+
+`Macro.expand_once/2` receives a quoted expression and expands it according to the current environment. In this case, it expanded/invoked the `Unless.macro_unless/2` macro and returned its result. We then proceeded to convert the returned quoted expression to a string and print it (we will talk about `__ENV__` still in this chapter).
+
+That's what macros are all about. They are about receiving quoted expressions and transforming them into something else. In fact, `unless/2` in Elixir is implemented as a macro:
+
+```elixir
+defmacro unless(clause, options) do
+  quote do
+    if(!unquote(clause), do: unquote(options))
+  end
+end
+```
+
+Not only `unless/2`, `defmacro/2`, `def/2`, `defprotocol/2` and many constructs used throughout this getting started guide are implemented in pure Elixir, often as a macros. This means that the constructs being used to build the language, can be used by developers to extend the language to the domains they are working on.
+
+We can define any function and macro we want, including ones that override the built-in definitions provided by Elixir. The only exceptions are Elixir special forms which are not implemented in Elixir and therefore cannot be overridden, [the full list of special forms is available in `Kernel.SpecialForms`](/docs/stable/Kernel.SpecialForms.html).
+
+## 21.2 Macros hygiene
+
+Elixir macros have late resolution. This guarantees that a variable defined inside a quote won't conflict with a variable defined in the context where that macro is expanded. For example:
+
+```elixir
+defmodule Hygiene do
+  defmacro no_interference do
+    quote do: a = 1
+  end
+end
+
+defmodule HygieneTest do
+  def go do
+    require Hygiene
+    a = 13
+    Hygiene.no_interference
+    a
+  end
+end
+
+HygieneTest.go
+# => 13
+```
+
+In the example above, even if the macro injects `a = 1`, it does not affect the variable `a` defined by the `go` function. In case the macro wants to explicitly affect the context, it can use `var!`:
+
+```elixir
+defmodule Hygiene do
+  defmacro interference do
+    quote do: var!(a) = 1
+  end
+end
+
+defmodule HygieneTest do
+  def go do
+    require Hygiene
+    a = 13
+    Hygiene.interference
+    a
+  end
+end
+
+HygieneTest.go
+# => 1
+```
+
+Variables hygiene only works because Elixir annotates variables with their context. For example, a variable `x` defined at the line 3 of a module, would be represented as:
+
+    {:x, [line: 3], nil}
+
+However, a quoted variable is represented as:
+
+```elixir
+defmodule Sample do
+  def quoted do
+    quote do: x
+  end
+end
+
+Sample.quoted #=> {:x, [line: 3], Sample}
+```
+
+Notice that the third element in the quoted variable is the atom `Sample`, instead of `nil`, which marks the variable as coming from the `Sample` module. Therefore, Elixir considers those two variables come from different contexts and handle them accordingly.
+
+Elixir provides similar mechanisms for imports and aliases too. This guarantees macros will behave as specified by its source module rather than conflicting with the target module where the macro is expanded.
+
+## 21.3 Compile-time vs. runtime
+
+Macros are expanded at compile-time. That's a very important distinction to make when working with macros and failing to understand this distinction can cause a lot of confusion when working with macros.
+
+In general, code execution in Elixir is done in two steps:
+
+1) All the macros in the code are expanded recursively;
+
+2) The expanded code is compiled to Erlang bytecode and executed
+
+This behavior is important to understand because it affects how we think about our code structure. Consider the following code:
+
+```elixir
+defmodule Sample do
+  case System.get_env("FULL") do
+    "true" ->
+      def full?(), do: true
+    _ ->
+      def full?(), do: false
+  end
+end
+```
+
+The code above will define a function `full?` which will return true or false depending on the value of the environment variable `FULL` at **compilation time**. In order to execute this code, Elixir will first expand all macros. Considering that `defmodule` and `def` are macros, the code will expand to something like:
+
+```elixir
+:elixir_module.store Sample, fn ->
+  case System.get_env("FULL") do
+    "true" ->
+      :elixir_def.store(Foo, :def, :full?, [], true)
+    _ ->
+      :elixir_def.store(Foo, :def, :full?, [], false)
+  end
+end
+```
+
+This code will then be executed, define a module `Sample` and store the appropriate function based on the value of the environment variable `FULL`. We achieve this by using the modules `:elixir_module` and `:elixir_def`, which are Elixir internal modules written in Erlang.
+
+There are two lessons to take away from this example:
+
+1) a macro is always expanded, regardless if it is inside a `case` branch that won't actually match when executed;
+
+2) we cannot invoke a function or macro just after it is defined in a module. For example, consider:
+
+```elixir
+defmodule Sample do
+  def full?, do: true
+  IO.puts full?
+end
+```
+
+  The example above will fail because it translates to:
+
+```elixir
+:elixir_module.store Sample, fn ->
+  :elixir_def.store(Foo, :def, :full?, [], true)
+  IO.puts full?
+end
+```
+
+At the moment the module is being defined, there isn't **yet** a function named `full?` defined in the module, so `IO.puts full?` will cause the compilation to fail.
+
+## 21.4 Private macros
+
+Elixir also supports private macros via `defmacrop`. As private functions, these macros are only available inside the module that defines them, and only at compilation time.
+
+It is important that a macro is defined before its usage. Failing to define a macro before its invocation will raise an error at runtime, since the macro won't be expanded and will be translated to a function call:
+
+```elixir
+iex> defmodule Sample do
+...>  def four, do: two + two
+...>  defmacrop two, do: 2
+...> end
+** (CompileError) iex:2: function two/0 undefined
+```
+
+## 21.5 Write macros responsibly
+
+Macros are a powerful construct and Elixir provides many mechanisms to ensure they are used responsibly:
+
+* Macros are hygienic: by default, variables defined inside the macro are not going to affect the user code. Furthermore, functions calls and aliases available in the macro context are not going to leak into the user context;
+
+* Macros are lexical: it is impossible to inject code or macros globally. Before using a macro, you need to explicitly `require` or `import` the module that defines the macro;
+
+* Macros are explicit: it is impossible to run a macro without explicitly invoking it. For example, some languages allow developers to completely rewrite functions behind the scenes, often via parse transforms or via some reflection mechanisms. In Elixir, a macro must be explicitly invoked in the caller;
+
+* Macros' language is clear: many languages provide syntax shortcuts for `quote` and `unquote`. In Elixir, we preferred to have those explicitly spelled out, in order to clearly delimit the boundaries of a macro definition;
+
+Even if Elixir attempts its best to provide a safe environment, the major responsibility still falls on the developers. That's why the first rule of the macro club is **write macros responsibly**. Macros are harder to write than ordinary Elixir functions, and it's considered to be bad style to use them when they're not necessary. Elixir already provides elegant mechanisms to write your every day code and macros should be saved as last resort.
+
+With those lessons, we finish our discussion about macros. The next (and last) chapter is a brief discussion on DSLs, showing how we can mix macros and module attributes to annotate and extend modules and functions.
diff --git a/getting_started/22.markdown b/getting_started/22.markdown
new file mode 100644
index 000000000..ac20d72a1
--- /dev/null
+++ b/getting_started/22.markdown
@@ -0,0 +1,6 @@
+---
+layout: getting_started
+title: 22 Domain Specific Languages
+guide: 22
+---
+
diff --git a/getting_started/23.markdown b/getting_started/23.markdown
new file mode 100644
index 000000000..19f6052f0
--- /dev/null
+++ b/getting_started/23.markdown
@@ -0,0 +1,40 @@
+---
+layout: getting_started
+title: 23 Where to go next
+guide: 23
+---
+
+# {{ page.title }}
+
+## 23.1 Applications
+
+In order to get your first project started, Elixir ships with a build tool called [`Mix`](/getting_started/mix/1.html). You can get your new project started by simply running:
+
+    mix new path/to/new/project
+
+You can learn more about Mix and other applications that ships with Elixir in the links below:
+
+* [Mix - a build tool for Elixir](/getting_started/mix/1.html)
+* [ExUnit - a unit test framework](/getting_started/ex_unit/1.html)
+
+## 23.2 Community and other resources
+
+On the sidebar, you can find the link to some Elixir books and screencasts. They are plenty of Elixir resources out there, like conference talks, open source projects, and more specific books produced by the community.
+
+Remember that in case of any difficulties, you can always visit the **#elixir-lang** channel on **irc.freenode.net** or send a message to the [mailing list](http://groups.google.com/group/elixir-lang-talk). You can be sure that there will be someone willing to help. And to keep posted on the latest news and announcements, follow the [blog][9] and follow language developments on the [elixir-core mailing list](http://groups.google.com/group/elixir-lang-core).
+
+Don't forget [you can also check the source code of Elixir itself](https://github.com/elixir-lang/elixir), which is mostly written in Elixir (mainly the `lib` directory), or [explore Elixir's documentation](http://elixir-lang.org/docs.html).
+
+## 23.3 A Byte of Erlang
+
+As the main page of this site puts it:
+
+> Elixir is a programming language built on top of the Erlang VM.
+
+Sooner than later, an Elixir developer will want to interface with existing Erlang libraries. Here's a list of online resources that cover Erlang's fundamentals and its more advanced features:
+
+* This [Erlang Syntax: A Crash Course](http://elixir-lang.org/crash-course.html) provides a concise intro to Erlang's syntax. Each code snippet is accompanied by equivalent code in Elixir. This is an opportunity for you to not only get some exposure to the Erlang's syntax but also review some of the things you have learned in the present guide.
+
+* Erlang's official website has a short [tutorial](http://www.erlang.org/course/concurrent_programming.html) with pictures that briefly describe Erlang's primitives for concurrent programming.
+
+* [Learn You Some Erlang for Great Good!](http://learnyousomeerlang.com/) is an excellent introduction to Erlang, its design principles, standard library, best practices and much more. If you are serious about Elixir, you'll want to get a solid understanding of Erlang principles. Once you have read through the crash course mentioned above, you'll be able to safely skip the first couple of chapters in the book that mostly deal with the syntax. When you reach [The Hitchhiker's Guide to Concurrency](http://learnyousomeerlang.com/the-hitchhikers-guide-to-concurrency) chapter, that's where the real fun starts.

From 5aca1b06db08bb6ec42b20510b4ea175516af6b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Tue, 25 Mar 2014 21:53:48 +0100
Subject: [PATCH 071/160] Add the DSL chapter

---
 getting_started/20.markdown |   4 +-
 getting_started/21.markdown |  25 +++++-
 getting_started/22.markdown | 152 ++++++++++++++++++++++++++++++++++++
 getting_started/23.markdown |   6 +-
 4 files changed, 182 insertions(+), 5 deletions(-)

diff --git a/getting_started/20.markdown b/getting_started/20.markdown
index 27e009a4b..dd9d91009 100644
--- a/getting_started/20.markdown
+++ b/getting_started/20.markdown
@@ -141,4 +141,6 @@ In other words, it is important to make a distinction in between a regular Elixi
 
 Macros receive quoted expressions and must return quoted expressions. However, sometimes during the function of a macro, you may need to work with values and making a distinction in between them may be required.
 
-With this introduction we have laid the ground to finally write out first macro, so let's move to the next chapter.
\ No newline at end of file
+You can read more about `quote` and `unquote` in the [`Kernel.SpecialForms` module](/docs/stable/Kernel.SpecialForms.html). Documentation for `Macro.escape/1` and other quoted expressions related functions can be found in the [`Macro` module](/docs/stable/Macro.html).
+
+With this introduction we have laid the ground to finally write out first macro, so let's move to the next chapter.
diff --git a/getting_started/21.markdown b/getting_started/21.markdown
index b72d2eadc..897a7a247 100644
--- a/getting_started/21.markdown
+++ b/getting_started/21.markdown
@@ -223,7 +223,28 @@ end
 
 At the moment the module is being defined, there isn't **yet** a function named `full?` defined in the module, so `IO.puts full?` will cause the compilation to fail.
 
-## 21.4 Private macros
+## 21.4 The environment
+
+When using `Macro.expand_once/2` earlier in this chapter, we have used the special form `__ENV__`.
+
+`__ENV__` returns an instance of `Macro.Env` which contains useful information about the compilation environment. It contains useful information like the current module, file and line, all variables defined in the current scope, as well as imports, requires and so on.
+
+Let's give it a try:
+
+```iex
+iex> __ENV__.module
+nil
+iex> __ENV__.file
+"iex"
+iex> __ENV__.requires
+[IEx.Helpers, Kernel, Kernel.Typespec]
+iex> require Integer
+[IEx.Helpers, Integer, Kernel, Kernel.Typespec]
+```
+
+Many of the functions in the `Macro` module expect an environment. You can read more about them in [the docs for the `Macro` module](/docs/stable/Macro.html) and learn mor about the compilation environment with [`Macro.Env`](/docs/stable/Macro.Env.html).
+
+## 21.5 Private macros
 
 Elixir also supports private macros via `defmacrop`. As private functions, these macros are only available inside the module that defines them, and only at compilation time.
 
@@ -237,7 +258,7 @@ iex> defmodule Sample do
 ** (CompileError) iex:2: function two/0 undefined
 ```
 
-## 21.5 Write macros responsibly
+## 21.6 Write macros responsibly
 
 Macros are a powerful construct and Elixir provides many mechanisms to ensure they are used responsibly:
 
diff --git a/getting_started/22.markdown b/getting_started/22.markdown
index ac20d72a1..fc733c284 100644
--- a/getting_started/22.markdown
+++ b/getting_started/22.markdown
@@ -4,3 +4,155 @@ title: 22 Domain Specific Languages
 guide: 22
 ---
 
+# {{ page.title }}
+
+[Domain Specific Languages](https://en.wikipedia.org/wiki/Domain-specific_language) allows developers to specialize their application to a particular domain. There are many language features that come together to aid developers to write Domain Specific Languages and in this chapter we will focus on just one of them.
+
+In particular, we will focus on how macros and module attributes can be used together to create domain specific modules, that are focused on solving one particular example. To showcase our implementation, we will write a very simple test case implementation.
+
+The goal is to build a module named `TestCase` that allows us to write the following:
+
+```elixir
+defmodule MyTest do
+  use TestCase
+
+  test "arithmetic operations" do
+    4 = 2 + 2
+  end
+
+  test "list operations" do
+    [1, 2, 3] = [1, 2] ++ [3]
+  end
+end
+
+MyTest.run
+```
+
+In the example above, by using `TestCase`, we can define tests using the `test` macro and it automatically defines a function named `run` that will automatically run all tests for us. Our prototype will also simply rely on the match operator (`=`) as a mechanism to do assertions.
+
+## 22.1 The `test` macro
+
+Let's start by defining a module that simply defines and imports the `test` macro when used:
+
+```elixir
+defmodule TestCase do
+  # Callback invoked when by `use`.
+  #
+  # For now it simply returns a quoted expression that
+  # imports the module itself into the user code.
+  @doc false
+  defmacro __using__(_opts) do
+    quote do
+      import TestCase
+    end
+  end
+
+  @doc """
+  Defines a test case with the given description.
+
+  ## Examples
+
+      test "arithmetic operations" do
+        4 = 2 + 2
+      end
+
+  """
+  defmacro test(description, do: block) do
+    function_name = binary_to_atom("test " <> description)
+    quote do
+      def unquote(function_name)(), do: unquote(block)
+    end
+  end
+end
+```
+
+Asuming we defined `TestCase` in a file named `tests.exs`, we can open it up `iex tests.exs` and define our first tests:
+
+```iex
+iex> defmodule MyTest do
+...>   use TestCase
+...>
+...>   test "hello" do
+...>     "hello" = "world"
+...>   end
+...> end
+```
+
+For now we don't have a mechanism to run tests, but we know that a function named "test hello" was defined behind the scenes, so we can invoke it and it should fail:
+
+```iex
+iex> MyTest."test hello"()
+** (MatchError) no match of right hand side value: "world"
+```
+
+## 22.2 Storing information with attributes
+
+In order to finish our `TestCase` implementation, we need to be able to retrieve all defined test cases. One way of doing such is by retrieving the tests at runtime via `__MODULE__.__info__(:functions)` which returns a list of all functions in a given module. However, considering that we may want to store more information with each tests beyond the test name, are more flexible approach is required.
+
+When discussing module attributes in early chapters, we have discussed how they can be used as temporary storage and that's exactly what we will do in this section.
+
+In the `__using__/1` implementation, we will initialize a module attribute named `@tests` to an empty list, then store each defined test in this attribute until we compile into into a `run` function.
+
+Here is the updated code for the `TestCase` module:
+
+```elixir
+defmodule TestCase do
+  @doc false
+  defmacro __using__(_opts) do
+    quote do
+      import TestCase
+
+      # Initialize @tests to an empty list
+      @tests []
+
+      # Invoke TestCase.__before_compile__/1 before the module is compiled
+      @before_compile TestCase
+    end
+  end
+
+  @doc """
+  ...
+  """
+  defmacro test(description, do: block) do
+    function_name = binary_to_atom("test " <> description)
+    quote do
+      # Prepend the newly defined test to the list of tests
+      @tests [unquote(function_name)|@tests]
+      def unquote(function_name)(), do: unquote(block)
+    end
+  end
+
+  # This will be invoked right before the target module is compiled
+  # giving us the perfect opportunity to inject the `run/0` function
+  @doc false
+  defmacro __before_compile__(env) do
+    quote do
+      def run do
+        Enum.each @tests, fn name ->
+          IO.puts "Running #{name}"
+          apply(__MODULE__, name, [])
+        end
+      end
+    end
+  end
+end
+```
+
+By starting a new IEx session, we can now define our tests and run them:
+
+```iex
+iex> defmodule MyTest do
+...>   use TestCase
+...>
+...>   test "hello" do
+...>     "hello" = "world"
+...>   end
+...> end
+iex> MyTest.run
+Running test hello
+** (MatchError) no match of right hand side value: "world"
+```
+
+Although we have glanced over some details, the bulk of how we can create domain specific modules in Elixir is here. Macros allows us to return quoted expressions that are executed in the caller, which in turn we use to transform code and to store relevant information in the target module via module attributes. Finally, with callbacks such as `@before_compile`, we have the perfect opportunity to inject code into the module when its definition is complete.
+
+Besides `@before_compile`, there are other useful module attributes, like `@on_definition` and `@after_compile` and you can more about read them in [the docs for the `Module` module](/docs/stable/Module.html). You can also find useful documentation about macros in the [`Macro` module](/docs/stable/Macro.html) and about the compilation environment in [`Macro.Env`](/docs/stable/Macro.Env.html).
diff --git a/getting_started/23.markdown b/getting_started/23.markdown
index 19f6052f0..6e4df0c6b 100644
--- a/getting_started/23.markdown
+++ b/getting_started/23.markdown
@@ -6,7 +6,9 @@ guide: 23
 
 # {{ page.title }}
 
-## 23.1 Applications
+Eager to learn more? Keep on reading!
+
+## 23.1 Build your first Elixir project
 
 In order to get your first project started, Elixir ships with a build tool called [`Mix`](/getting_started/mix/1.html). You can get your new project started by simply running:
 
@@ -19,7 +21,7 @@ You can learn more about Mix and other applications that ships with Elixir in th
 
 ## 23.2 Community and other resources
 
-On the sidebar, you can find the link to some Elixir books and screencasts. They are plenty of Elixir resources out there, like conference talks, open source projects, and more specific books produced by the community.
+On the sidebar, you can find the link to some Elixir books and screencasts. They are plenty of Elixir resources out there, like conference talks, open source projects, and other learning material produced by the community.
 
 Remember that in case of any difficulties, you can always visit the **#elixir-lang** channel on **irc.freenode.net** or send a message to the [mailing list](http://groups.google.com/group/elixir-lang-talk). You can be sure that there will be someone willing to help. And to keep posted on the latest news and announcements, follow the [blog][9] and follow language developments on the [elixir-core mailing list](http://groups.google.com/group/elixir-lang-core).
 

From 1ebbc543e490a2a3093af1f5e866b410b916e52e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Tue, 25 Mar 2014 22:07:39 +0100
Subject: [PATCH 072/160] Reorganize meta stuff into its own section

---
 _layouts/getting_started.html                 |  18 ++-
 getting_started/11.markdown                   |   2 +-
 getting_started/19.markdown                   |   2 +-
 getting_started/20.markdown                   | 143 +++--------------
 getting_started/23.markdown                   |  42 -----
 getting_started/ex_unit/1.markdown            |   2 +-
 getting_started/meta/1.markdown               | 146 ++++++++++++++++++
 .../{21.markdown => meta/2.markdown}          |  16 +-
 .../{22.markdown => meta/3.markdown}          |   9 +-
 getting_started/mix/1.markdown                |   1 -
 getting_started/mix/2.markdown                |   1 -
 getting_started/mix/3.markdown                |   2 +-
 12 files changed, 194 insertions(+), 190 deletions(-)
 delete mode 100644 getting_started/23.markdown
 create mode 100644 getting_started/meta/1.markdown
 rename getting_started/{21.markdown => meta/2.markdown} (98%)
 rename getting_started/{22.markdown => meta/3.markdown} (97%)

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index 05621fd31..4a80e28e4 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -1,6 +1,5 @@
 ---
 section: getting_started
-total_guides: 21
 ---
 
 {% include top.html %}
@@ -30,10 +29,7 @@ <h3 class="widget-title">Index</h3>
       <li><a class="spec" href="/getting_started/17.html">try, catch and rescue</a></li>
       <li><a class="spec" href="/getting_started/18.html">Comprehensions</a></li>
       <li><a class="spec" href="/getting_started/19.html">Sigils</a></li>
-      <li><a class="spec" href="/getting_started/20.html">Quote and unquote</a></li>
-      <li><a class="spec" href="/getting_started/21.html">Macros</a></li>
-      <li><a class="spec" href="/getting_started/22.html">Domain Specific Languages</a></li>
-      <li><a class="spec" href="/getting_started/23.html">Where to go next</a></li>
+      <li><a class="spec" href="/getting_started/20.html">Where to go next</a></li>
     </ol>
   </div>
   <div class="widget">
@@ -50,6 +46,14 @@ <h3 class="widget-title">ExUnit - a unit test framework</h3>
       <li><a class="spec" href="/getting_started/ex_unit/1.html">Introduction to ExUnit</a></li>
     </ol>
   </div>
+  <div class="widget">
+    <h3 class="widget-title">Meta-programming in Elixir</h3>
+    <ol>
+      <li><a class="spec" href="/getting_started/meta/1.html">Quote and unquote</a></li>
+      <li><a class="spec" href="/getting_started/meta/2.html">Macros</a></li>
+      <li><a class="spec" href="/getting_started/meta/3.html">Domain Specific Languages</a></li>
+    </ol>
+  </div>
 
   {% include learning-resources.html %}
   {% include sponsors.html %}
@@ -66,9 +70,9 @@ <h3 class="widget-title">ExUnit - a unit test framework</h3>
       <a href="{{page.guide | minus:1}}.html" class="previous page-numbers spec">&larr; Previous</a>
     {% endif %}
       <a class="page-numbers spec" href="#container">Top</a>
-    {% if page.guide < page.total_guides %}
+    {% unless page.last %}
       <a href="{{page.guide | plus:1}}.html" class="next page-numbers spec">Next &rarr;</a>
-    {% endif %}
+    {% endunless %}
   </div>
   {% endif %}
 </div><!-- #content -->
diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index 14c77ce9b..3f91e4ee4 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -169,4 +169,4 @@ end
 
 Tags in ExUnit are used to annotate tests. Tags can be later used to filter tests, so you don't run external tests by default unless explicitly desired. Internally, those tags are stored in temporary module attributes, associating each test to their respective tags, so tests with particular tags can be later fetched and filtered by the test framework.
 
-We hope this section shines some light on how Elixir supports meta-programming and how module attributes play an important role when doing so. In the next chapters, we will talk about some common modules in Elixir, like `IO` and `Enum`, before finally going into more advanced topics, like macros.
+We hope this section shines some light on how Elixir supports meta-programming and how module attributes play an important role when doing so. In the next chapters, we will talk about some common modules in Elixir, like `IO` and `Enum`, before finally going into more advanced topics.
diff --git a/getting_started/19.markdown b/getting_started/19.markdown
index c2b8d12e8..364dbb121 100644
--- a/getting_started/19.markdown
+++ b/getting_started/19.markdown
@@ -178,4 +178,4 @@ iex> ~i(13)
 13
 ```
 
-Sigils can also be used to do compile-time work when required. For example, regular expressions in Elixir are compiled during compilation time, therefore avoiding doing repetitive work at runtime. However, in order to understand how such works, we need to talk about macros. And that's the direction we will take in the next chapters.
+Sigils can also be used to do compile-time work with the help of macros. For example, regular expressions in Elixir are compiled during compilation time, therefore skipping the compilation step at runtime. If you have interest on the subject, we recommend you to check to learn more about macros and check how those sigils are implemented in the `Kernel` module.
diff --git a/getting_started/20.markdown b/getting_started/20.markdown
index dd9d91009..1e9aac992 100644
--- a/getting_started/20.markdown
+++ b/getting_started/20.markdown
@@ -1,146 +1,43 @@
 ---
 layout: getting_started
-title: 20 Quote and unquote
+title: 20 Where to go next
 guide: 20
+last: true
 ---
 
 # {{ page.title }}
 
-An Elixir program can be represented by its own data structures. In this chapter, we will learn how those structures look like and how to compose them. The concepts learned in this chapter are the building blocks for macros, which we are going to take a deeper look at the next chapter.
+Eager to learn more? Keep on reading!
 
-## 20.1 Quoting
+## 20.1 Build your first Elixir project
 
-The building block of an Elixir program is a tuple with three elements. For example, the function call `sum(1,2,3)` is represented internally as:
+In order to get your first project started, Elixir ships with a build tool called [`Mix`](/getting_started/mix/1.html). You can get your new project started by simply running:
 
-```elixir
-{:sum, [], [1, 2, 3]}
-```
+    mix new path/to/new/project
 
-You can get the representation of any expression by using the `quote` macro:
+You can learn more about Mix and other applications that ships with Elixir in the links below:
 
-```iex
-iex> quote do: sum(1, 2, 3)
-{:sum, [], [1, 2, 3]}
-```
+* [Mix - a build tool for Elixir](/getting_started/mix/1.html)
+* [ExUnit - a unit test framework](/getting_started/ex_unit/1.html)
 
-The first element is the function name, the second is a keyword list containing metadata and the third is the arguments list.
+## 20.2 Community and other resources
 
-Operators are also represented as such tuples:
+On the sidebar, you can find the link to some Elixir books and screencasts. They are plenty of Elixir resources out there, like conference talks, open source projects, and other learning material produced by the community.
 
-```iex
-iex> quote do: 1 + 2
-{:+, [context: Elixir, import: Kernel], [1, 2]}
-```
+Remember that in case of any difficulties, you can always visit the **#elixir-lang** channel on **irc.freenode.net** or send a message to the [mailing list](http://groups.google.com/group/elixir-lang-talk). You can be sure that there will be someone willing to help. And to keep posted on the latest news and announcements, follow the [blog][9] and follow language developments on the [elixir-core mailing list](http://groups.google.com/group/elixir-lang-core).
 
-Even a map is represented as a call to `%{}`:
+Don't forget [you can also check the source code of Elixir itself](https://github.com/elixir-lang/elixir), which is mostly written in Elixir (mainly the `lib` directory), or [explore Elixir's documentation](http://elixir-lang.org/docs.html).
 
-```iex
-iex> quote do: %{1 => 2}
-{:%{}, [], [{1, 2}]}
-```
+## 20.3 A Byte of Erlang
 
-Variables are also represented using such triplets, except the last element is an atom, instead of a list:
+As the main page of this site puts it:
 
-```iex
-iex> quote do: x
-{ :x, [], Elixir }
-```
+> Elixir is a programming language built on top of the Erlang VM.
 
-When quoting more complex expressions, we can see the code is represented in such tuples, often nested inside each other resembling a tree. Many languages would call those representations the Abstract Syntax Tree (AST). Elixir calls them quoted expressions:
+Sooner than later, an Elixir developer will want to interface with existing Erlang libraries. Here's a list of online resources that cover Erlang's fundamentals and its more advanced features:
 
-```iex
-iex> quote do: sum(1, 2 + 3, 4)
-{:sum, [], [1, {:+, [context: Elixir, import: Kernel], [2, 3]}, 4]}
-```
+* This [Erlang Syntax: A Crash Course](http://elixir-lang.org/crash-course.html) provides a concise intro to Erlang's syntax. Each code snippet is accompanied by equivalent code in Elixir. This is an opportunity for you to not only get some exposure to the Erlang's syntax but also review some of the things you have learned in the present guide.
 
-Sometimes when working with quoted expressions, it may be useful to get the textual code representation back. This can be done with `Macro.to_string/1`:
+* Erlang's official website has a short [tutorial](http://www.erlang.org/course/concurrent_programming.html) with pictures that briefly describe Erlang's primitives for concurrent programming.
 
-```iex
-iex> Macro.to_string(quote do: sum(1, 2 + 3, 4))
-"sum(1, 2 + 3, 4)"
-```
-
-In general, the tuples above follow the following format:
-
-```elixir
-{ tuple | atom, list, list | atom }
-```
-
-* The first element is an atom or another tuple in the same representation;
-* The second element is a keyword list containing information like metadata like numbers and contexts;
-* The third element is either a list of arguments for the function call or an atom. When an atom, it means the tuple represents a variable.
-
-Besides the tuple defined above, there are five Elixir literals that when quoted return themselves (and not a tuple). They are:
-
-```elixir
-:sum         #=> Atoms
-1.0          #=> Numbers
-[1,2]        #=> Lists
-"strings"    #=> Strings
-{key, value} #=> Tuples with two elements
-```
-
-Most of Elixir code has straight-forward translation to its underlying quoted expression. We recommend you to try out different code samples and see what gets out of it. For example, what `String.upcase("foo")` expands to? We have also learned that `if(true, do: this, else: that)` is the same as `if true do this else that end`. How does this affirmation hold with quoted expressions?
-
-## 20.2 Unquoting
-
-Quote is about retrieving the inner representation of some particular chunk of code. However, sometimes it may be necessary to inject some other particular chunk of code inside the representation we want to retrieve.
-
-For example, imagine you have a variable `number` which contains the number you want to inject inside a quoted expression. The number can be injected into the quoted representation by using `unquote`:
-
-```iex
-iex> number = 13
-iex> Macro.to_string(quote do: 11 + unquote(number))
-"11 + 13"
-```
-
-`unquote` can even be used to inject function names:
-
-```iex
-iex> fun = :hello
-iex> Macro.to_string(quote do: unquote(hello)(:world))
-"hello(:world)"
-```
-
-In some cases, it may be necessary to inject many values inside a list. For example, imagine you have a list containing `[1, 2, 6]` and we want to inject `[3, 4, 5]` into it. Using `unquote` won't yield the desired result:
-
-```iex
-iex> inner = [3, 4, 5]
-iex> Macro.to_string(quote do: [1, 2, unquote(inner), 6])
-[1, 2, [3, 4, 5], 6]
-```
-
-That's when `unquote_splicing` becomes handy:
-
-```iex
-iex> inner = [3, 4, 5]
-iex> Macro.to_string(quote do: [1, 2, unquote_splicing(inner), 6])
-[1, 2, 3, 4, 5, 6]
-```
-
-Unquoting is very useful when working with macros. When writing macros, developers are able to receive code chunks and inject them inside other code chunks, being able to transform code or write code that generates code during compilation.
-
-## 20.3 Escaping
-
-As we have seen at the beginning of this chapter, only some values are valid quoted expressions. For example, a map is not a valid quoted expression. Nor a tuple with three elements. However, we have seen before those values *can* be expressed as a quoted expression:
-
-```iex
-iex> quote do: %{1 => 2}
-{:%{}, [], [{1, 2}]}
-```
-
-In some cases, you may need to inject such *values* into *quoted expressions*. To do that, we need to first escape those values into quoted expressions with the help of `Macro.escape/1`:
-
-```iex
-iex> map = %{hello: :world}
-iex> Macro.escape(map)
-{%{}, [], [hello: :world]}
-```
-
-In other words, it is important to make a distinction in between a regular Elixir value (like a list, a map, a process, a reference, etc) and a quoted expression. Some values like integers, atoms and strings have a quoted expression equal to the value itself. Other values like maps needs to be explicitly converted. Finally, some values like functions and references cannot be converted to a quoted expression at all.
-
-Macros receive quoted expressions and must return quoted expressions. However, sometimes during the function of a macro, you may need to work with values and making a distinction in between them may be required.
-
-You can read more about `quote` and `unquote` in the [`Kernel.SpecialForms` module](/docs/stable/Kernel.SpecialForms.html). Documentation for `Macro.escape/1` and other quoted expressions related functions can be found in the [`Macro` module](/docs/stable/Macro.html).
-
-With this introduction we have laid the ground to finally write out first macro, so let's move to the next chapter.
+* [Learn You Some Erlang for Great Good!](http://learnyousomeerlang.com/) is an excellent introduction to Erlang, its design principles, standard library, best practices and much more. If you are serious about Elixir, you'll want to get a solid understanding of Erlang principles. Once you have read through the crash course mentioned above, you'll be able to safely skip the first couple of chapters in the book that mostly deal with the syntax. When you reach [The Hitchhiker's Guide to Concurrency](http://learnyousomeerlang.com/the-hitchhikers-guide-to-concurrency) chapter, that's where the real fun starts.
diff --git a/getting_started/23.markdown b/getting_started/23.markdown
deleted file mode 100644
index 6e4df0c6b..000000000
--- a/getting_started/23.markdown
+++ /dev/null
@@ -1,42 +0,0 @@
----
-layout: getting_started
-title: 23 Where to go next
-guide: 23
----
-
-# {{ page.title }}
-
-Eager to learn more? Keep on reading!
-
-## 23.1 Build your first Elixir project
-
-In order to get your first project started, Elixir ships with a build tool called [`Mix`](/getting_started/mix/1.html). You can get your new project started by simply running:
-
-    mix new path/to/new/project
-
-You can learn more about Mix and other applications that ships with Elixir in the links below:
-
-* [Mix - a build tool for Elixir](/getting_started/mix/1.html)
-* [ExUnit - a unit test framework](/getting_started/ex_unit/1.html)
-
-## 23.2 Community and other resources
-
-On the sidebar, you can find the link to some Elixir books and screencasts. They are plenty of Elixir resources out there, like conference talks, open source projects, and other learning material produced by the community.
-
-Remember that in case of any difficulties, you can always visit the **#elixir-lang** channel on **irc.freenode.net** or send a message to the [mailing list](http://groups.google.com/group/elixir-lang-talk). You can be sure that there will be someone willing to help. And to keep posted on the latest news and announcements, follow the [blog][9] and follow language developments on the [elixir-core mailing list](http://groups.google.com/group/elixir-lang-core).
-
-Don't forget [you can also check the source code of Elixir itself](https://github.com/elixir-lang/elixir), which is mostly written in Elixir (mainly the `lib` directory), or [explore Elixir's documentation](http://elixir-lang.org/docs.html).
-
-## 23.3 A Byte of Erlang
-
-As the main page of this site puts it:
-
-> Elixir is a programming language built on top of the Erlang VM.
-
-Sooner than later, an Elixir developer will want to interface with existing Erlang libraries. Here's a list of online resources that cover Erlang's fundamentals and its more advanced features:
-
-* This [Erlang Syntax: A Crash Course](http://elixir-lang.org/crash-course.html) provides a concise intro to Erlang's syntax. Each code snippet is accompanied by equivalent code in Elixir. This is an opportunity for you to not only get some exposure to the Erlang's syntax but also review some of the things you have learned in the present guide.
-
-* Erlang's official website has a short [tutorial](http://www.erlang.org/course/concurrent_programming.html) with pictures that briefly describe Erlang's primitives for concurrent programming.
-
-* [Learn You Some Erlang for Great Good!](http://learnyousomeerlang.com/) is an excellent introduction to Erlang, its design principles, standard library, best practices and much more. If you are serious about Elixir, you'll want to get a solid understanding of Erlang principles. Once you have read through the crash course mentioned above, you'll be able to safely skip the first couple of chapters in the book that mostly deal with the syntax. When you reach [The Hitchhiker's Guide to Concurrency](http://learnyousomeerlang.com/the-hitchhikers-guide-to-concurrency) chapter, that's where the real fun starts.
diff --git a/getting_started/ex_unit/1.markdown b/getting_started/ex_unit/1.markdown
index 4463ffc2c..2fa563023 100644
--- a/getting_started/ex_unit/1.markdown
+++ b/getting_started/ex_unit/1.markdown
@@ -2,7 +2,7 @@
 layout: getting_started
 title: 1 Introduction to ExUnit
 guide: 1
-total_guides: 1
+last: true
 ---
 
 # {{ page.title }}
diff --git a/getting_started/meta/1.markdown b/getting_started/meta/1.markdown
new file mode 100644
index 000000000..32dffe7d1
--- /dev/null
+++ b/getting_started/meta/1.markdown
@@ -0,0 +1,146 @@
+---
+layout: getting_started
+title: 1 Quote and unquote
+guide: 1
+---
+
+# {{ page.title }}
+
+An Elixir program can be represented by its own data structures. In this chapter, we will learn how those structures look like and how to compose them. The concepts learned in this chapter are the building blocks for macros, which we are going to take a deeper look at the next chapter.
+
+## 1.1 Quoting
+
+The building block of an Elixir program is a tuple with three elements. For example, the function call `sum(1,2,3)` is represented internally as:
+
+```elixir
+{:sum, [], [1, 2, 3]}
+```
+
+You can get the representation of any expression by using the `quote` macro:
+
+```iex
+iex> quote do: sum(1, 2, 3)
+{:sum, [], [1, 2, 3]}
+```
+
+The first element is the function name, the second is a keyword list containing metadata and the third is the arguments list.
+
+Operators are also represented as such tuples:
+
+```iex
+iex> quote do: 1 + 2
+{:+, [context: Elixir, import: Kernel], [1, 2]}
+```
+
+Even a map is represented as a call to `%{}`:
+
+```iex
+iex> quote do: %{1 => 2}
+{:%{}, [], [{1, 2}]}
+```
+
+Variables are also represented using such triplets, except the last element is an atom, instead of a list:
+
+```iex
+iex> quote do: x
+{ :x, [], Elixir }
+```
+
+When quoting more complex expressions, we can see the code is represented in such tuples, often nested inside each other resembling a tree. Many languages would call those representations the Abstract Syntax Tree (AST). Elixir calls them quoted expressions:
+
+```iex
+iex> quote do: sum(1, 2 + 3, 4)
+{:sum, [], [1, {:+, [context: Elixir, import: Kernel], [2, 3]}, 4]}
+```
+
+Sometimes when working with quoted expressions, it may be useful to get the textual code representation back. This can be done with `Macro.to_string/1`:
+
+```iex
+iex> Macro.to_string(quote do: sum(1, 2 + 3, 4))
+"sum(1, 2 + 3, 4)"
+```
+
+In general, the tuples above follow the following format:
+
+```elixir
+{ tuple | atom, list, list | atom }
+```
+
+* The first element is an atom or another tuple in the same representation;
+* The second element is a keyword list containing information like metadata like numbers and contexts;
+* The third element is either a list of arguments for the function call or an atom. When an atom, it means the tuple represents a variable.
+
+Besides the tuple defined above, there are five Elixir literals that when quoted return themselves (and not a tuple). They are:
+
+```elixir
+:sum         #=> Atoms
+1.0          #=> Numbers
+[1,2]        #=> Lists
+"strings"    #=> Strings
+{key, value} #=> Tuples with two elements
+```
+
+Most of Elixir code has straight-forward translation to its underlying quoted expression. We recommend you to try out different code samples and see what gets out of it. For example, what `String.upcase("foo")` expands to? We have also learned that `if(true, do: this, else: that)` is the same as `if true do this else that end`. How does this affirmation hold with quoted expressions?
+
+## 1.2 Unquoting
+
+Quote is about retrieving the inner representation of some particular chunk of code. However, sometimes it may be necessary to inject some other particular chunk of code inside the representation we want to retrieve.
+
+For example, imagine you have a variable `number` which contains the number you want to inject inside a quoted expression. The number can be injected into the quoted representation by using `unquote`:
+
+```iex
+iex> number = 13
+iex> Macro.to_string(quote do: 11 + unquote(number))
+"11 + 13"
+```
+
+`unquote` can even be used to inject function names:
+
+```iex
+iex> fun = :hello
+iex> Macro.to_string(quote do: unquote(hello)(:world))
+"hello(:world)"
+```
+
+In some cases, it may be necessary to inject many values inside a list. For example, imagine you have a list containing `[1, 2, 6]` and we want to inject `[3, 4, 5]` into it. Using `unquote` won't yield the desired result:
+
+```iex
+iex> inner = [3, 4, 5]
+iex> Macro.to_string(quote do: [1, 2, unquote(inner), 6])
+[1, 2, [3, 4, 5], 6]
+```
+
+That's when `unquote_splicing` becomes handy:
+
+```iex
+iex> inner = [3, 4, 5]
+iex> Macro.to_string(quote do: [1, 2, unquote_splicing(inner), 6])
+[1, 2, 3, 4, 5, 6]
+```
+
+Unquoting is very useful when working with macros. When writing macros, developers are able to receive code chunks and inject them inside other code chunks, being able to transform code or write code that generates code during compilation.
+
+## 1.3 Escaping
+
+As we have seen at the beginning of this chapter, only some values are valid quoted expressions. For example, a map is not a valid quoted expression. Nor a tuple with three elements. However, we have seen before those values *can* be expressed as a quoted expression:
+
+```iex
+iex> quote do: %{1 => 2}
+{:%{}, [], [{1, 2}]}
+```
+
+In some cases, you may need to inject such *values* into *quoted expressions*. To do that, we need to first escape those values into quoted expressions with the help of `Macro.escape/1`:
+
+```iex
+iex> map = %{hello: :world}
+iex> Macro.escape(map)
+{:%{}, [], [hello: :world]}
+```
+
+In other words, it is important to make a distinction in between a regular Elixir value (like a list, a map, a process, a reference, etc) and a quoted expression. Some values like integers, atoms and strings have a quoted expression equal to the value itself. Other values like maps needs to be explicitly converted. Finally, some values like functions and references cannot be converted to a quoted expression at all.
+
+Macros receive quoted expressions and must return quoted expressions. However, sometimes during the function of a macro, you may need to work with values and making a distinction in between them may be required.
+
+You can read more about `quote` and `unquote` in the [`Kernel.SpecialForms` module](/docs/stable/Kernel.SpecialForms.html). Documentation for `Macro.escape/1` and other quoted expressions related functions can be found in the [`Macro` module](/docs/stable/Macro.html).
+
+With this introduction we have laid the ground to finally write out first macro, so let's move to the next chapter.
diff --git a/getting_started/21.markdown b/getting_started/meta/2.markdown
similarity index 98%
rename from getting_started/21.markdown
rename to getting_started/meta/2.markdown
index 897a7a247..1c9ebcab2 100644
--- a/getting_started/21.markdown
+++ b/getting_started/meta/2.markdown
@@ -1,7 +1,7 @@
 ---
 layout: getting_started
-title: 21 Macros
-guide: 21
+title: 2 Macros
+guide: 2
 ---
 
 # {{ page.title }}
@@ -10,7 +10,7 @@ Macros can be defined in Elixir using `defmacro/2`.
 
 > For this chapter, we will be using files instead of running code samples in IEx. That's because the code samples will spawn multiple lines of code and typing them all in IEx can be counter-productive. You should be able to run the code samples by saving them into a `macros.exs` file and running it with `elixir macros.exs` or `iex macros.exs`.
 
-## 21.1 Our first macro
+## 2.1 Our first macro
 
 In order to better understand how macros work, let's create a new module where we are going to implement `unless`, which does the opposite of `if`, as a macro and as a function:
 
@@ -95,7 +95,7 @@ Not only `unless/2`, `defmacro/2`, `def/2`, `defprotocol/2` and many constructs
 
 We can define any function and macro we want, including ones that override the built-in definitions provided by Elixir. The only exceptions are Elixir special forms which are not implemented in Elixir and therefore cannot be overridden, [the full list of special forms is available in `Kernel.SpecialForms`](/docs/stable/Kernel.SpecialForms.html).
 
-## 21.2 Macros hygiene
+## 2.2 Macros hygiene
 
 Elixir macros have late resolution. This guarantees that a variable defined inside a quote won't conflict with a variable defined in the context where that macro is expanded. For example:
 
@@ -161,7 +161,7 @@ Notice that the third element in the quoted variable is the atom `Sample`, inste
 
 Elixir provides similar mechanisms for imports and aliases too. This guarantees macros will behave as specified by its source module rather than conflicting with the target module where the macro is expanded.
 
-## 21.3 Compile-time vs. runtime
+## 2.3 Compile-time vs. runtime
 
 Macros are expanded at compile-time. That's a very important distinction to make when working with macros and failing to understand this distinction can cause a lot of confusion when working with macros.
 
@@ -223,7 +223,7 @@ end
 
 At the moment the module is being defined, there isn't **yet** a function named `full?` defined in the module, so `IO.puts full?` will cause the compilation to fail.
 
-## 21.4 The environment
+## 2.4 The environment
 
 When using `Macro.expand_once/2` earlier in this chapter, we have used the special form `__ENV__`.
 
@@ -244,7 +244,7 @@ iex> require Integer
 
 Many of the functions in the `Macro` module expect an environment. You can read more about them in [the docs for the `Macro` module](/docs/stable/Macro.html) and learn mor about the compilation environment with [`Macro.Env`](/docs/stable/Macro.Env.html).
 
-## 21.5 Private macros
+## 2.5 Private macros
 
 Elixir also supports private macros via `defmacrop`. As private functions, these macros are only available inside the module that defines them, and only at compilation time.
 
@@ -258,7 +258,7 @@ iex> defmodule Sample do
 ** (CompileError) iex:2: function two/0 undefined
 ```
 
-## 21.6 Write macros responsibly
+## 2.6 Write macros responsibly
 
 Macros are a powerful construct and Elixir provides many mechanisms to ensure they are used responsibly:
 
diff --git a/getting_started/22.markdown b/getting_started/meta/3.markdown
similarity index 97%
rename from getting_started/22.markdown
rename to getting_started/meta/3.markdown
index fc733c284..de81650e3 100644
--- a/getting_started/22.markdown
+++ b/getting_started/meta/3.markdown
@@ -1,7 +1,8 @@
 ---
 layout: getting_started
-title: 22 Domain Specific Languages
-guide: 22
+title: 3 Domain Specific Languages
+guide: 3
+last: true
 ---
 
 # {{ page.title }}
@@ -30,7 +31,7 @@ MyTest.run
 
 In the example above, by using `TestCase`, we can define tests using the `test` macro and it automatically defines a function named `run` that will automatically run all tests for us. Our prototype will also simply rely on the match operator (`=`) as a mechanism to do assertions.
 
-## 22.1 The `test` macro
+## 3.1 The `test` macro
 
 Let's start by defining a module that simply defines and imports the `test` macro when used:
 
@@ -85,7 +86,7 @@ iex> MyTest."test hello"()
 ** (MatchError) no match of right hand side value: "world"
 ```
 
-## 22.2 Storing information with attributes
+## 3.2 Storing information with attributes
 
 In order to finish our `TestCase` implementation, we need to be able to retrieve all defined test cases. One way of doing such is by retrieving the tests at runtime via `__MODULE__.__info__(:functions)` which returns a list of all functions in a given module. However, considering that we may want to store more information with each tests beyond the test name, are more flexible approach is required.
 
diff --git a/getting_started/mix/1.markdown b/getting_started/mix/1.markdown
index 6652ffe5b..df334c79b 100644
--- a/getting_started/mix/1.markdown
+++ b/getting_started/mix/1.markdown
@@ -2,7 +2,6 @@
 layout: getting_started
 title: 1 Introduction to Mix
 guide: 1
-total_guides: 3
 ---
 
 # {{ page.title }}
diff --git a/getting_started/mix/2.markdown b/getting_started/mix/2.markdown
index e34c1c8dd..fa6feb8d6 100644
--- a/getting_started/mix/2.markdown
+++ b/getting_started/mix/2.markdown
@@ -2,7 +2,6 @@
 layout: getting_started
 title: 2 Building OTP apps with Mix
 guide: 2
-total_guides: 3
 ---
 
 # {{ page.title }}
diff --git a/getting_started/mix/3.markdown b/getting_started/mix/3.markdown
index 61ab6aff9..30cbafa0e 100644
--- a/getting_started/mix/3.markdown
+++ b/getting_started/mix/3.markdown
@@ -2,7 +2,7 @@
 layout: getting_started
 title: 3 Creating custom Mix tasks
 guide: 3
-total_guides: 3
+last: true
 ---
 
 # {{ page.title }}

From ec41f4ccac4aa2e1d7774e6ca745b0c6d9b64754 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Wed, 26 Mar 2014 13:28:20 +0100
Subject: [PATCH 073/160] Add v0.13.0 release blog post

---
 _includes/search.html                         |   2 +-
 ...014-03-26-elixir-v0-13-0-released.markdown | 258 ++++++++++++++++++
 getting_started/18.markdown                   |   4 +-
 3 files changed, 261 insertions(+), 3 deletions(-)
 create mode 100644 _posts/2014-03-26-elixir-v0-13-0-released.markdown

diff --git a/_includes/search.html b/_includes/search.html
index 3bd4fe69d..abc92d1dd 100644
--- a/_includes/search.html
+++ b/_includes/search.html
@@ -1,6 +1,6 @@
 <div class="widget news">
   <h3>
-    News: <a href="/blog/2013/12/15/elixir-v0-12-0-released/">Elixir v0.12.0 released</a>
+    News: <a href="/blog/2014/03/26/elixir-v0-13-0-released/">Elixir v0.13.0 released</a>
   </h3>
 </div>
 
diff --git a/_posts/2014-03-26-elixir-v0-13-0-released.markdown b/_posts/2014-03-26-elixir-v0-13-0-released.markdown
new file mode 100644
index 000000000..e4524b139
--- /dev/null
+++ b/_posts/2014-03-26-elixir-v0-13-0-released.markdown
@@ -0,0 +1,258 @@
+---
+layout: post
+title: Elixir v0.13.0 released
+author: José Valim
+category: Releases
+excerpt: Elixir v0.13.0 comes with the biggest changes to the language since it was first released: maps, structs, comprehensiona and more. But don't worry, many changes will take effect over a series of releases in order to avoid breaking changes
+---
+
+Hello folks!
+
+Elixir v0.13.0 has been released promoting the biggest changes to the language since it was first released. On this blog post, we are going to cover some of those changes and the road to Elixir v1.0. In a nutshell, here is what new:
+
+* Elixir now runs on and requires Erlang R17;
+
+* The [Getting Started guide](http://elixir-lang.org/getting_started/1.html) was rewritten from scratch. The previous guide was comprised of 7 chapters and was about to become 2 years old. The new guide features 20 chapters, exploring the new maps and structs as part of this release, going deeper into topics like IO and File handling, as well as an extra guide, still in development, about [Meta-Programming in Elixir](http://elixir-lang.org/getting_started/meta/1.html);
+
+* With Erlang R17, Elixir also adds support for maps, which are key-value data structures that supports pattern matching. We'll explore maps, their features and limitations in this post;
+
+* Elixir v0.13 also provides structs, an alternative to Elixir records. Structs are more flexible than records, provide faster polymorphic operations, and still provide the same compile-time guarantees many came to love in records;
+
+* Elixir v0.13 provides a new comprehension syntax that not only works with lists, but with any [`Enumerable`](/docs/stable/Enumerable.html). The output of a comprehension is also extensible via the [`Collectable`](/docs/stable/Collectable.html) protocol;
+
+* Mix, Elixir's build tool, has been improved in order to provide better workflows when compiling projects and working with dependencies;
+
+* There are many other changes, like the [StringIO](/docs/stable/StringIO.html), support for [tags and filters in ExUnit](/docs/stable/ExUnit.Case.html) and more. Please check the [CHANGELOG](https://github.com/elixir-lang/elixir/blob/v0.13.0/CHANGELOG.md) for the complete list.
+
+Keep in mind that some of the major changes described here were and will continue to be applied throughout a series of releases to avoid breaking changes. In fact, Elixir v0.13.0 is completely compatible with Elixir v0.12.5 and upgrading should be a clean process.
+
+## Maps
+
+Maps are key-value data structures:
+
+```iex
+iex> map = %{"hello" => :world}
+%{"hello" => :world}
+iex> map["hello"]
+:world
+iex> map[:other]
+nil
+```
+
+Maps do not have a explicit ordering and keys and values can be any term.
+
+Maps can be pattern matched on:
+
+```iex
+iex> %{"hello" => world} = map
+%{"hello" => :world}
+iex> world
+:world
+iex> %{} = map
+%{"hello" => :world}
+iex> %{"other" => value} = map
+** (MatchError) no match of right hand side value
+```
+
+Developers can use the functions in the [`Map` module](/docs/stable/Map.html) to work with maps. For more information on maps and how they compare to other associative data structures in the language, please check the [Maps chapter in our new Getting Started guide](/getting_started/7.html).
+
+Finally, maps also provide special syntax for creating, accessing and updating maps with atom keys:
+
+```iex
+iex> user = %{name: "josé", age: 27}
+%{name: "josé", age: 27}
+iex> user.name
+"josé"
+iex> user = %{user | name: "eric"}
+%{name: "eric", age: 27}
+iex> user.name
+"eric"
+```
+
+Both access and update syntax above expect the given keys to exist. Trying to access or update a key that does not exist raises an error:
+
+```iex
+iex> %{ user | address: [] }
+** (ArgumentError) argument error
+     :maps.update(:address, [], %{})
+```
+
+As we will see, this functionality becomes very useful when discussing structs.
+
+## Structs
+
+Structs are meant to replace Elixir records. Records in Elixir are simply tuples supported by modules which store record metadata:
+
+```elixir
+defrecord User, name: nil, age: 0
+```
+
+Internally, this record is represeted as the following tuple:
+
+```elixir
+# {tag, name, age}
+{User, nil, 0}
+```
+
+Records can also be created and pattern matched on:
+
+```elixir
+iex> user = User[name: "josé"]
+User[name: "josé", age: 0]
+iex> user.name
+"josé"
+iex> User[name: name] = user
+User[name: "josé", age: 0]
+iex> name
+"josé"
+```
+
+However, records came with their own issues. First of all, since records were made of data (the underlying tuple) and a module (functions/behaviour), they were frequently misused as an attempt to write "Object Oriented" code in Elixir, for example:
+
+```elixir
+defrecord User, name: nil, age: 0 do
+  def first_name(self) do
+    self.name |> String.split |> Enum.at(0)
+  end
+end
+
+User["josé valim"].first_name #=> "josé"
+```
+
+Not only that, when used in protocols for polymorphic dispatch, records were often slow because we had to check every tuple if it was an actual record or not.
+
+Since maps are meant to replace many cases of records in Erlang, we saw with the introduction of maps the perfect opportunity to revisit Elixir records as well. In order to understand the reasoning behind structs, let's list the features we got from records:
+
+1. A way to organize data by fields
+2. Efficient in-memory representation and operations
+3. Compile-time structures with compile-time errors
+4. The basic foundation for polymorphism in Elixir
+
+Maps naturally solve issues `1.` and `2.` above. In particular, maps that have same keys share the same key-space in memory. That's why the update operation `%{map | ...}` we have seen above is relevant: if we know we are updating an existing key, the new map created as result of the update operation can share the same key space as the old map. For more details on why Maps are efficient, I would recommend [reading Joe's blog post on the matter](http://joearms.github.io/2014/02/01/big-changes-to-erlang.html).
+
+Structs address features `3.` and `4.` as follows. A struct needs to be explicitly defined via `defstruct`:
+
+```elixir
+defmodule User do
+  defstruct name: nil, age: 0
+end
+```
+
+Now a `User` struct can be created without a need to explicitly list all necessary fields:
+
+```elixir
+iex> user = %User{name: "josé"}
+%User{name: "josé", age: 0}
+```
+
+Trying to create a struct with an unknown key raises an error during compilation:
+
+```elixir
+iex> user = %User{address: []}
+** (CompileError) unknown key :unknown for struct User
+```
+
+Furthermore, every struct has a `__struct__` field which contains the struct name:
+
+```elixir
+iex> user.__struct__
+User
+```
+
+Now, everytime there is a protocol dispatch, the protocol mechanism searches for the `__struct__` tag in order to do a polymorphic dispatch.
+
+It is interesting to note that structs solve both drawbacks we have earlier mentioned regarding records. Structs do not support the Object Oriented style of programming that was possible with records. Furthermore, polymorphic dispatch is now faster and more robust, because polymorphic dispatch only happens for explicitly tagged structs.
+
+For more information on structs, check out the [Structs chapter in the getting started guide](/getting_started/15.html) (you may also want to read the new Protocols chapter after it).
+
+## Maps, structs and the future
+
+With the introduction of maps and structs, some deprecations will be landing on master. First of all, the `ListDict` data structure is being deprecated and phased out. Records are also being deprecated from the language, although it is going to be a longer processes, as many projects and Elixir itself still uses records in many occasions.
+
+Note though, only Elixir records are being deprecated, i.e. records backed by a module. Erlang records, which are basically syntax sugar around tuples, will remain in the language for the cases Elixir developers need to interact with Erlang libraries that provide records. We expect though such cases to be rare, as records will become less common even in Erlang itself. For this reason, the new getting started guide does not even mention records.
+
+Finally, structs are still in active development and new features, like `@derive`, should land in upcoming Elixir releases. For those interested, the [original maps and structs proposal is still availble](https://gist.github.com/josevalim/b30c881df36801611d13).
+
+## Comprehensions
+
+Erlang R17 also introduced recursion to anonymous functions. This feature, while still not available from Elixir, allows Elixir to provide a more flexible and extensible comprehensions syntax.
+
+The most common use case of a comprehensions are list comprehensions. We can get all the square values of elements in a list as follows:
+
+```iex
+iex> for n <- [1, 2, 3, 4], do: n * n
+[1, 4, 9, 16]
+```
+
+We say the `n <- [1, 2, 3, 4]` part is a comprehension generator. In previous Elixir versions, Elixir supported only lists in generators. In Elixir v0.13, any Enumerable is supported:
+
+```iex
+iex> for n <- 1..4, do: n * n
+[1, 4, 9, 16]
+```
+
+As in previous Elixir versions, there is also support for a bitstring generator. In the example below, we receive a stream of RGB pixels as a binary and break it down into triplets:
+
+```iex
+iex> pixels = <<213, 45, 132, 64, 76, 32, 76, 0, 0, 234, 32, 15>>
+iex> for <<r::8, g::8, b::8 <- pixels>>, do: {r, g, b}
+[{213,45,132},{64,76,32},{76,0,0},{234,32,15}]
+```
+
+By default, a comprehension returns a list as a result. However, the result of a comprehension can be inserted into different data structures by passing the `:into` option. For example, we can use bitstring generators with the `:into` option to easily remove all spaces in a string:
+
+```iex
+iex> for <<c <- " hello world ">>, c != ?\s, into: "", do: <<c>>
+"helloworld"
+```
+
+Sets, maps and other dictionaries can also be given with the `:into` option. In general, the `:into` accepts any structure as long as it implements the [`Collectable` protocol](/docs/stable/Collectable.html).
+
+For example, the `IO` module provides streams, that are both `Enumerable` and `Collectable`. You can implement an echo terminal that returns whatever is typed, but in upcase, using comprehensions:
+
+```iex
+iex> stream = IO.stream(:stdio, :line)
+iex> for line <- stream, into: stream do
+...>   String.upcase(line) <> "\n"
+...> end
+```
+
+This makes comprehensions useful not only for working with in-memory collections but also files and other sources. In future releases, we will continue exploring how to make comprehensions more expressive, following the foot steps of many functional programming research on the topic.
+
+## Mix workflows
+
+The last big change we want to discuss in this release are the improvements done to Mix, Elixir's build tool. Mix is an essential tool to Elixir developers, it helps developers to compile their projects, manage their dependencies, run tests and so on. 
+
+In previous releases, Mix was used to download and compile dependencies per environment. That meant the every day workflow was less than ideal: every time a dependency was updated, when swapping in between development and test environments, developers had to fetch the dependencies for each environment in distinct steps. The workflow would be something like:
+
+```
+$ mix deps.get
+$ mix compile
+$ MIX_ENV=test mix deps.get
+$ mix test
+```
+
+In Elixir v0.13, `mix deps.get` only fetches dependencies and it does so accross all environments (unless an `--only` flag is specified). To support this new change of behaviour, dependencies now support the `:only` option:
+
+```elixir
+def deps do
+  [{:ecto, github: "elixir-lang/ecto"},
+   {:hackney, github: "benoitc/hackney", only: [:test]}]
+end
+```
+
+Dependencies are now automatically compiled before you run a command. For example, `mix compile` will automatically compile pending dependencies for the current environment. `mix test` will do the same for test dependencies. In fact, if you pass an external command to Mix, like `mix ecto.migrate`, Mix will compile pending dependencies in case the command exists in any of the to-be-compiled dependencies.
+
+## The next steps
+
+As seen in this announcement, this release dictates many of the developments that will happen in Elixir and its community in the following weeks. All projects are recommended to start moving from records to structs, paving the way for the deprecation of records before 1.0.
+
+The next months will also focus on integrating Elixir more tightly to OTP. During the keynote at Erlang Factory, [Catalyse Change](http://www.youtube.com/watch?v=Djv4C9H9yz4), Dave Thomas and I argued that are many useful patterns, re-implemented everyday by developers, that can make development more productive within the Erlang VM if exposed accordingly.
+
+That said, in the next months we plan to explore how to:
+
+* Integrate applications configuration (provided by OTP) right into Mix;
+* Provide an Elixir logger that knows how to print and format Elixir exceptions and stacktraces;
+* Properly expose the functionality provided by Applications, Supervisors, GenServers and GenEvents and study how they can integrate with Elixir. For example, how to consume events from GenEvent as a [stream of data](/docs/stable/Stream.html)?
+* Study how patterns like tasks and agents can be integrated into the language, often picking up the lessons learned by libraries like [e2](http://e2project.org/erlang.html) and [functionality exposed by OTP itself](http://erlang.org/doc/man/rpc.html);
+
diff --git a/getting_started/18.markdown b/getting_started/18.markdown
index 545516744..d927ecda6 100644
--- a/getting_started/18.markdown
+++ b/getting_started/18.markdown
@@ -71,7 +71,7 @@ A bitstring generator can be mixed with the "regular" enumerable generators and
 
 ## 18.3 Into
 
-In the examples above, the comprehension was return a list as a result.
+In the examples above, the comprehension returned a list as a result.
 
 However, the result of a comprehension can be inserted into different data structures by passing the `:into` option. For example, we can use bitstring generators with the `:into` option to easily remove all spaces in a string:
 
@@ -82,7 +82,7 @@ iex> for <<c <- " hello world ">>, c != ?\s, into: "", do: <<c>>
 
 Sets, maps and other dictionaries can also be given with the `:into` option. In general, the `:into` accepts any structure as long as it implements the `Collectable` protocol.
 
-For example, the `IO` module provides streams, that are both `Enumerable` and `Collectable`. You can easily implement an upcase echo terminal using comprehensions:
+For example, the `IO` module provides streams, that are both `Enumerable` and `Collectable`. You can implement an echo terminal that returns whatever is typed, but in upcase, using comprehensions:
 
 ```iex
 iex> stream = IO.stream(:stdio, :line)

From 78ac826b53acfe7b130f5849a25e1ad5bdc7f90f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Wed, 26 Mar 2014 13:33:18 +0100
Subject: [PATCH 074/160] Improve final notes on v0.13.0 blog post

---
 _posts/2014-03-26-elixir-v0-13-0-released.markdown | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/_posts/2014-03-26-elixir-v0-13-0-released.markdown b/_posts/2014-03-26-elixir-v0-13-0-released.markdown
index e4524b139..02d20fd30 100644
--- a/_posts/2014-03-26-elixir-v0-13-0-released.markdown
+++ b/_posts/2014-03-26-elixir-v0-13-0-released.markdown
@@ -249,10 +249,12 @@ As seen in this announcement, this release dictates many of the developments tha
 
 The next months will also focus on integrating Elixir more tightly to OTP. During the keynote at Erlang Factory, [Catalyse Change](http://www.youtube.com/watch?v=Djv4C9H9yz4), Dave Thomas and I argued that are many useful patterns, re-implemented everyday by developers, that can make development more productive within the Erlang VM if exposed accordingly.
 
-That said, in the next months we plan to explore how to:
+That said, in the next months we plan to:
 
 * Integrate applications configuration (provided by OTP) right into Mix;
 * Provide an Elixir logger that knows how to print and format Elixir exceptions and stacktraces;
 * Properly expose the functionality provided by Applications, Supervisors, GenServers and GenEvents and study how they can integrate with Elixir. For example, how to consume events from GenEvent as a [stream of data](/docs/stable/Stream.html)?
 * Study how patterns like tasks and agents can be integrated into the language, often picking up the lessons learned by libraries like [e2](http://e2project.org/erlang.html) and [functionality exposed by OTP itself](http://erlang.org/doc/man/rpc.html);
+* Rewrite the Mix and ExUnit guides to focus on applications and OTP as a whole, rebranding it to "Building Apps with Mix and OTP";
 
+You can learn more about Elixir in our [Getting Started guide](/getting_started/1.html) and download this release in the [v0.13 announcement](https://github.com/elixir-lang/elixir/releases/tag/v0.13.0).
\ No newline at end of file

From 1df9a4b31ca01cbcfc615acf67ee5832e9d309b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Wed, 26 Mar 2014 16:17:11 +0100
Subject: [PATCH 075/160] Add Elixir Sips link

---
 _posts/2014-03-26-elixir-v0-13-0-released.markdown | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/_posts/2014-03-26-elixir-v0-13-0-released.markdown b/_posts/2014-03-26-elixir-v0-13-0-released.markdown
index 02d20fd30..580c680f6 100644
--- a/_posts/2014-03-26-elixir-v0-13-0-released.markdown
+++ b/_posts/2014-03-26-elixir-v0-13-0-released.markdown
@@ -54,7 +54,9 @@ iex> %{"other" => value} = map
 ** (MatchError) no match of right hand side value
 ```
 
-Developers can use the functions in the [`Map` module](/docs/stable/Map.html) to work with maps. For more information on maps and how they compare to other associative data structures in the language, please check the [Maps chapter in our new Getting Started guide](/getting_started/7.html).
+A map pattern will match any map that has the given keys and values. For example, `%{"hello" => world}` will match any map that has the key `"hello"`. An empty map therefore matches all maps.
+
+Developers can use the functions in the [`Map` module](/docs/stable/Map.html) to work with maps. For more information on maps and how they compare to other associative data structures in the language, please check the [Maps chapter in our new Getting Started guide](/getting_started/7.html). Elixir Sips has also released two episodes that cover maps ([part 1](http://elixirsips.com/episodes/054_maps_part_1.html) and [part 2](http://elixirsips.com/episodes/055_maps_part_2.html)).
 
 Finally, maps also provide special syntax for creating, accessing and updating maps with atom keys:
 

From 9760635c73e53ddf24b28339c2eb733cf3909d81 Mon Sep 17 00:00:00 2001
From: Augie De Blieck Jr <augiedb@gmail.com>
Date: Wed, 26 Mar 2014 14:51:19 -0400
Subject: [PATCH 076/160] Various phrasing changes for grammatical or
 redundancy reasons.

---
 getting_started/4.markdown | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/getting_started/4.markdown b/getting_started/4.markdown
index 61e1c2fa8..db00ec21a 100644
--- a/getting_started/4.markdown
+++ b/getting_started/4.markdown
@@ -78,7 +78,7 @@ iex> {:ok, result} = {:error, :oops}
 ** (MatchError) no match of right hand side value: {:error, :oops}
 ```
 
-We can also pattern match on lists:
+We can pattern match on lists:
 
 ```iex
 iex> [a, b, c] = [1, 2, 3]
@@ -87,7 +87,7 @@ iex> a
 1
 ```
 
-Lists also support matching on its head and tail:
+A list also supports matching on its own head and tail:
 
 ```iex
 iex> [head | tail] = [1, 2, 3]
@@ -105,7 +105,7 @@ iex> [h|t] = []
 ** (MatchError) no match of right hand side value: []
 ```
 
-The `[head | tail]` format is not only used on pattern matching but also for prepending items to a list:
+The `[head | tail]` format is not only used on pattern matching, but also for prepending items to a list:
 
 ```iex
 iex> list = [1, 2, 3]
@@ -149,7 +149,7 @@ iex> {x, x} = {1, 2}
 ** (MatchError) no match of right hand side value: {1, 2}
 ```
 
-In some cases, you don't care about a particular value in a pattern. In those cases, it is a common practice to bind the value to underscore `_`. For example, if only the head of the list matters to us, we can assign the tail to underscore:
+In some cases, you don't care about a particular value in a pattern. It is a common practice to bind those values to the underscore, `_`. For example, if only the head of the list matters to us, we can assign the tail to underscore:
 
 ```iex
 iex> [h | _] = [1, 2, 3]
@@ -158,7 +158,7 @@ iex> h
 1
 ```
 
-The variable `_` in Elixir is special in that it can never be read from. Trying to read from it gives an unbound variable error:
+The variable `_` is special in that it can never be read from. Trying to read from it gives an unbound variable error:
 
 ```iex
 iex> _

From 1e4b3e0b83cb0f5f3291f29c15da53f98ad4f753 Mon Sep 17 00:00:00 2001
From: Augie De Blieck Jr <augiedb@gmail.com>
Date: Wed, 26 Mar 2014 15:26:37 -0400
Subject: [PATCH 077/160] Remove extra semi-colons, shorten a few sentences,
 minor grammatical tweaks.

---
 getting_started/5.markdown | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/getting_started/5.markdown b/getting_started/5.markdown
index b1858a8ed..abc67a51b 100644
--- a/getting_started/5.markdown
+++ b/getting_started/5.markdown
@@ -6,7 +6,7 @@ guide: 5
 
 # {{ page.title }}
 
-In this chapter we will learn about `case`, `cond` and `if` control-flow structures.
+In this chapter, we will learn about `case`, `cond` and `if` control-flow structures.
 
 ## 5.1 case
 
@@ -47,11 +47,11 @@ iex> case {1, 2, 3} do
 
 The first clause above will only match when `x` is positive. The Erlang VM only allows a limited set of expressions in guards:
 
-* comparison operators (`==`, `!=`, `===`, `!==`, `>`, `<`, `<=`, `>=`);
-* boolean operators (`and`, `or`) and negation operators (`not`, `!`);
-* arithmetic operators (`+`, `-`, `*`, `/`);
-* `<>` and `++` as long as the left side is a literal;
-* the `in` operator;
+* comparison operators (`==`, `!=`, `===`, `!==`, `>`, `<`, `<=`, `>=`)
+* boolean operators (`and`, `or`) and negation operators (`not`, `!`)
+* arithmetic operators (`+`, `-`, `*`, `/`)
+* `<>` and `++` as long as the left side is a literal
+* the `in` operator
 * all the following type check functions:
 
     * `is_atom/1`
@@ -184,9 +184,9 @@ iex> unless true do
 nil
 ```
 
-If the condition given to `if/2` returns `false` or `nil`, the body given in between `do/end` is not executed and it simply returns `nil`. The opposite happens with `unless/2`.
+If the condition given to `if/2` returns `false` or `nil`, the body given between `do/end` is not executed and it simply returns `nil`. The opposite happens with `unless/2`.
 
-They also supports `else` blocks:
+They also support `else` blocks:
 
 ```iex
 iex> if nil do
@@ -197,11 +197,11 @@ iex> if nil do
 "This will"
 ```
 
-An interesting note regarding `if/2` and `unless/2` is that they are implemented as macros in the language, they are not keywords (as they would be in many languages). You can check the documentation and the source of `if/2` in [the `Kernel` module docs](/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
+An interesting note regarding `if/2` and `unless/2` is that they are implemented as macros in the language; they are not keywords (as they would be in many languages). You can check the documentation and the source of `if/2` in [the `Kernel` module docs](/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
 
 ### 5.4 `do` blocks
 
-At this point, we have learned 4 control structures, `case`, `cond`, `if` and `unless`, and they were all wrapped in `do`/`end` blocks. It happens we could also write `if` as follows:
+At this point, we have learned four control structures, `case`, `cond`, `if` and `unless`, and they were all wrapped in `do`/`end` blocks. It happens we could also write `if` as follows:
 
 ```iex
 iex> if true, do: 1 + 2
@@ -246,7 +246,7 @@ iex> is_number(if true) do
 ...> end
 ```
 
-Which leads to an undefined function error, since `do` is being passed to the `is_number` function, which is then called with two arguments while `if` is called with only one. Adding explicit parentheses is enough to resolve the ambiguity:
+That leads to an undefined function error.  `do` is being passed to the `is_number` function, which is then called with two arguments while `if` is called with only one. Adding explicit parentheses is enough to resolve the ambiguity:
 
 ```iex
 iex> is_number(if true do
@@ -262,4 +262,6 @@ iex> case 1, do: (x -> "Got #{x}")
 "Got 1"
 ```
 
-Although it is rare to use the keyword syntax with `case` and `cond`, we will see keyword lists play an important role in the language and are quite common in many functions and macros. We will explore them a bit more in a future chapter, now it is time to talk about "Binaries, strings and char lists".
+Although it is rare to use the keyword syntax with `case` and `cond`, we will see keyword lists play an important role in the language. They are quite common in many functions and macros. We will explore them a bit more in a future chapter.  
+
+Now it is time to talk about "Binaries, strings and char lists".

From cde8d508267d19d844a28e2e02f1f107d61b5344 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Wed, 26 Mar 2014 21:04:03 +0100
Subject: [PATCH 078/160] Make it clear R17 and v0.13 are required

---
 getting_started/1.markdown | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/getting_started/1.markdown b/getting_started/1.markdown
index d7d35aad7..820039dfe 100644
--- a/getting_started/1.markdown
+++ b/getting_started/1.markdown
@@ -20,6 +20,8 @@ The only prerequisite for Elixir is Erlang, version 17.0 or later, which can be
 
 For Windows developers, we recommend the precompiled packages. Those on a UNIX platform can probably get Erlang installed via one of the many package management tools.
 
+> Note: Although many package management tools provide Erlang, Elixir requires Erlang 17 which has been released just recently. So have that in mind before picking your Erlang installation.
+
 After Erlang is installed, you should be able to open up the command line (or command prompt) and check the Erlang version by typing `erl`. You will see some information as follows:
 
     Erlang/OTP 17 (erts-6) [64-bit] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]
@@ -30,7 +32,7 @@ After Erlang is up and running, it is time to install Elixir. You can do that vi
 
 ### 1.2 Distributions
 
-This tutorial requires Elixir v0.12.4 or later and it may be available in some distributions:
+This tutorial requires Elixir v0.13 or later and it may be available in some distributions:
 
 * Homebrew for Mac OS X
   * Update your homebrew to latest with `brew update`

From a9242ed12b4ab880bddec991695823ac698b522e Mon Sep 17 00:00:00 2001
From: Augie De Blieck Jr <augiedb@gmail.com>
Date: Wed, 26 Mar 2014 17:00:43 -0400
Subject: [PATCH 079/160] Minor grammatical tweaks, editing for clarity,
 shorten some sentences.

---
 getting_started/6.markdown | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index c6c9b696b..d4a79716b 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -15,15 +15,15 @@ iex> is_binary string
 true
 ```
 
-In this chapter, we will understand what binaries are, how they associate with strings and what a single-quoted value, `'like this'`, means in Elixir.
+In this chapter, we will understand what binaries are, how they associate with strings, and what a single-quoted value, `'like this'`, means in Elixir.
 
 ## 6.1 UTF-8 and Unicode
 
-A string is a UTF-8 encoded binary. In order to understand exactly what we mean by that, we need to understand the difference in between bytes and codepoints.
+A string is a UTF-8 encoded binary. In order to understand exactly what we mean by that, we need to understand the difference between bytes and codepoints.
 
-The Unicode standard assigns codepoints to many of the characters we know. For example, the letter `a` has codepoint `97` while the letter `ł` has codepoint `322`. When writing the string `"hełło"` to disk, we need to convert this codepoint to bytes. Since a byte can represent a number from `0` to `255`, if we adopted a rule that said one byte represents one codepoint, we wouldn't be able to write `"hełło"`, because it uses the codepoint `322`. But of course, given you can actually read `"hełło"` in your screen, it means it is represented *somehow*. That's when encodings come in.
+The Unicode standard assigns codepoints to many of the characters we know. For example, the letter `a` has codepoint `97` while the letter `ł` has codepoint `322`. When writing the string `"hełło"` to disk, we need to convert this codepoint to bytes. Since a byte can represent a number from `0` to `255`, if we adopted a rule that said one byte represents one codepoint, we wouldn't be able to write `"hełło"`, because it uses the codepoint `322`. But of course, given you can actually read `"hełło"` on your screen, it means it is represented *somehow*. That's when encodings come in.
 
-When representing codepoints in bytes, we need to encode them somehow, and Elixir chose the UTF-8 encoding as its main and default encoding. When we say a string is a UTF-8 encoded binary, we mean a string is a bunch of bytes, organized in way to represent certain codepoints, as specified by the UTF-8 encoding.
+When representing codepoints in bytes, we need to encode them somehow. Elixir chose the UTF-8 encoding as its main and default encoding. When we say a string is a UTF-8 encoded binary, we mean a string is a bunch of bytes organized in a way to represent certain codepoints, as specified by the UTF-8 encoding.
 
 Since we have codepoints like `ł` assigned with the number `322`, we actually need more than one byte to represent it. That's why we see a difference when we calculate the `byte_size/1` of a string compared to its `String.length/1`:
 
@@ -52,9 +52,9 @@ iex> String.codepoints("hełło")
 ["h", "e", "ł", "ł", "o"]
 ```
 
-You will see that Elixir has excellent support for working with strings and it also supports many of the Unicode operations. In fact, Elixir passes all the tests showcased in the ["The string type is broken"](http://mortoray.com/2013/11/27/the-string-type-is-broken/) article.
+You will see that Elixir has excellent support for working with strings. It also supports many of the Unicode operations. In fact, Elixir passes all the tests showcased in the ["The string type is broken"](http://mortoray.com/2013/11/27/the-string-type-is-broken/) article.
 
-However, strings are just part of the story. If a string is a binary and we have used a `is_binary/1` function, Elixir probably has an underlying type empowering strings, and that is exactly true. Let's talk about binaries!
+However, strings are just part of the story. If a string is a binary and we have used the `is_binary/1` function, Elixir probably has an underlying type empowering strings, and that is exactly true. Let's talk about binaries!
 
 ## 6.2 Binaries (and bitstrings)
 
@@ -67,7 +67,7 @@ iex> byte_size <<0, 1, 2, 3>>
 4
 ```
 
-A binary is just a sequence of bytes. Of course those bytes can be organized in any way and they can be organized in a sequence that do not make them a valid string:
+A binary is just a sequence of bytes. Of course, those bytes can be organized in any way, even in a sequence that does not make them a valid string:
 
 ```iex
 iex> String.valid?(<239, 191, 191>>)
@@ -81,7 +81,7 @@ iex> <<0, 1>> <> <<2, 3>>
 <<0, 1, 2, 3>>
 ```
 
-There is a common trick used in Elixir which is to concatenate the null byte `<<0>>` to a string to see its inner binary representation:
+A common trick in Elixir is to concatenate the null byte `<<0>>` to a string to see its inner binary representation:
 
 ```iex
 iex> "hełło" <> <<0>>
@@ -118,7 +118,7 @@ iex> bit_size(<< 1 :: size(1)>>)
 1
 ```
 
-Interesting... the value is no longer a binary, but a bitstring! I.e. it is just a bunch of bits. So a binary is a bitstring where the number of bits is divisible by 8!
+The value is no longer a binary, but a bitstring -- just a bunch of bits! So a binary is a bitstring where the number of bits is divisible by 8!
 
 We can also pattern match on binaries / bitstrings:
 
@@ -140,7 +140,7 @@ iex> x
 <<2, 3>>
 ```
 
-The pattern above only works if the binary is at the end of `<<>>`. Similar results can retrieved with the string concatenation operator `<>`:
+The pattern above only works if the binary is at the end of `<<>>`. Similar results can be retrieved with the string concatenation operator `<>`:
 
 ```iex
 iex> "he" <> rest = "hello"
@@ -161,7 +161,7 @@ iex> 'hełło'
 iex> is_list 'hełło'
 ```
 
-You can see that, instead of containing bytes, a char list contains the codepoints of the characters in between single-quotes. So while a double-quotes represents a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
+You can see that, instead of containing bytes, a char list contains the codepoints of the characters in between single-quotes. So while double-quotes represents a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
 
 In practice, char lists are used mostly when interfacing with Erlang, in particular old libraries that do not accept binaries as arguments. You can convert a char list to a string and back by using the `to_string/1` and `to_char_list/1` functions:
 
@@ -176,4 +176,4 @@ iex> to_string 1
 "1"
 ```
 
-Note that those functions are polymorphic. They not only convert char lists to strings, but also integers to strings, atoms to strings and so on. With binaries, strings and char lists out of the way, it is time to talk about key-value data structures.
+Note that those functions are polymorphic. They not only convert char lists to strings, but also integers to strings, atoms to strings, and so on. With binaries, strings, and char lists out of the way, it is time to talk about key-value data structures.

From 18481403734b370ba857e651878a28b218125b44 Mon Sep 17 00:00:00 2001
From: Ryan Levick <ryan@6wunderkinder.com>
Date: Wed, 26 Mar 2014 23:41:19 +0100
Subject: [PATCH 080/160] explain 'function_name/arity syntax

---
 getting_started/2.markdown | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 70d057d19..681f31192 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -79,6 +79,8 @@ false
 
 Elixir provides a bunch of predicate functions to check for a value type. For example, the `is_boolean/1` function can be used to check if a value is a boolean or not:
 
+> Note: Functions in Elixir are indentified by name and by number of arguments (a.k.a arity). Therefore, `is_boolean/1` identifies a function named 'is_boolean' that takes 1 argument. `is_boolean/2` identifies a different (nonexistent) function with the same name but different arity.
+
 ```iex
 iex> is_boolean(true)
 true

From 16a13400b2e8f339b347aee2fbb65388ff291627 Mon Sep 17 00:00:00 2001
From: "Augie De Blieck Jr." <augiedb@gmail.com>
Date: Wed, 26 Mar 2014 21:27:38 -0400
Subject: [PATCH 081/160] Chapter 9 Edits for clarity

---
 getting_started/9.markdown | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/getting_started/9.markdown b/getting_started/9.markdown
index 6a7c8917c..79ec7dbd3 100644
--- a/getting_started/9.markdown
+++ b/getting_started/9.markdown
@@ -14,7 +14,7 @@ for(i = 0; i < array.length; i++) {
 }
 ```
 
-In the example above we are mutating the array which is not possible in Elixir. Instead functional languages rely on recursion: a function is called recursively until a condition is reached. Consider the example below that manually sums all the items in the list:
+In the example above, we are mutating the array. That's not possible in Elixir. Instead, functional languages rely on recursion: a function is called recursively until a condition is reached. Consider the example below that manually sums all the items in the list:
 
 ```elixir
 defmodule Math do
@@ -30,9 +30,9 @@ end
 Math.sum_list([1, 2, 3], 0) #=> 6
 ```
 
-In the example above, we invoke `sum_list` giving a list `[1,2,3]` and the initial value `0` as arguments. When a function has many clauses, we will try each clause until we find one that matches according to the pattern matching rules. In this case, the list `[1,2,3]` matches against `[h|t]` which assigns `h = 1` and `t = [2,3]` while `acc` is set to `0`.
+We invoke `sum_list` with a list `[1,2,3]` and the initial value `0` as arguments. When a function has many clauses, we will try each clause until we find one that matches according to the pattern matching rules. In this case, the list `[1,2,3]` matches against `[h|t]` which assigns `h = 1` and `t = [2,3]` while `acc` is set to `0`.
 
-Then, we add the head of the list to the accumulator `h + acc` and call `sum_list` again, recursively, passing the tail of the list as argument. The tail will once again match `[h|t]` until the list is empty, as seen below:
+Then, we add the head of the list to the accumulator `h + acc` and call `sum_list` again, recursively, passing the tail of the list as its first argument. The tail will once again match `[h|t]` until the list is empty, as seen below:
 
 ```elixir
 sum_list [1, 2, 3], 0
@@ -50,7 +50,7 @@ iex> Enum.reduce([1, 2, 3], 0, fn(x, acc) -> x + acc end)
 6
 ```
 
-Or using the capture syntax:
+Or, using the capture syntax:
 
 ```iex
 iex> Enum.reduce([1, 2, 3], 0, &+/2)

From 699c263507c7eb6d7ec2804a2ef0ed2fcad7ae7a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Thu, 27 Mar 2014 08:01:31 +0100
Subject: [PATCH 082/160] Remove duplicated arity explanation

---
 getting_started/2.markdown | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 681f31192..63d554c1f 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -79,7 +79,7 @@ false
 
 Elixir provides a bunch of predicate functions to check for a value type. For example, the `is_boolean/1` function can be used to check if a value is a boolean or not:
 
-> Note: Functions in Elixir are indentified by name and by number of arguments (a.k.a arity). Therefore, `is_boolean/1` identifies a function named 'is_boolean' that takes 1 argument. `is_boolean/2` identifies a different (nonexistent) function with the same name but different arity.
+> Note: Functions in Elixir are indentified by name and by number of arguments (i.e. arity). Therefore, `is_boolean/1` identifies a function named `is_boolean` that takes 1 argument. `is_boolean/2` identifies a different (nonexistent) function with the same name but different arity.
 
 ```iex
 iex> is_boolean(true)
@@ -88,9 +88,7 @@ iex> is_boolean(1)
 false
 ```
 
-Throughout this tutorial and in Elixir documentation, you will see functions mentioned in the format `is_boolean/1`. The first part is the function name and the number is the arity, i.e. the number of arguments the function expects.
-
-You can also use `is_integer/1`, `is_float/1` or `is_number/1` to check if an argument is an integer, float or any of them.
+You can also use `is_integer/1`, `is_float/1` or `is_number/1` to check, respectively, if an argument is an integer, float or any of them.
 
 ## 2.3 Atoms
 

From a41a9f881a6d556834f0d2abe49f81c58e9d1862 Mon Sep 17 00:00:00 2001
From: Mike Pack <mikepackdev@gmail.com>
Date: Tue, 11 Mar 2014 21:37:02 -0600
Subject: [PATCH 083/160] Fix sentence

---
 getting_started/mix/2.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/mix/2.markdown b/getting_started/mix/2.markdown
index fa6feb8d6..eb6834751 100644
--- a/getting_started/mix/2.markdown
+++ b/getting_started/mix/2.markdown
@@ -274,7 +274,7 @@ iex> :application.start(:stacker)
 
 In this case, since the application was previously started, it returns so as an error message.
 
-Mix does not only starts your application but all of your application dependencies. Notice there is a difference between your project dependencies (the ones defined under the `deps` key we have discussed in the previous chapter) and the application dependencies.
+Mix not only starts your application but all of your application dependencies. Notice there is a difference between your project dependencies (the ones defined under the `deps` key we have discussed in the previous chapter) and the application dependencies.
 
 The project dependencies may contain your test framework or a compile-time only dependency. The application dependency is everything you depend on at runtime. Any application dependency needs to be explicitly added to the `application` function too:
 

From 370eaa57321f1c8d7a90f6a81e92057c1cac5e50 Mon Sep 17 00:00:00 2001
From: Nicholas Faiz <nicholas.faiz@gmail.com>
Date: Wed, 26 Feb 2014 07:35:00 +1100
Subject: [PATCH 084/160] mention using mix test to run tests

---
 getting_started/ex_unit/1.markdown | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/getting_started/ex_unit/1.markdown b/getting_started/ex_unit/1.markdown
index 2fa563023..133a1f12a 100644
--- a/getting_started/ex_unit/1.markdown
+++ b/getting_started/ex_unit/1.markdown
@@ -23,7 +23,11 @@ defmodule MyTest do
 end
 ```
 
-In general, we just need to invoke `ExUnit.start`, define a test case using `ExUnit.Case` and our batch of tests. Assuming we saved this file as `assertion_test.exs`, we can run it directly:
+In general, we just need to invoke `ExUnit.start`, define a test case using `ExUnit.Case` and our batch of tests. Most tests will be invoked as part of a [Mix](http://elixir-lang.org/getting_started/mix/1.html) project.
+
+    mix test
+
+Otherwise, assuming we saved this file as `assertion_test.exs`, we can run it directly:
 
     bin/elixir assertion_test.exs
 

From bde9b4b505e8b34784b7cbf3d28ae5d27540be72 Mon Sep 17 00:00:00 2001
From: Ryan Levick <ryan@6wunderkinder.com>
Date: Fri, 28 Mar 2014 01:07:28 +0100
Subject: [PATCH 085/160] Flesh out Chapter 9 with more examples

---
 getting_started/9.markdown | 76 +++++++++++++++++++++++++++++++++-----
 1 file changed, 66 insertions(+), 10 deletions(-)

diff --git a/getting_started/9.markdown b/getting_started/9.markdown
index 79ec7dbd3..7c2dca8a7 100644
--- a/getting_started/9.markdown
+++ b/getting_started/9.markdown
@@ -14,25 +14,57 @@ for(i = 0; i < array.length; i++) {
 }
 ```
 
-In the example above, we are mutating the array. That's not possible in Elixir. Instead, functional languages rely on recursion: a function is called recursively until a condition is reached. Consider the example below that manually sums all the items in the list:
+In the example above, we are mutating the array and the helper variable `i`. That's not possible in Elixir. Instead, functional languages rely on recursion: a function is called recursively until a condition is reached that stops the recursive action from continuing. Consider the example below that prints a string an arbitrary amount of times:
+
+```elixir
+defmodule Recursion do
+  def print_multiple_times(msg, n) when n <= 1 do
+    IO.puts msg
+  end
+
+  def print_multiple_times(msg, n) do
+    IO.puts msg
+    print_multiple_times(msg, n - 1)
+  end
+end
+
+Recursion.print_multiple_times("Hello!", 3)
+# "Hello!"
+# "Hello!"
+# "Hello!"
+```
+
+A function may have many "clauses" or definitions which will be executed when the arguments passed to the function match according to the pattern matching rules seen earlier and any guards on the clause evaluate to true.
+
+Above when `print_multiple_times/2` is initially called, the argument `n` is equal to `3`.
+
+The first clause has a guard which says use this definition if and only if `n` is less than or equal to `1`. Since this is not the case, Elixir proceeds to the next clause's definition.
+
+The second definition matches the pattern and has no guard so it will be executed. It first prints our `msg` and then calls itself passing `n - 1` (`2`) as the second argument. Our `msg` is printed and `print_multiple_times/2` is called again this time with the second argument set to `1`.
+
+Because `n` is now set to `1`, the guard to our first definition of `print_multiple_times/2` evaluates to true, and we execute this particular definition. The `msg` is printed, and there is nothing left to execute.
+
+We defined `print_multiple_times/2` so that no matter what number is passed as the second argument it either triggers our first definition (known as a "base case") or it triggers our second definition which will ensure that we get exactly 1 step closer to our base case.
+
+Let's now see how we can use the power of recursion to sum a list of numbers.
 
 ```elixir
 defmodule Math do
-  def sum_list([h|t], acc) do
-    sum_list(t, h + acc)
+  def sum_list([head|tail], accumulator) do
+    sum_list(tail, head + accumulator)
   end
 
-  def sum_list([], acc) do
-    acc
+  def sum_list([], accumulator) do
+    accumulator
   end
 end
 
 Math.sum_list([1, 2, 3], 0) #=> 6
 ```
 
-We invoke `sum_list` with a list `[1,2,3]` and the initial value `0` as arguments. When a function has many clauses, we will try each clause until we find one that matches according to the pattern matching rules. In this case, the list `[1,2,3]` matches against `[h|t]` which assigns `h = 1` and `t = [2,3]` while `acc` is set to `0`.
+We invoke `sum_list` with a list `[1,2,3]` and the initial value `0` as arguments. We will try each clause until we find one that matches according to the pattern matching rules. In this case, the list `[1,2,3]` matches against `[head|tail]` which assigns `head = 1` and `tail = [2,3]` while `accumulator` is set to `0`.
 
-Then, we add the head of the list to the accumulator `h + acc` and call `sum_list` again, recursively, passing the tail of the list as its first argument. The tail will once again match `[h|t]` until the list is empty, as seen below:
+Then, we add the head of the list to the accumulator `head + accumulator` and call `sum_list` again, recursively, passing the tail of the list as its first argument. The tail will once again match `[head|tail]` until the list is empty, as seen below:
 
 ```elixir
 sum_list [1, 2, 3], 0
@@ -41,13 +73,35 @@ sum_list [3], 3
 sum_list [], 6
 ```
 
-When the list is empty, it will match the final clause which returns the final result of `6`. In imperative languages, such implementation would usually fail for large lists because the stack (in which our execution path is kept) would grow until it reaches a limit. Elixir, however, does tail call optimization in which the stack does not grow when a function exits by calling another function.
+When the list is empty, it will match the final clause which returns the final result of `6`.
+
+The process of taking a list and "reducing" it down to one value is known as a "reduce" algorithm and is central to functional programming.
+
+But what if we instead want to add 5 to all of the values in our list?
+
+```elixir
+defmodule Math do
+  def double_each([head|tail], accumulator) do
+    double_each(tail, accumulator ++ [head * 2])
+  end
+
+  def double_each([], new_list) do
+    new_list
+  end
+end
+
+Math.double_each([1, 2, 3], []) #=> [2, 4, 6]
+```
+
+Here we have used our recursive capabilities to traverse a list doubling each element and returning a whole new list. The process of taking a list and "mapping" over it is known as a "map" algorithm.
 
-Recursion and tail call optimization are an important part of Elixir and are commonly used to create loops, especially in cases where processes need to wait and respond to messages. However, recursion as above is rarely used to manipulate lists, since [the `Enum` module](/docs/stable/Enum.html) already provides many conveniences for working not only with lists but different kinds of Enumerables. For instance, the example above could be simply written as:
+Recursion and tail call optimization are an important part of Elixir and are commonly used to create loops. However, when programming Elixir you will rarely use recursion as above to manipulate lists. [The `Enum` module](/docs/stable/Enum.html) already provides many conveniences for working with lists. For instance, the examples above could be written as:
 
 ```iex
 iex> Enum.reduce([1, 2, 3], 0, fn(x, acc) -> x + acc end)
 6
+iex> Enum.map([1, 2, 3], fn(x) -> x * 2 end)
+[2, 4, 6]
 ```
 
 Or, using the capture syntax:
@@ -55,9 +109,11 @@ Or, using the capture syntax:
 ```iex
 iex> Enum.reduce([1, 2, 3], 0, &+/2)
 6
+iex> Enum.map([1, 2, 3], &(&1 * 2))
+[2, 4, 6]
 ```
 
-Or finally the `sum/1` function:
+Our reduce example can even be written with the `sum/1` function:
 
 ```iex
 iex> Enum.sum([1, 2, 3])

From 24c4d36c2934671f489bdb6eb5113310b9b0dde0 Mon Sep 17 00:00:00 2001
From: Jim Tittsler <jwt@onjapan.net>
Date: Fri, 28 Mar 2014 17:41:43 +0900
Subject: [PATCH 086/160] spelling

verb not noun
---
 getting_started/10.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/10.markdown b/getting_started/10.markdown
index 407c11858..ab895f2c5 100644
--- a/getting_started/10.markdown
+++ b/getting_started/10.markdown
@@ -10,7 +10,7 @@ In order to facilitate software reuse, Elixir provides three directives. As we a
 
 ### 10.1 alias
 
-`alias` allows you to setup aliases for any given module name. Imagine our `Math` module uses a special list implementation for doing math specific operations:
+`alias` allows you to set up aliases for any given module name. Imagine our `Math` module uses a special list implementation for doing math specific operations:
 
 ```elixir
 defmodule Math do

From d656d40f1113d7b2cdc0e51253bc156e6881a8e8 Mon Sep 17 00:00:00 2001
From: Ryan Levick <ryan@6wunderkinder.com>
Date: Fri, 28 Mar 2014 10:42:14 +0100
Subject: [PATCH 087/160] Small changes to Chapter 9

---
 getting_started/9.markdown | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/getting_started/9.markdown b/getting_started/9.markdown
index 7c2dca8a7..f9e408b52 100644
--- a/getting_started/9.markdown
+++ b/getting_started/9.markdown
@@ -29,12 +29,12 @@ defmodule Recursion do
 end
 
 Recursion.print_multiple_times("Hello!", 3)
-# "Hello!"
-# "Hello!"
-# "Hello!"
+# Hello!
+# Hello!
+# Hello!
 ```
 
-A function may have many "clauses" or definitions which will be executed when the arguments passed to the function match according to the pattern matching rules seen earlier and any guards on the clause evaluate to true.
+Similar to case, a function may have many clauses. A particular clause is executed when the arguments passed to the function match the clause's argument patterns and its guard evaluates to `true`.
 
 Above when `print_multiple_times/2` is initially called, the argument `n` is equal to `3`.
 
@@ -77,23 +77,23 @@ When the list is empty, it will match the final clause which returns the final r
 
 The process of taking a list and "reducing" it down to one value is known as a "reduce" algorithm and is central to functional programming.
 
-But what if we instead want to add 5 to all of the values in our list?
+What if we instead want to double all of the values in our list?
 
 ```elixir
 defmodule Math do
-  def double_each([head|tail], accumulator) do
-    double_each(tail, accumulator ++ [head * 2])
+  def double_each([head|tail]) do
+    [head * 2| double_each(tail)]
   end
 
-  def double_each([], new_list) do
-    new_list
+  def double_each([]) do
+    []
   end
 end
 
-Math.double_each([1, 2, 3], []) #=> [2, 4, 6]
+Math.double_each([1, 2, 3]) #=> [2, 4, 6]
 ```
 
-Here we have used our recursive capabilities to traverse a list doubling each element and returning a whole new list. The process of taking a list and "mapping" over it is known as a "map" algorithm.
+Here we have used recursion to traverse a list doubling each element and returning a new list. The process of taking a list and "mapping" over it is known as a "map" algorithm.
 
 Recursion and tail call optimization are an important part of Elixir and are commonly used to create loops. However, when programming Elixir you will rarely use recursion as above to manipulate lists. [The `Enum` module](/docs/stable/Enum.html) already provides many conveniences for working with lists. For instance, the examples above could be written as:
 

From ce5ea34f5788555873a06236949a8777071cede8 Mon Sep 17 00:00:00 2001
From: Steve <steve@stevedomin.com>
Date: Fri, 28 Mar 2014 14:01:39 +0000
Subject: [PATCH 088/160] Fix output for single/double quoted string comparison
 example

---
 getting_started/2.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 63d554c1f..e017ad3c7 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -179,7 +179,7 @@ Keep in mind `single-quoted` and `double-quoted` strings are not equivalent in E
 
 ```iex
 iex> 'hellö' == "hellö"
-true
+false
 ```
 
 We will talk more about Unicode support and the difference in between single and double-quoted strings in the "Binaries, strings and char lists" chapter.

From 94f0b26409364faa3fe65d54a537359c7a930f80 Mon Sep 17 00:00:00 2001
From: Steve <steve@stevedomin.com>
Date: Fri, 28 Mar 2014 14:54:02 +0000
Subject: [PATCH 089/160] Fix typo in section 2.8

---
 getting_started/2.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index e017ad3c7..2a7988a7f 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -310,7 +310,7 @@ iex> list = [1|[2|[3|[]]]]
 [1, 2, 3]
 ```
 
-This means accessing the length of a list is a linear operation: we need to traverse the whole list in order to figure out its size. Updating a list as fast as long as we are prepending elements:
+This means accessing the length of a list is a linear operation: we need to traverse the whole list in order to figure out its size. Updating a list is fast as long as we are prepending elements:
 
 ```iex
 iex> [0] ++ list

From 7ea7b8ba3ba03795157694f8ed35c278f549dcc8 Mon Sep 17 00:00:00 2001
From: Ryan Levick <ryan@6wunderkinder.com>
Date: Fri, 28 Mar 2014 19:18:56 +0100
Subject: [PATCH 090/160] Small improvements to Chapter 2

---
 getting_started/2.markdown | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 2a7988a7f..6db55e97d 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -31,7 +31,7 @@ iex> 10 / 2
 5.0
 ```
 
-Notice that `10 / 2` returned a float `5.0` instead of an integer. This is expected. In Elixir, the operator `/` always returns a float. If you want to do integer division or get the division remainder, you can invoke the `div` and `rem` functions:
+Notice that `10 / 2` returned a float `5.0` instead of an integer `5`. This is expected. In Elixir, the operator `/` always returns a float. If you want to do integer division or get the division remainder, you can invoke the `div` and `rem` functions:
 
 ```iex
 iex> div(10, 2)
@@ -88,11 +88,11 @@ iex> is_boolean(1)
 false
 ```
 
-You can also use `is_integer/1`, `is_float/1` or `is_number/1` to check, respectively, if an argument is an integer, float or any of them.
+You can also use `is_integer/1`, `is_float/1` or `is_number/1` to check, respectively, if an argument is an integer, a float or either.
 
 ## 2.3 Atoms
 
-Atoms are constants where their name is their own value. Some other languages call them symbols.
+Atoms are constants where their name is their own value. Some other languages call these symbols.
 
 ```iex
 iex> :hello
@@ -112,7 +112,7 @@ true
 
 ## 2.4 Strings
 
-Strings in Elixir are inserted in between double quotes and they are encoded in UTF-8:
+Strings in Elixir are inserted in between double quotes, and they are encoded in UTF-8:
 
 ```iex
 iex> "hellö"
@@ -182,7 +182,7 @@ iex> 'hellö' == "hellö"
 false
 ```
 
-We will talk more about Unicode support and the difference in between single and double-quoted strings in the "Binaries, strings and char lists" chapter.
+We will talk more about Unicode support and the difference between single and double-quoted strings in the "Binaries, strings and char lists" chapter.
 
 ## 2.5 Anonymous functions
 
@@ -201,9 +201,11 @@ iex> add.(1, 2)
 3
 ```
 
-Functions can be passed as argument to other functions. In the example, we have passed the function in the variable `add` to the `is_function/1` function which correctly returned true. We can also check the arity of the function by calling `is_function/2`. Note a dot (`.`) in between the variable and parenthesis is required to invoke an anonymous function.
+Functions are "first class citizens" in Elixir meaning they can be passed as arguments to other functions just as integers and strings can. In the example, we have passed the function in the variable `add` to the `is_function/1` function which correctly returned `true`. We can also check the arity of the function by calling `is_function/2`.
 
-Anonymous functions are closures and as such they can access variables defined prior to the function definition:
+Note a dot (`.`) in between the variable and parenthesis is required to invoke an anonymous function.
+
+Anonymous functions are closures, and as such they can access variables that are in scope when the function is defined:
 
 ```iex
 iex> add_two = fn a -> add(a, 2) end
@@ -212,7 +214,7 @@ iex> add_two.(2)
 4
 ```
 
-Keep in mind that a variable assigned to inside a function does not affect its surrounding environment:
+Keep in mind that a variable assigned inside a function does not affect its surrounding environment:
 
 ```iex
 iex> x = 42
@@ -297,7 +299,7 @@ iex> tuple
 
 Notice that `set_elem/3` returned a new tuple. The original tuple stored in the `tuple` variable was not modified because Elixir data types are immutable. By being immutable, Elixir code is easier to reason about as you never need to worry if a particular code is mutating your data structure in place.
 
-By being immutable, Elixir also helps eliminate common cases where concurrent code have race conditions because two different entities are trying to change a data structure at the same time.
+By being immutable, Elixir also helps eliminate common cases where concurrent code has race conditions because two different entities are trying to change a data structure at the same time.
 
 ## 2.8 Lists or tuples?
 
@@ -343,7 +345,7 @@ iex> elem(tuple, 1)
 "hello"
 ```
 
-When "counting" the number of elements in a data structure, Elixir also abides to a simple rule: the function should be named `size` if the operation is in constant time (i.e. the value is pre-calculated) or `length` if the operation requires explicit counting.
+When "counting" the number of elements in a data structure, Elixir also abides by a simple rule: the function should be named `size` if the operation is in constant time (i.e. the value is pre-calculated) or `length` if the operation requires explicit counting.
 
 For example, we have used 4 counting functions so far: `byte_size/1` (for the number of bytes in a string), `tuple_size/1` (for the tuple size), `length/1` (for the list length) and `String.length/1` (for the number of characters in a string). That said, we use `byte_size` to get the number of bytes in a string, which is cheap, but retrieving the number of unicode characters uses `String.length`, since the whole string needs to be iterated.
 

From b6394c167253cb1cfc36060ace458348e7f71b6b Mon Sep 17 00:00:00 2001
From: Ryan Levick <ryan@6wunderkinder.com>
Date: Fri, 28 Mar 2014 19:26:04 +0100
Subject: [PATCH 091/160] Small improvements to Chapter 3

---
 getting_started/3.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/3.markdown b/getting_started/3.markdown
index 252edb291..a457d9a08 100644
--- a/getting_started/3.markdown
+++ b/getting_started/3.markdown
@@ -6,7 +6,7 @@ guide: 3
 
 # {{ page.title }}
 
-In the previous chapter, we saw Elixir provides `+`, `-`, `*`, `/` as arithmetic operators. Plus the functions `div/2` and `rem/2` for integer division and remainder.
+In the previous chapter, we saw Elixir provides `+`, `-`, `*`, `/` as arithmetic operators, plus the functions `div/2` and `rem/2` for integer division and remainder.
 
 Elixir also provides `++` and `--` to manipulate lists:
 

From 7b53961bee4c73ac0ae424f7a7c7b94f009de10d Mon Sep 17 00:00:00 2001
From: Ryan Levick <ryan@6wunderkinder.com>
Date: Fri, 28 Mar 2014 19:35:14 +0100
Subject: [PATCH 092/160] Small improvements to Chapter 4

---
 getting_started/4.markdown | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/getting_started/4.markdown b/getting_started/4.markdown
index db00ec21a..f14bc64b4 100644
--- a/getting_started/4.markdown
+++ b/getting_started/4.markdown
@@ -28,9 +28,9 @@ iex> 2 = x
 ** (MatchError) no match of right hand side value: 1
 ```
 
-Notice that `1 = x` is a valid expression and it matched because both the left and right side are equal to 1. When the sides do not match, a `MatchError` is raised.
+Notice that `1 = x` is a valid expression, and it matched because both the left and right side are equal to 1. When the sides do not match, a `MatchError` is raised.
 
-Also, in Elixir parlance, we don't say a variable is assigned. We say a variable is bound or not. A variable can only be bound just on the left side of `=`:
+Also, in Elixir parlance, we don't say a variable is assigned. We say a variable is bound or not. A variable can only be bound on the left side of `=`:
 
 ```iex
 iex> 1 = unknown
@@ -41,7 +41,7 @@ Since there is no variable unknown previously defined, Elixir imagined you were
 
 ## 4.2 Pattern matching
 
-The match operator is not only used to match against simple values but they are also useful for destructuring more complex data types. For example, we can pattern match on tuples:
+The match operator is not only used to match against simple values, but it is also useful for destructuring more complex data types. For example, we can pattern match on tuples:
 
 ```iex
 iex> {a, b, c} = {:hello, "world", 42}
@@ -66,7 +66,7 @@ iex> {a, b, c} = [:hello, "world", "!"]
 ** (MatchError) no match of right hand side value: [:hello, "world", "!"]
 ```
 
-More interestingly, we can match on specific values. The example below asserts that the left side will only match the right side in case the right side is a tuple that starts with the atom `:ok`:
+More interestingly, we can match on specific values. The example below asserts that the left side will only match the right side when the right side is a tuple that starts with the atom `:ok`:
 
 ```iex
 iex> {:ok, result} = {:ok, 13}
@@ -105,7 +105,7 @@ iex> [h|t] = []
 ** (MatchError) no match of right hand side value: []
 ```
 
-The `[head | tail]` format is not only used on pattern matching, but also for prepending items to a list:
+The `[head | tail]` format is not only used on pattern matching but also for prepending items to a list:
 
 ```iex
 iex> list = [1, 2, 3]

From 984e5858576fd9c8fd1dc209d963eb42c69bc582 Mon Sep 17 00:00:00 2001
From: Ryan Levick <ryan@6wunderkinder.com>
Date: Fri, 28 Mar 2014 19:45:30 +0100
Subject: [PATCH 093/160] Small improvements to Chapter 5

---
 getting_started/5.markdown | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/getting_started/5.markdown b/getting_started/5.markdown
index abc67a51b..43baa1832 100644
--- a/getting_started/5.markdown
+++ b/getting_started/5.markdown
@@ -6,11 +6,11 @@ guide: 5
 
 # {{ page.title }}
 
-In this chapter, we will learn about `case`, `cond` and `if` control-flow structures.
+In this chapter, we will learn about the `case`, `cond` and `if` control-flow structures.
 
 ## 5.1 case
 
-A `case` allows us to compare a value against many patterns until we find a matching one:
+`case` allows us to compare a value against many patterns until we find a matching one:
 
 ```iex
 iex> case {1, 2, 3} do
@@ -197,11 +197,11 @@ iex> if nil do
 "This will"
 ```
 
-An interesting note regarding `if/2` and `unless/2` is that they are implemented as macros in the language; they are not keywords (as they would be in many languages). You can check the documentation and the source of `if/2` in [the `Kernel` module docs](/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
+> Note: An interesting note regarding `if/2` and `unless/2` is that they are implemented as macros in the language; they are not keywords (as they would be in many languages). You can check the documentation and the source of `if/2` in [the `Kernel` module docs](/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
 
 ### 5.4 `do` blocks
 
-At this point, we have learned four control structures, `case`, `cond`, `if` and `unless`, and they were all wrapped in `do`/`end` blocks. It happens we could also write `if` as follows:
+At this point, we have learned four control structures: `case`, `cond`, `if` and `unless`, and they were all wrapped in `do`/`end` blocks. It happens we could also write `if` as follows:
 
 ```iex
 iex> if true, do: 1 + 2
@@ -262,6 +262,6 @@ iex> case 1, do: (x -> "Got #{x}")
 "Got 1"
 ```
 
-Although it is rare to use the keyword syntax with `case` and `cond`, we will see keyword lists play an important role in the language. They are quite common in many functions and macros. We will explore them a bit more in a future chapter.  
+Although it is rare to use the keyword syntax with `case` and `cond`, we will see keyword lists play an important role in the language. They are quite common in many functions and macros. We will explore them a bit more in a future chapter.
 
 Now it is time to talk about "Binaries, strings and char lists".

From b7bf2c76ca1a5a9fd5f4dbe3639f2d247f89f6c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Fri, 28 Mar 2014 20:22:20 +0100
Subject: [PATCH 094/160] Simplify contents in chapters

---
 getting_started/2.markdown |  4 ++--
 getting_started/5.markdown | 15 +++------------
 getting_started/9.markdown |  7 -------
 3 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 6db55e97d..c7027c043 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -325,7 +325,7 @@ The first operation is fast because we are simply adding a new cons that points
 
 Tuples, on the other hand, are stored contiguously in memory. This means getting the tuple size or accessing an element by index is fast. However, updating or adding element to tuples is expensive because it requires copying the whole tuple in memory.
 
-Those performance characteristics dictates the usage of those data structures. For example, one very common use case for tuples is to use them to return extra information from a function, as seen in the `File.read/1` function:
+Those performance characteristics dictates the usage of those data structures. One very common use case for tuples is to use them to return extra information from a function. For example, `File.read/1` is a function that can be used to read file contents and it returns tuples:
 
 ```iex
 iex> File.read("path/to/existing/file")
@@ -334,7 +334,7 @@ iex> File.read("path/to/unknown/file")
 {:error, :enoent}
 ```
 
-If the path given to `File.read/1` exists, it returns a tuple with the atom `:ok` as first element and the file contents as second. Otherwise, it returns `:error` and the error reason.
+If the path given to `File.read/1` exists, it returns a tuple with the atom `:ok` as first element and the file contents as second. Otherwise, it returns a tuple with `:error` and the error reason.
 
 Most of the time, Elixir is going to guide you to do the right thing. For example, there is a `elem/2` function to access a tuple item but there is no built-in equivalent for lists:
 
diff --git a/getting_started/5.markdown b/getting_started/5.markdown
index 43baa1832..80d0744e0 100644
--- a/getting_started/5.markdown
+++ b/getting_started/5.markdown
@@ -197,7 +197,7 @@ iex> if nil do
 "This will"
 ```
 
-> Note: An interesting note regarding `if/2` and `unless/2` is that they are implemented as macros in the language; they are not keywords (as they would be in many languages). You can check the documentation and the source of `if/2` in [the `Kernel` module docs](/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
+> Note: An interesting note regarding `if/2` and `unless/2` is that they are implemented as macros in the language; they are special language constructs as they would be in many languages. You can check the documentation and the source of `if/2` in [the `Kernel` module docs](/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
 
 ### 5.4 `do` blocks
 
@@ -246,7 +246,7 @@ iex> is_number(if true) do
 ...> end
 ```
 
-That leads to an undefined function error.  `do` is being passed to the `is_number` function, which is then called with two arguments while `if` is called with only one. Adding explicit parentheses is enough to resolve the ambiguity:
+Which leads to an undefined function error as Elixir attempts to invoke `is_number/2`. Adding explicit parentheses is enough to resolve the ambiguity:
 
 ```iex
 iex> is_number(if true do
@@ -255,13 +255,4 @@ iex> is_number(if true do
 true
 ```
 
-The same rules regarding `do`/`end` blocks also apply to `case`, `cond`, etc:
-
-```iex
-iex> case 1, do: (x -> "Got #{x}")
-"Got 1"
-```
-
-Although it is rare to use the keyword syntax with `case` and `cond`, we will see keyword lists play an important role in the language. They are quite common in many functions and macros. We will explore them a bit more in a future chapter.
-
-Now it is time to talk about "Binaries, strings and char lists".
+Keyword lists play an important role in the language and are quite common in many functions and macros. We will explore them a bit more in a future chapter. Now it is time to talk about "Binaries, strings and char lists".
diff --git a/getting_started/9.markdown b/getting_started/9.markdown
index f9e408b52..d32b7d1d3 100644
--- a/getting_started/9.markdown
+++ b/getting_started/9.markdown
@@ -113,11 +113,4 @@ iex> Enum.map([1, 2, 3], &(&1 * 2))
 [2, 4, 6]
 ```
 
-Our reduce example can even be written with the `sum/1` function:
-
-```iex
-iex> Enum.sum([1, 2, 3])
-6
-```
-
 We will learn more about Enumerables in the "Enumerables and streams" chapter.

From 183fc71ce658b912201cadf642aecb5da0c8ca18 Mon Sep 17 00:00:00 2001
From: Ryan Levick <ryan@6wunderkinder.com>
Date: Fri, 28 Mar 2014 20:26:27 +0100
Subject: [PATCH 095/160] Small improvements to Chapter 6

---
 getting_started/6.markdown | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index d4a79716b..7760d9ba0 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -21,7 +21,7 @@ In this chapter, we will understand what binaries are, how they associate with s
 
 A string is a UTF-8 encoded binary. In order to understand exactly what we mean by that, we need to understand the difference between bytes and codepoints.
 
-The Unicode standard assigns codepoints to many of the characters we know. For example, the letter `a` has codepoint `97` while the letter `ł` has codepoint `322`. When writing the string `"hełło"` to disk, we need to convert this codepoint to bytes. Since a byte can represent a number from `0` to `255`, if we adopted a rule that said one byte represents one codepoint, we wouldn't be able to write `"hełło"`, because it uses the codepoint `322`. But of course, given you can actually read `"hełło"` on your screen, it means it is represented *somehow*. That's when encodings come in.
+The Unicode standard assigns codepoints to many of the characters we know. For example, the letter `a` has codepoint `97` while the letter `ł` has codepoint `322`. When writing the string `"hełło"` to disk, we need to convert this codepoint to bytes. If we adopted a rule that said one byte represents one codepoint, we wouldn't be able to write `"hełło"`, because it uses the codepoint `322` for `ł`, and one byte can only represent a number from `0` to `255`. But of course, given you can actually read `"hełło"` on your screen, it must be represented *somehow*. That's where encodings come in.
 
 When representing codepoints in bytes, we need to encode them somehow. Elixir chose the UTF-8 encoding as its main and default encoding. When we say a string is a UTF-8 encoded binary, we mean a string is a bunch of bytes organized in a way to represent certain codepoints, as specified by the UTF-8 encoding.
 
@@ -54,7 +54,7 @@ iex> String.codepoints("hełło")
 
 You will see that Elixir has excellent support for working with strings. It also supports many of the Unicode operations. In fact, Elixir passes all the tests showcased in the ["The string type is broken"](http://mortoray.com/2013/11/27/the-string-type-is-broken/) article.
 
-However, strings are just part of the story. If a string is a binary and we have used the `is_binary/1` function, Elixir probably has an underlying type empowering strings, and that is exactly true. Let's talk about binaries!
+However, strings are just part of the story. If a string is a binary, and we have used the `is_binary/1` function, Elixir must have an underlying type empowering strings. And it does. Let's talk about binaries!
 
 ## 6.2 Binaries (and bitstrings)
 
@@ -95,7 +95,7 @@ iex> <<255>>
 <<255>>
 iex> <<256>> # truncated
 <<0>>
-iex> <<256 :: size(16)>> # use 16 bits to store the number (2 bytes)
+iex> <<256 :: size(16)>> # use 16 bits (2 bytes) to store the number
 <<1, 0>>
 iex> <<256 :: utf8>> # the number is a codepoint
 "Ā"
@@ -149,7 +149,7 @@ iex> rest
 "llo"
 ```
 
-This finishes our tour on bitstrings, binaries and strings. A string is a UTF-8 encoded binary and a binary is a bitstring where the number of bits is divisible by 8. Although this shows the flexibility Elixir provides to work with bits and bytes, 99% of the time you will be working with binaries and using the `is_binary/1` and `byte_size/1` functions.
+This finishes our tour of bitstrings, binaries and strings. A string is a UTF-8 encoded binary, and a binary is a bitstring where the number of bits is divisible by 8. Although this shows the flexibility Elixir provides to work with bits and bytes, 99% of the time you will be working with binaries and using the `is_binary/1` and `byte_size/1` functions.
 
 ## 6.3 Char lists
 
@@ -176,4 +176,6 @@ iex> to_string 1
 "1"
 ```
 
-Note that those functions are polymorphic. They not only convert char lists to strings, but also integers to strings, atoms to strings, and so on. With binaries, strings, and char lists out of the way, it is time to talk about key-value data structures.
+Note that those functions are polymorphic. They not only convert char lists to strings, but also integers to strings, atoms to strings, and so on.
+
+With binaries, strings, and char lists out of the way, it is time to talk about key-value data structures.

From 389ae3bff737100d66b6e190ea26e0aa59becfad Mon Sep 17 00:00:00 2001
From: Ryan Levick <ryan@6wunderkinder.com>
Date: Fri, 28 Mar 2014 20:40:54 +0100
Subject: [PATCH 096/160] Small improvements to Chapter 7

---
 getting_started/7.markdown | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/getting_started/7.markdown b/getting_started/7.markdown
index abfd3e28f..bcc75eac7 100644
--- a/getting_started/7.markdown
+++ b/getting_started/7.markdown
@@ -6,9 +6,9 @@ guide: 7
 
 # {{ page.title }}
 
-So far we haven't discussed any associative data structures, i.e. data structures that are able to associate a certain value (or multiple values) to a key. Different languages call them different names, like dictionaries, hashes, associative arrays, maps, etc.
+So far we haven't discussed any associative data structures, i.e. data structures that are able to associate a certain value (or multiple values) to a key. Different languages call these different names like dictionaries, hashes, associative arrays, maps, etc.
 
-In Elixir, we have two main associative data structures: keyword lists and maps. It is time to learn more about them!
+In Elixir, we have two main associative data structures: keyword lists and maps. It's time to learn more about them!
 
 ## 7.1 Keyword lists
 
@@ -23,7 +23,7 @@ iex> list[:a]
 1
 ```
 
-As we can see above, Elixir supports a special syntax for defining such lists and underneath they just map to a list of tuples. Since they are simply lists, all operations available to lists, including their performance characteristics, also apply to keyword lists.
+As you can see above, Elixir supports a special syntax for defining such lists, and underneath they just map to a list of tuples. Since they are simply lists, all operations available to lists, including their performance characteristics, also apply to keyword lists.
 
 For example, we can use `++` to add new values to a keyword list:
 
@@ -45,8 +45,8 @@ iex> new_list[:a]
 
 Keyword lists are important because they have two special characteristics:
 
-* They keep the keys ordered as given by the developer;
-* They allow a key to be given more than once;
+* They keep the keys ordered as given by the developer.
+* They allow a key to be given more than once.
 
 For example, [the Ecto library](https://github.com/elixir-lang/ecto) makes use of both features to provide an elegant DSL for writing database queries:
 
@@ -73,7 +73,7 @@ iex> if(false, [do: :this, else: :that])
 
 In general, when the keyword list is the last argument of a function, the square brackets are optional.
 
-In order to manipulate keyword lists, Elixir provides [the `Keyword` module](/docs/stable/Keyword.html). Remember though keyword lists are simply lists and as such they provide the same linear performance characteristics as lists. The longer the list, the longer it will take to find a key, to count how many items, and so on. For this reason, keyword lists are used in Elixir mainly as options. If you need to store many items or guarantee one-key associates with at maximum one-value, you should use maps instead.
+In order to manipulate keyword lists, Elixir provides [the `Keyword` module](/docs/stable/Keyword.html). Remember though keyword lists are simply lists, and as such they provide the same linear performance characteristics as lists. The longer the list, the longer it will take to find a key, to count the number of items, and so on. For this reason, keyword lists are used in Elixir mainly as options. If you need to store many items or guarantee one-key associates with at maximum one-value, you should use maps instead.
 
 Note we can also pattern match on keyword lists:
 
@@ -105,8 +105,8 @@ iex> map[2]
 
 Compared to keyword lists, we can already see two differences:
 
-* Maps allow any value as key;
-* Maps keys do not follow any ordering;
+* Maps allow any value as key.
+* Maps' keys do not follow any ordering.
 
 If you pass duplicate keys when creating a map, the last one wins:
 
@@ -122,7 +122,7 @@ iex> map = %{a: 1, b: 2}
 %{a: 1, b: 2}
 ```
 
-Opposite to keyword lists, maps are very useful with pattern matching:
+In contrast to keyword lists, maps are very useful with pattern matching:
 
 ```iex
 iex> %{} = %{:a => 1, 2 => :b}
@@ -135,7 +135,7 @@ iex> %{:c => c} = %{:a => 1, 2 => :b}
 ** (MatchError) no match of right hand side value: %{2 => :b, :a => 1}
 ```
 
-As shown above, a map matches as long as the given keys exist on the given map. Therefore, an empty map matches all maps.
+As shown above, a map matches as long as the given keys exist in the given map. Therefore, an empty map matches all maps.
 
 One interesting property about maps is that they provide a particular syntax for updating and accessing atom keys:
 
@@ -156,7 +156,7 @@ In future chapters, we will also learn about structs, which provide compile-time
 
 Manipulating maps is done via [the `Map` module](/docs/stable/Map.html), it provides a very similar API to the `Keyword` module. This is because both modules implement the `Dict` behaviour.
 
-> Maps were recently introduced into the Erlang VM with [EEP 43](www.erlang.org/eeps/eep-0043.html). Erlang 17 provides a partial implementation of the EEP, where only "small maps" are supported. This means maps have good performance characteristics only when storing at maximum a couple of dozens keys. To fill in this gap, Elixir also provides [the `HashDict` module](/docs/stable/HashDict.html) which uses a hashing algorithm to provide a dictionary that supports hundreds of thousands keys with good performance.
+> Note: Maps were recently introduced into the Erlang VM with [EEP 43](www.erlang.org/eeps/eep-0043.html). Erlang 17 provides a partial implementation of the EEP, where only "small maps" are supported. This means maps have good performance characteristics only when storing at maximum a couple of dozens keys. To fill in this gap, Elixir also provides [the `HashDict` module](/docs/stable/HashDict.html) which uses a hashing algorithm to provide a dictionary that supports hundreds of thousands keys with good performance.
 
 ## 7.3 Dicts
 
@@ -179,6 +179,6 @@ The `Dict` module allows any developer to implement their own variation of `Dict
 
 That said, you may be wondering, which of `Keyword`, `Map` or `Dict` modules should you use in your code? The answer is: it depends.
 
-If your code is expecting a keyword as argument, explicitly use the `Keyword` module. If a map, the `Map` module. However, if your API is meant to work with any dictionary, use the `Dict` module (and make sure to write tests that pass different dict implementations as arguments).
+If your code is expecting a keyword as an argument, explicitly use the `Keyword` module. If you want to manipulate a map, use the `Map` module. However, if your API is meant to work with any dictionary, use the `Dict` module (and make sure to write tests that pass different dict implementations as arguments).
 
-This concludes our introduction to associative data structures in Elixir. You will find out that between keyword lists and maps, you will have the right tools to tackle many problems that require associative data structures in Elixir.
+This concludes our introduction to associative data structures in Elixir. You will find out that given keyword lists and maps, you will always have the right tool to tackle problems that require associative data structures in Elixir.

From 5ca3f8f394a0e1f5ddc4d0174fc5053bc23fef64 Mon Sep 17 00:00:00 2001
From: Ryan Levick <ryan@6wunderkinder.com>
Date: Sat, 29 Mar 2014 12:04:15 +0100
Subject: [PATCH 097/160] Small improvements to Chapter 8

---
 getting_started/8.markdown | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/getting_started/8.markdown b/getting_started/8.markdown
index 1d165898a..1c30f3f29 100644
--- a/getting_started/8.markdown
+++ b/getting_started/8.markdown
@@ -6,14 +6,14 @@ guide: 8
 
 # {{ page.title }}
 
-In Elixir, we group several functions into modules. In the previous chapters, we have used many different modules, like [the `String` module](/docs/stable/String.html):
+In Elixir we group several functions into modules. We've already used many different modules in the previous chapters like [the `String` module](/docs/stable/String.html):
 
 ```iex
 iex> String.length "hello"
 5
 ```
 
-In order to create our own modules in Elixir, we use the `defmodule` macro and `def` to define our functions:
+In order to create our own modules in Elixir, we use the `defmodule` macro. We use the `def` macro to define functions in that module:
 
 ```iex
 iex> defmodule Math do
@@ -26,7 +26,7 @@ iex> Math.sum(1, 2)
 3
 ```
 
-In the following sections, our examples are going to get a bit more complex and it can be tricky to type them all in the shell. It is about time for us to learn how to compile Elixir code and also how to run Elixir scripts.
+In the following sections, our examples are going to get a bit more complex, and it can be tricky to type them all in the shell. It's about time for us to learn how to compile Elixir code and also how to run Elixir scripts.
 
 ## 8.1 Compilation
 
@@ -44,7 +44,7 @@ This file can be compiled using `elixirc`:
 
     elixirc math.ex
 
-This will generate a file named `Elixir.Math.beam` containing the bytecode for the defined module. If we start `iex` again, our module definition will be available (considering `iex` is being started in the same directory the bytecode file is):
+This will generate a file named `Elixir.Math.beam` containing the bytecode for the defined module. If we start `iex` again, our module definition will be available (provided that `iex` is started in the same directory the bytecode file is in):
 
 ```iex
 iex> Math.sum(1, 2)
@@ -57,11 +57,11 @@ Elixir projects are usually organized into three directories:
 * lib - contains elixir code (usually `.ex` files)
 * test - contains tests (usually `.exs` files)
 
-When working on actual projects, our build tool called `mix` will be responsible to compile and set up the proper paths for you. For learning purposes, Elixir supports scripted modes, which is more flexible and does not generate any compiled artifacts.
+When working on actual projects, the build tool called `mix` will be responsible for compiling and setting up the proper paths for you. For learning purposes, Elixir also supports a scripted mode which is more flexible and does not generate any compiled artifacts.
 
 ## 8.2 Scripted mode
 
-In addition to the Elixir file extension `.ex`, Elixir also supports `.exs` files for scripting. Elixir treats both files exactly the same way, the only difference is in intention. `.ex` files are meant to be compiled while `.exs` files are used for scripting, without the need for compilation. For instance, one can create a file called `math.exs`:
+In addition to the Elixir file extension `.ex`, Elixir also supports `.exs` files for scripting. Elixir treats both files exactly the same way, the only difference is in intention. `.ex` files are meant to be compiled while `.exs` files are used for scripting, without the need for compilation. For instance, we can create a file called `math.exs`:
 
 ```elixir
 defmodule Math do
@@ -77,11 +77,11 @@ And execute it as:
 
     elixir math.exs
 
-The file will be compiled in memory and executed, printing "3" as the result. No bytecode file will be created. In the following examples, we recommend you to write your code into script files and execute them as shown above.
+The file will be compiled in memory and executed, printing "3" as the result. No bytecode file will be created. In the following examples, we recommend you write your code into script files and execute them as shown above.
 
 ## 8.3 Named functions
 
-Inside a module, we can define functions with `def/2` and private functions with `defp/2`. A function defined with `def/2` is available to be invoked from other modules while a private function can only be invoked locally.
+Inside a module, we can define functions with `def/2` and private functions with `defp/2`. A function defined with `def/2` can be invoked from other modules while a private function can only be invoked locally.
 
 ```elixir
 defmodule Math do
@@ -98,7 +98,7 @@ Math.sum(1, 2)    #=> 3
 Math.do_sum(1, 2) #=> ** (UndefinedFunctionError)
 ```
 
-Function declarations also support guards and multiple clauses. If a function has several clauses, Elixir will try each clause until it finds one that matches. Here is the implementation of a function that checks if the given number is zero or not:
+Function declarations also support guards and multiple clauses. If a function has several clauses, Elixir will try each clause until it finds one that matches. Here is an implementation of a function that checks if the given number is zero or not:
 
 ```elixir
 defmodule Math do
@@ -122,7 +122,7 @@ Giving an argument that does not match any of the clauses raises an error.
 
 ## 8.4 Function capturing
 
-Throughout this tutorial, we have been using the notation `name/arity` to refer to functions. It happens this notation can actually be used to retrieve a named function as a function type. Let's start `iex` and run the `math.exs` file defined above:
+Throughout this tutorial, we have been using the notation `name/arity` to refer to functions. It happens that this notation can actually be used to retrieve a named function as a function type. Let's start `iex` and run the `math.exs` file defined above:
 
     $ iex math.exs
 
@@ -137,7 +137,7 @@ iex> fun.(0)
 true
 ````
 
-Local or imported functions, like `is_function/1`, we can be captured without the module:
+Local or imported functions, like `is_function/1`, can be captured without the module:
 
 ```iex
 iex> &is_function/1
@@ -172,7 +172,7 @@ IO.puts Concat.join("Hello", "world")      #=> Hello world
 IO.puts Concat.join("Hello", "world", "_") #=> Hello_world
 ```
 
-Any expression is allowed to serve as a default value but it won't be evaluated during the function definition; it will simply be stored for later use. Every time the function is invoked and any of its default values have to be used, the expression for that default value will be evaluated:
+Any expression is allowed to serve as a default value, but it won't be evaluated during the function definition; it will simply be stored for later use. Every time the function is invoked and any of its default values have to be used, the expression for that default value will be evaluated:
 
 ```elixir
 defmodule DefaultTest do
@@ -246,4 +246,4 @@ iex> Concat.join "Hello", "world", "_"
 "Hello_world"
 ```
 
-This finishes our short introduction to modules. In the next chapters, we will learn how to use named functions for recursion, explore Elixir lexical directives that can be used for importing functions from other modules, as well as module attributes.
+This finishes our short introduction to modules. In the next chapters, we will learn how to use named functions for recursion, explore Elixir lexical directives that can be used for importing functions from other modules and discuss module attributes.

From 7103f67b7e67dcfa6bf61fe60b277bbf846d3e7b Mon Sep 17 00:00:00 2001
From: Ryan Levick <ryan@6wunderkinder.com>
Date: Sat, 29 Mar 2014 14:38:54 +0100
Subject: [PATCH 098/160] Rearrange chapters to bring more important topics up
 front

---
 getting_started/10.markdown | 191 ++++++++++-------------------
 getting_started/11.markdown | 208 +++++++++++++-------------------
 getting_started/12.markdown | 183 +++++++++++++++++++---------
 getting_started/13.markdown | 197 ++++++++++++++++++------------
 getting_started/14.markdown | 233 ++++++++++++++++++------------------
 getting_started/9.markdown  |   2 +-
 6 files changed, 509 insertions(+), 505 deletions(-)

diff --git a/getting_started/10.markdown b/getting_started/10.markdown
index ab895f2c5..b215817de 100644
--- a/getting_started/10.markdown
+++ b/getting_started/10.markdown
@@ -1,177 +1,112 @@
 ---
 layout: getting_started
-title: 10 alias, require and import
-guide: 10
+title: 12 Enumerables and Streams
+guide: 12
 ---
 
 # {{ page.title }}
 
-In order to facilitate software reuse, Elixir provides three directives. As we are going to see below, they are called directives because they have **lexical scope**.
+## 12.1 Enumerables
 
-### 10.1 alias
+Elixir provides the concept of enumerables and [the `Enum` module](/docs/stable/Enum.html) to work with them. We have already learned two enumerables: lists and maps.
 
-`alias` allows you to set up aliases for any given module name. Imagine our `Math` module uses a special list implementation for doing math specific operations:
-
-```elixir
-defmodule Math do
-  alias Math.List, as: List
-end
-```
-
-From now on, any reference to `List` will automatically expand to `Math.List`. In case one wants to access the original `List`, it can be done by accessing the module via `Elixir`:
-
-```elixir
-List.flatten             #=> uses Math.List.flatten
-Elixir.List.flatten      #=> uses List.flatten
-Elixir.Math.List.flatten #=> uses Math.List.flatten
-```
-
-> Note: All modules defined in Elixir are defined inside a main Elixir namespace. However, for convenience, you can omit "Elixir." when referencing them.
-
-Aliases are frequently used to define shortcuts. In fact, calling `alias` without an `as` option sets the alias automatically to the last part of the module name, for example:
-
-```elixir
-alias Math.List
-```
-
-Is the same as:
-
-```elixir
-alias Math.List, as: List
-```
-
-Note that `alias` is **lexically scoped**, which allows you to set aliases inside specific functions:
-
-```elixir
-defmodule Math do
-  def plus(a, b) do
-    alias Math.List
-    # ...
-  end
-
-  def minus(a, b) do
-    # ...
-  end
-end
+```iex
+iex> Enum.map([1, 2, 3], fn x -> x * 2 end)
+[2, 4, 6]
+iex> Enum.map(%{1 => 2, 3 => 4}, fn {k, v} -> k * v end)
+[2, 12]
 ```
 
-In the example above, since we are invoking `alias` inside the function `plus/2`, the alias will just be valid inside the function `plus/2`. `minus/2` won't be affected at all.
-
-### 10.2 require
+The `Enum` module provides a huge range of functions to transform, sort, group, filter and retrieve items from enumerables. It is one of the modules developers use frequently in their Elixir code.
 
-Elixir provides macros as a mechanism for meta-programming (writing code that generates code).
-
-Macros are chunks of code that are executed and expanded at compilation time. This means, in order to use a macro, we need to guarantee its module and implementation are available during compilation. This is done with the `require` directive:
+Elixir also provides ranges:
 
 ```iex
-iex> Integer.odd?(3)
-** (CompileError) iex:1: you must require Integer before invoking the macro Integer.odd?/1
-iex> require Integer
-nil
-iex> Integer.odd?(3)
-true
+iex> Enum.map(1..3, fn x -> x * 2 end)
+[2, 4, 6]
+iex> Enum.reduce(1..3, 0, &+/2)
+6
 ```
 
-In Elixir, `Integer.odd?/1` is defined as a macro so it can be used as guards. This means that, in order to invoke `Integer.odd?/1`, we need to first require the `Integer` module.
+Since the Enum module was designed to work across different data types, its API is limited to functions that are useful across many data types. For specific operations, you may need to reach to modules specific to the data types. For example, if you want to insert an element at a given position in a list, you should use the `List.insert_at/3` function from [the `List` module](/docs/stable/List.html), as it would make little sense to insert a value into, for example, a range.
 
-In general a module does not need to be required before usage, except if we want to use the macros available in that module. An attempt to call a macro that was not loaded will raise an error. Note that like the `alias` directive, `require` is also lexically scoped. We will talk more about macros in a later chapter.
+We say the functions in the `Enum` module are polymorphic because they can work with diverse data types. In particular, the functions in the `Enum` module can work with any data type that implements [the `Enumerable` protocol](/docs/stable/Enumerable.html). We are going to discuss Protocols in a later chapter, for now we are going to move on to a specific kind of enumerable called streams.
 
-### 10.3 import
+## 12.2 Eager vs Lazy
 
-We use `import` whenever we want to easily access functions or macros from other modules without using the qualified name. For instance, if we want to use the `duplicate` function from `List` several times, we can simply import it:
+All the functions in the `Enum` module are eager. Many functions expect an enumerable and return a list back:
 
 ```iex
-iex> import List, only: [duplicate: 2]
-nil
-iex> duplicate :ok, 3
-[:ok, :ok, :ok]
+iex> odd? = &(rem(&1, 2) != 0)
+#Function<6.80484245/1 in :erl_eval.expr/5>
+iex> Enum.filter(1..3, odd?)
+[1, 3]
 ```
 
-In this case, we are importing only the function `duplicate` (with arity 2) from `List`. Although `only:` is optional, its usage is recommended. `except` could also be given as an option.
-
-`import` also supports `:macros` and `:functions` to be given to `:only`. For example, to import all macros, one could write:
+This means that when performing multiple operations with `Enum`, each operation is going to generate an intermediate list until we reach the result:
 
-```elixir
-import Integer, only: :macros
+```iex
+iex> 1..100_000 |> Enum.map(&(&1 * 3)) |> Enum.filter(odd?) |> Enum.sum
+7500000000
 ```
 
-Or to import all functions, you could write:
-
-```elixir
-import Integer, only: :functions
-```
+The example above has a pipeline of operations. We start with a range and then multiply each element in the range by 3. This first operation will now create and return a list with `100_000` items. Then we keep all odd elements from the list, generating a new list, now with `50_000` items, and then we sum all entries.
 
-Note that `import` is also **lexically scoped**, this means we can import specific macros inside specific functions:
+As an alternative, Elixir provides [the `Stream` module](/docs/stable/Stream.html) which supports lazy operations:
 
-```elixir
-defmodule Math do
-  def some_function do
-    import List, only: [duplicate: 2]
-    # call duplicate
-  end
-end
+```iex
+iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(odd?) |> Enum.sum
+7500000000
 ```
 
-In the example above, the imported `List.duplicate/2` is only visible within that specific function. `duplicate/2` won't be available in any other function in that module (or any other module for that matter).
+Instead of generating intermediate lists, streams create a series of computations that are invoked only when we pass it to the `Enum` module. Streams are useful when working with large, *possibly infinite*, collections.
 
-Note that importing a module automatically requires it.
+## 12.3 Streams
 
-## 10.4 Aliases
+Streams are lazy, composable enumerables.
 
-At this point, you may be wondering, what exactly an Elixir alias is and how it is represented?
-
-An alias in Elixir is a capitalized identifier (like `String`, `Keyword`, etc) which is converted to an atom during compilation. For instance, the `String` alias translates by default to the atom `:"Elixir.String"`:
+They are lazy because, as shown in the example above, `1..100_000 |> Stream.map(&(&1 * 3))` returns a data type, an actual stream, that represents the `map` computation over the range `1..100_000`:
 
 ```iex
-iex> is_atom(String)
-true
-iex> to_string(String)
-"Elixir.String"
-iex> :"Elixir.String"
-String
+iex> 1..100_000 |> Stream.map(&(&1 * 3))
+#Stream<1..100_000, funs: [#Function<34.16982430/1 in Stream.map/2>]>
 ```
 
-By using the `alias/2` directive, we are simply changing what an alias translates to.
-
-Aliases work as described because in the Erlang VM (and consequently Elixir), modules are represented by atoms. For example, that's the mechanism we use to call Erlang modules:
+Furthermore, they are composable because we can pipe many stream operations:
 
 ```iex
-iex> :lists.flatten([1,[2],3])
-[1, 2, 3]
+iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(odd?)
+#Stream<1..100_000, funs: [...]>
 ```
 
-This is also the mechanism that allows us to dynamically call a given function in a module:
+Many functions in the `Stream` module accept any enumerable as argument and return a stream as result. It also provides functions for creating streams, possibly infinite. For example, `Stream.cycle/1` can be used to create a stream that cycles a given enumerable infinitely. Be careful to not call a function like `Enum.map/2` on such streams, as they would cycle forever:
 
-```iex
-iex> mod = :lists
-:lists
-iex> mod.flatten([1,[2],3])
-[1,2,3]
-```
+    ```iex
+    iex> stream = Stream.cycle([1, 2, 3])
+    #Function<15.16982430/2 in Stream.cycle/1>
+    iex> Enum.take(stream, 10)
+    [1, 2, 3, 1, 2, 3, 1, 2, 3, 1]
+    ```
 
-In other words, we are simply calling the function `flatten` on the atom `:lists`.
+On the other hand, `Stream.unfold/2` can be used to generate values from a given initial value:
 
-## 10.5 Nesting
+    ```iex
+    iex> stream = Stream.unfold("hełło", &String.next_codepoint/1)
+    #Function<15.16982430/2 in Stream.cycle/1>
+    iex> Enum.take(stream, 3)
+    ["h", "e", "ł"]
+    ```
 
-Now that we have talked about aliases, we can talk about nesting and how it works in Elixir. Consider the following example:
+Another interesting function is `Stream.resource/3` which can be used to wrap around resources, guaranteeing they are opened right before enumeration and closed afterwards, even in case of failures. For example, we can use it to stream a file:
 
-```elixir
-defmodule Foo do
-  defmodule Bar do
-  end
-end
+```iex
+iex> stream = File.stream!("path/to/file")
+#Function<18.16982430/2 in Stream.resource/3>
+iex> Enum.take(stream, 10)
 ```
 
-The example above will define two modules `Foo` and `Foo.Bar`. The second can be accessed as `Bar` inside `Foo` as long as they are in the same lexical scope. If later the developer decides to move `Bar` to another file, it will need to be referenced by its full name (`Foo.Bar`) or an alias needs to be set using the `alias` directive discussed above.
-
-In other words, the code above is exactly the same as:
+The example above will fetch the first 10 lines of the file you have selected. This means streams can be very useful for handling large files or even slow resources like network resources.
 
-```elixir
-defmodule Elixir.Foo do
-  defmodule Elixir.Foo.Bar do
-  end
-  alias Elixir.Foo.Bar, as: Bar
-end
-```
+The amount of functions and functionality in [`Enum`](/docs/stable/Enum.html) and [`Stream`](/docs/stable/Stream.html) modules can be daunting at first but you will get familiar with them case by case. In particular, focus on the `Enum` module first and only move to `Stream` for the particular scenarios where laziness is required to either deal with slow resources or large, possibly infinite, collections.
 
-As we will see in later chapters, aliases also play a crucial role in macros, to guarantee they are hygienic. With this we are almost finishing our tour about Elixir modules, the last topic to cover is module attributes.
+Next we'll look at a feature central to Elixir, Processes, which allow us to write concurrent, parallel and distributed programs in an easy and understandable way.
diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index 3f91e4ee4..658160f04 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -1,172 +1,130 @@
 ---
 layout: getting_started
-title: 11 Module attributes
-guide: 11
+title: 13 Processes
+guide: 13
 ---
 
 # {{ page.title }}
 
-Module attributes in Elixir serves three purposes:
+In Elixir, all of your code run inside processes. Those processes are isolated from each other and they communicate with message passing. In this chapter, we will learn about the basic constructs for spawning new processes, sending and receiving messages.
 
-1. They serve to annotate the module, often with information to be used by the user or the VM;
-2. They work as constants;
-3. They work as a temporary module storage to be used during compilation;
+## 13.1 spawn
 
-Let's check each case, one by one.
+The basic mechanism for spawning new processes is with the auto-imported `spawn/1` function:
 
-## 11.1 As annotations
-
-Elixir brings the concept of module attributes from Erlang. For example:
-
-```elixir
-defmodule MyServer do
-  @vsn 2
-end
+```iex
+iex> spawn fn -> 1 + 2 end
+#PID<0.43.0>
 ```
 
-In the example above, we are explicitly setting the version attribute for that module. `@vsn` is used by the code reloading mechanism in the Erlang VM to check if a module has been updated or not. If no version is specified, the version is set to the MD5 checksum of the module functions.
-
-Elixir has a handful of reserved attributes. Here are just a few of them, the most commonly used ones:
-
-* `@moduledoc` - provides documentation for the current module;
-* `@doc` - provides documentation for the function or macro that follows the attribute;
-* `@behaviour` - (notice the British spelling) used for specifying an OTP or user-defined behaviour;
-* `@before_compile` - provides a hook that will be invoked before the module is compiled. This makes it possible to inject functions inside the module exactly before compilation;
-
-`@moduledoc` and `@doc` are by far the most used attributes and we expect you to use them a lot. Elixir treats documentation as first-class and provide many functions to access documentation:
+Notice `spawn/1` returns a PID (process identifier). At this point, the process you spawned is very likely dead. The spawned process will execute the given function and exit after the function is done:
 
 ```iex
-iex> defmodule MyModule do
-...>  @moduledoc "It does **x**"
-...>
-...>  @doc """
-...>  Returns the version
-...>  """
-...>  def version, do: 1
-...> end
-{:module, MyModule, <<70, 79, 82, ...>>, {:version, 0}}
-iex> h MyModule
-* MyModule
-
-It does **x**
-
-iex> h MyModule.version
-* def version()
-
-Returns the version
-
+iex> pid = spawn fn -> 1 + 2 end
+#PID<0.44.0>
+iex> Process.alive?(pid)
+false
 ```
 
-Elixir promotes the use of markdown with heredocs to write readable documentation. Heredocs are multiline strings, they start and end with triple quotes, keeping the formatting of the inner text:
-
-```elixir
-defmodule Math do
-  @moduledoc """
-  This module provides mathematical functions
-  as sin, cos and constants like pi.
+> Note: you will likely get different process identifiers than the ones we are getting in this guide.
 
-  ## Examples
+We can retrieve the PID of the current process by calling `self/0`:
 
-      Math.pi
-      #=> 3.1415...
-
-  """
-end
+```iex
+iex> self()
+#PID<0.41.0>
+iex> Process.alive?(self())
+true
 ```
 
-We also provide a tool called [ExDoc](https://github.com/elixir-lang/ex_doc) which is used to generate HTML pages with the documentation.
-
-You can take a look at the docs for [Module](/docs/stable/Module.html) for a complete list of supported attributes. Elixir also uses attributes to define [typespecs](/docs/stable/Kernel.Typespec.html), via:
-
-* `@spec` - provides a specification for a function;
-* `@callback` - provides a specification for the behavior callback;
-* `@type` - defines a type to be used in `@spec`;
-* `@typep` - defines a private type to be used in `@spec`;
-* `@opaque` - defines an opaque type to be used in `@spec`;
+Processes get much more interesting when we are able to send and receive messages.
 
-This section covers built-in attributes. However, attributes can also be used by developers or extended by libraries to support custom behaviour.
+## 13.2 send and receive
 
-## 11.2 As constants
+We can send messages with `send/2` and receive them with `receive/1`:
 
-Elixir developers will often use module attributes to be used as constants:
-
-```elixir
-defmodule MyServer do
-  @initial_state %{host: "117.0.0.1", port: 3456}
-  IO.inspect @initial_state
-end
+```iex
+iex> send self(), {:hello, "world"}
+{:hello, "world"}
+iex> receive do
+...>   {:hello, msg}  -> msg
+...>   {:world, msg} -> "won't match"
+...> end
+"world"
 ```
 
-> Note: Unlike Erlang, user defined attributes are not stored in the module by default. The value exists only during compilation time. A developer can configure an attribute to behave closer to Erlang by calling [`Module.register_attribute/3`](/docs/stable/Module.html#register_attribute/3).
+When a message is sent to a process, the message is stored in the process mailbox. The `receive/2` block goes through the current process mailbox searching for a message that matches any of the given patterns. `receive/1` supports many clauses, like `case/2`, as well as guards in the clauses.
 
-Trying to access an attribute that was not defined will print a warning:
+If there is no message in the mailbox matching any of the patterns, the current process will wait until a matching message arrives. A timeout can also be specified:
 
-```elixir
-defmodule MyServer do
-  @unknown
-end
-warning: undefined module attribute @unknown, please remove access to @unknown or explicitly set it to nil before access
+```iex
+iex> receive do
+...>   {:hello, msg}  -> msg
+...> after
+...>   1_000 -> "nothing after 1s"
+...> end
+"nothing after 1s"
 ```
 
-Finally, attributes can also be read inside functions:
+A timeout of 0 can be given when you already expect the message to be in the mailbox.
 
-```elixir
-defmodule MyServer do
-  @my_data 11
-  def first_data, do: @my_data
-  @my_data 13
-  def second_data, do: @my_data
-end
+Let's put all together and send messages in between processes:
 
-MyServer.first_data #=> 11
-MyServer.second_data #=> 13
+```iex
+iex> parent = self()
+#PID<0.41.0>
+iex> spawn fn -> send(parent, {:hello, self()}) end
+#PID<0.48.0>
+iex> receive do
+...>   {:hello, pid} -> "Got hello from #{inspect pid}"
+...> end
+"Got hello from #PID<0.48.0>"
 ```
 
-Notice that reading an attribute inside a function takes a snapshot of its current value. In other words, the value is read at compilation time and not at runtime. As we are going to see, this makes attributes useful to be used as storage during the module compilation.
-
-## 11.3 As temporary storage
-
-One of the projects in the Elixir organization is [the `Plug` project](https://github.com/elixir-lang/plug), which is meant to be a common foundation for building web libraries and frameworks in Elixir.
+While in the shell, you may find the helper `flush/0` quite useful. It flushes and prints all the messages in the mailbox.
 
-The Plug library also allows developers to define their own plugs which can be run in a web server:
+```iex
+iex> send self(), :hello
+:hello
+iex> flush()
+:hello
+:ok
+```
 
-```elixir
-defmodule MyPlug do
-  use Plug.Builder
+Before we finish this chapter, let's talk about process links.
 
-  plug :set_header
-  plug :send_ok
+## 13.3 Links
 
-  def set_header(conn, _opts) do
-    put_resp_header(conn, "x-header", "set")
-  end
+The most common form of spawning in Elixir is actually via `spawn_link/1`. Before we show an example with `spawn_link/1`, let's try to see what happens when a process fail:
 
-  def send_ok(conn, _opts) do
-    send(conn, 200, "ok")
-  end
-end
-
-IO.puts "Running MyPlug with Cowboy on http://localhost:4000"
-Plug.Adapters.Cowboy.http MyPlug, []
+```iex
+iex> spawn fn -> raise "oops" end
+#PID<0.58.0>
 ```
 
-In the example above, we have used the `plug/1` macro to connect functions that will be invoked when there is a web request. Internally, every time you call `plug/1`, the Plug library stores the given arguments as a list in a `@plugs` attribute. At the end, before the module is compiled, Plug runs a callback that will then compile all `@plugs` into actual function calls.
+Well... nothing happened. That's because processes are isolated. If we want the failure in one process to propagate to another one, we should link them. This can be done with `spawn_link/1`:
 
-In order to understand the underlying code, we'd need macros, so we will revisit this pattern later on. However, the focus here is exactly on how using module attributes as storage allow developers to create DSLs.
+```iex
+iex> spawn_link fn -> raise "oops" end
+#PID<0.60.0>
+** (EXIT from #PID<0.60.0>) {RuntimeError[message: "oops"], [{:erlang, :apply, 2, []}]}
+```
 
-Another example comes from the ExUnit framework, that uses module attributes as annotation and storage:
+When a failure happens in the shell, the shell automatically traps the failure and shows it nicely formatted. In order to understand what would really happen in our code, let's use `spawn_link/1` inside a file and run it:
 
-```elixir
-defmodule MyTest do
-  use ExUnit.Case
+```iex
+# spawn.exs
+spawn_link fn -> raise "oops" end
 
-  @tag :external
-  test "contacts external service" do
-    # ...
-  end
+receive do
+  :hello -> "let's wait until the process fails"
 end
 ```
 
-Tags in ExUnit are used to annotate tests. Tags can be later used to filter tests, so you don't run external tests by default unless explicitly desired. Internally, those tags are stored in temporary module attributes, associating each test to their respective tags, so tests with particular tags can be later fetched and filtered by the test framework.
+This time the process failed and brought the parent process down as they are linked. Linking can also be done manually by calling `Process.link/2`. We recommend you to take a look at [the `Process` module](/docs/stable/Process.html) for other functionality provided by processes.
+
+Process and links play an important role when building fault-tolerant systems. In Elixir applications we often link our processes to supervisors which will detect when a process die and start a new process in its place. This is only possible because processes don't share anything by default so there is no way the crash of a process can corrupt the state of another process!
+
+While other languages would require us to catch/handle exceptions, in Elixir we are actually fine with letting process fail because we expect supervisors to properly restart our systems. "Failing fast" is a common philosophy when writing Elixir software!
 
-We hope this section shines some light on how Elixir supports meta-programming and how module attributes play an important role when doing so. In the next chapters, we will talk about some common modules in Elixir, like `IO` and `Enum`, before finally going into more advanced topics.
+Next we'll explore the world of IO.
diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index 0c1b78c3f..a40d92ec9 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -1,110 +1,175 @@
 ---
 layout: getting_started
-title: 12 Enumerables and Streams
-guide: 12
+title: 14 IO
+guide: 14
 ---
 
 # {{ page.title }}
 
-## 12.1 Enumerables
+This chapter is a quick introduction to input/output mechanisms in Elixir and related modules, like [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html) and [`Path`](/docs/stable/Path.html).
 
-Elixir provides the concept of enumerables and [the `Enum` module](/docs/stable/Enum.html) to work with them. We have already learned two enumerables: lists and maps.
+We have originally sketched this chapter to come much earlier in the getting started guide. However, we noticed the IO system provides a great opportunity to bring some philosophies and curiosities about Elixir and the VM.
+
+## 14.1 The IO module
+
+The `IO` module in Elixir is the main mechanism for reading and writing to the standard io (`:stdio`), standard error (`:stderr`), files and other IO devices. Usage of the module is pretty straight-forward:
 
 ```iex
-iex> Enum.map([1, 2, 3], fn x -> x * 2 end)
-[2, 4, 6]
-iex> Enum.map(%{1 => 2, 3 => 4}, fn {k, v} -> k * v end)
-[2, 12]
+iex> IO.puts "hello world"
+"hello world"
+:ok
+iex> IO.gets "yes or no? "
+yes or no? yes
+"yes\n"
 ```
 
-The `Enum` module provides a huge range of functions to transform, sort, group, filter and retrieve items from enumerables. It is one of the modules developers use frequently in their Elixir code.
-
-Elixir also provides ranges:
+By default, the functions in the IO module use the standard input and output. We can pass the `:stderr` as argument to write to the standard error device:
 
 ```iex
-iex> Enum.map(1..3, fn x -> x * 2 end)
-[2, 4, 6]
-iex> Enum.reduce(1..3, 0, &+/2)
-6
+iex> IO.puts :stderr, "hello world"
+"hello world"
+:ok
 ```
 
-Since the Enum module was designed to work across different data types, its API is limited to functions that are useful across many data types. For specific operations, you may need to reach to modules specific to the data types. For example, if you want to insert an element at a given position in a list, you should use the `List.insert_at/3` function from [the `List` module](/docs/stable/List.html), as it would make little sense to insert a value into, for example, a range.
+## 14.2 The File module
 
-We say the functions in the `Enum` module are polymorphic because they can work with diverse data types. In particular, the functions in the `Enum` module can work with any data type that implements [the `Enumerable` protocol](/docs/stable/Enumerable.html). We are going to discuss Protocols in a later chapter, for now we are going to move on to a specific kind of enumerable called streams.
+The [`File`](/docs/stable/File.html) module contains functions that allows us to open files as IO devices. By default, files are opened in binary mode, which requires developers to use the specific `IO.binread/2` and `IO.binwrite/2` functions from the `IO` module:
 
-## 12.2 Eager vs Lazy
+```iex
+iex> {:ok, file} = File.open "hello", [:write]
+{:ok, #PID<0.47.0>}
+iex> IO.binwrite file, "world"
+:ok
+iex> File.close file
+:ok
+iex> File.read "hello"
+{:ok, "world"}
+```
 
-All the functions in the `Enum` module are eager. Many functions expect an enumerable and return a list back:
+A file can also be opened with `:utf8` encoding which allows the remaining functions in the `IO` module to be used:
 
 ```iex
-iex> require Integer
-nil
-iex> Enum.filter(1..3, &Integer.odd?/1)
-[1, 3]
+iex> {:ok, file} = File.open "another", [:write, :utf8]
+{:ok, #PID<0.48.0>}
 ```
 
-This means that when performing multiple operations with `Enum`, each operation is going to generate an intermediate list until we reach the result:
+Besides functions for opening, reading and writing files, the `File` module has many functions that work on the filesystem. Those functions are named after their UNIX equivalents. For example, `File.rm/1` can be used to remove files, `File.mkdir/1` to create directories, `File.mkdir_p/1` creates directories guaranteeing their parents exists and there is even `File.cp_r/2` and `File.rm_rf/2` which copy and remove files and directories recursively.
+
+You will also notice that functions in the `File` module have two variants, one with `!` (bang) in its name and others without. For example, when we read the "hello" file above, we have used the one without `!`. Let's try some new examples:
 
 ```iex
-iex> 1..100_000 |> Enum.map(&(&1 * 3)) |> Enum.filter(&Integer.odd?/1) |> Enum.sum
-7500000000
+iex> File.read "hello"
+{:ok, "world"}
+iex> File.read! "hello"
+"world"
+iex> File.read "unknwon"
+{:error, :enoent}
+iex> File.read! "unknown"
+** (File.Error) could not read file unknown: no such file or directory
+```
+
+Notice that when the file does not exist, the version with `!` raises an error. That said, the version without `!` is preferred when you want to handle different outcomes with pattern matching. However, if you expect the file to be there, the bang variation is more useful as it raises a meaningful error message. That said, never write:
+
+```elixir
+{:ok, body} = File.read(file)
+```
+
+Instead write:
+
+```elixir
+case File.read(file) do
+  {:ok, body} -> # handle ok
+  {:error, r} -> # handle error
+end
+```
+
+or
+
+```elixir
+File.read!(file)
 ```
 
-The example above has a pipeline of operations. We start with a range and then multiply each element in the range by 3. This first operation will now create and return a list with `100_000` items. Then we keep all odd elements from the list, generating a new list, now with `50_000` items, and then we sum all entries.
+## 14.3 The Path module
 
-As an alternative, Elixir provides [the `Stream` module](/docs/stable/Stream.html) which supports lazy operations:
+The majority of the functions in the File module expects paths as arguments. Most commonly, those paths will be binaries and they can be manipulated with the [`Path`](/docs/stable/Path.html) module:
 
 ```iex
-iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(&Integer.odd?/1) |> Enum.sum
-7500000000
+iex> Path.join("foo", "bar")
+"foo/bar"
+iex> Path.expand("~/hello")
+"/Users/jose/hello"
 ```
 
-Instead of generating intermediate lists, streams create a series of computations that are invoked only when we pass it to the `Enum` module. Streams are useful when working with large, *possibly infinite*, collections.
+With this, we have covered the main modules for doing IO and interacting with the filesystem. However there are some advanced topics to discuss regarding IO but feel free to skip them if you are in a hurry.
 
-## 12.3 Streams
+## 14.4 Processes and group leaders
 
-Streams are lazy, composable enumerables.
+You may have noticed that `File.open/2` returned a tuple containing a PID:
 
-They are lazy because, as shown in the example above, `1..100_000 |> Stream.map(&(&1 * 3))` returns a data type, an actual stream, that represents the `map` computation over the range `1..100_000`:
+```iex
+iex> {:ok, file} = File.open "hello", [:write]
+{:ok, #PID<0.47.0>}
+```
+
+That's because the IO module actually works with processes. When you say `IO.write(pid, binary)`, the IO module will send a message to the process to the desired operation. Let's see what happens if we use our own process:
 
 ```iex
-iex> 1..100_000 |> Stream.map(&(&1 * 3))
-#Stream<1..100_000, funs: [#Function<34.16982430/1 in Stream.map/2>]>
+iex> pid = spawn fn ->
+...>  receive do: (msg -> IO.inspect msg)
+...> end
+#PID<0.57.0>
+iex> IO.write(pid, "hello")
+{:io_request, #PID<0.41.0>, #PID<0.57.0>, {:put_chars, :unicode, "hello"}}
+** (ErlangError) erlang error: :terminated
 ```
 
-Furthermore, they are composable because we can pipe many stream operations:
+After `IO.write/2`, we can see the request sent by the IO module printed, which then fails since the IO module expected some kind of result, which we did not supply.
+
+The [`StringIO`](/docs/stable/StringIO.html) module provides an implementation of the IO device messages on top of a string:
 
 ```iex
-iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(&Integer.odd?/1)
-#Stream<1..100_000, funs: [...]>
+iex> {:ok, pid} = StringIO.start("hello")
+{:ok, #PID<0.43.0>}
+iex> IO.read(pid, 2)
+"he"
 ```
 
-Many functions in the `Stream` module accept any enumerable as argument and return a stream as result. It also provides functions for creating streams, possibly infinite. For example, `Stream.cycle/1` can be used to create a stream that cycles a given enumerable infinitely. Be careful to not call a function like `Enum.map/2` on such streams, as they would cycle forever:
+By modelling IO devices with processes, the Erlang VM allows different nodes in the same network to exchange file processes and read/write files in between nodes. Of all IO devices, there is one that is special to each process, called group leader.
 
-    ```iex
-    iex> stream = Stream.cycle([1, 2, 3])
-    #Function<15.16982430/2 in Stream.cycle/1>
-    iex> Enum.take(stream, 10)
-    [1, 2, 3, 1, 2, 3, 1, 2, 3, 1]
-    ```
+When you write to `:stdio`, you are actually sending a message to the group leader, which writes to `:stdio`:
 
-On the other hand, `Stream.unfold/2` can be used to generate values from a given initial value:
+```iex
+iex> IO.puts :stdio, "hello"
+hello
+:ok
+iex> IO.puts Process.group_leader, "hello"
+hello
+:ok
+```
+
+The group leader can be configured per process and is used in different situations, for example, when executing code in remote nodes, it guarantees messages printed in the remote node are redirected and printed in the "executor" one.
+
+## 14.5 `iodata` and `char_data`
 
-    ```iex
-    iex> stream = Stream.unfold("hełło", &String.next_codepoint/1)
-    #Function<15.16982430/2 in Stream.cycle/1>
-    iex> Enum.take(stream, 3)
-    ["h", "e", "ł"]
-    ```
+In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
 
-Another interesting function is `Stream.resource/3` which can be used to wrap around resources, guaranteeing they are opened right before enumeration and closed afterwards, even in case of failures. For example, we can use it to stream a file:
+The functions in `IO` and `File` also allow lists to given as arguments. Not only that, they also allow a mixed list of lists, integers and binaries to be given:
 
 ```iex
-iex> stream = File.stream!("path/to/file")
-#Function<18.16982430/2 in Stream.resource/3>
-iex> Enum.take(stream, 10)
+iex> IO.puts 'hello world'
+hello world
+:ok
+iex> IO.puts ['hello', ?\s, "world"]
+hello world
+:ok
 ```
 
-The example above will fetch the first 10 lines of the file you have selected. This means streams can be very useful for handling large files or even slow resources like network resources.
+However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
+
+On the other hand, `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
+
+Although this is a subtle difference, you only need to worry about those details if you intend to pass lists to those functions. Binaries are already represented by the underlying bytes and as such their representation is always raw.
+
+When working with iodata and char data, Elixir provides `iodata_to_binary/1` to convert any `iodata` to binary. The functions `String.from_char_data!/1` and `List.from_char_data!/1` can be used to convert char data into strings or char lists respectively. Unless you are working closely with some devices, you will rarely need to use those functions.
 
-The amount of functions and functionality in [`Enum`](/docs/stable/Enum.html) and [`Stream`](/docs/stable/Stream.html) modules can be daunting at first but you will get familiar with them case by case. In particular, focus on the `Enum` module first and only move to `Stream` for the particular scenarios where laziness is required to either deal with slow resources or large, possibly infinite, collections.
+This finishes our tour on IO devices and IO related functionality. We have learned about four Elixir modules, [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html), [`Path`](/docs/stable/Path.html) and [`StringIO`](/docs/stable/StringIO.html), as well as how the VM uses processes for the underlying IO mechanisms and how to use (char and io) lists for IO operations.
diff --git a/getting_started/13.markdown b/getting_started/13.markdown
index e85e569e6..ab895f2c5 100644
--- a/getting_started/13.markdown
+++ b/getting_started/13.markdown
@@ -1,128 +1,177 @@
 ---
 layout: getting_started
-title: 13 Processes
-guide: 13
+title: 10 alias, require and import
+guide: 10
 ---
 
 # {{ page.title }}
 
-In Elixir, all of your code run inside processes. Those processes are isolated from each other and they communicate with message passing. In this chapter, we will learn about the basic constructs for spawning new processes, sending and receiving messages.
+In order to facilitate software reuse, Elixir provides three directives. As we are going to see below, they are called directives because they have **lexical scope**.
 
-## 13.1 spawn
+### 10.1 alias
 
-The basic mechanism for spawning new processes is with the auto-imported `spawn/1` function:
+`alias` allows you to set up aliases for any given module name. Imagine our `Math` module uses a special list implementation for doing math specific operations:
 
-```iex
-iex> spawn fn -> 1 + 2 end
-#PID<0.43.0>
+```elixir
+defmodule Math do
+  alias Math.List, as: List
+end
 ```
 
-Notice `spawn/1` returns a PID (process identifier). At this point, the process you spawned is very likely dead. The spawned process will execute the given function and exit after the function is done:
+From now on, any reference to `List` will automatically expand to `Math.List`. In case one wants to access the original `List`, it can be done by accessing the module via `Elixir`:
 
-```iex
-iex> pid = spawn fn -> 1 + 2 end
-#PID<0.44.0>
-iex> Process.alive?(pid)
-false
+```elixir
+List.flatten             #=> uses Math.List.flatten
+Elixir.List.flatten      #=> uses List.flatten
+Elixir.Math.List.flatten #=> uses Math.List.flatten
 ```
 
-> Note: you will likely get different process identifiers than the ones we are getting in this guide.
+> Note: All modules defined in Elixir are defined inside a main Elixir namespace. However, for convenience, you can omit "Elixir." when referencing them.
 
-We can retrieve the PID of the current process by calling `self/0`:
+Aliases are frequently used to define shortcuts. In fact, calling `alias` without an `as` option sets the alias automatically to the last part of the module name, for example:
 
-```iex
-iex> self()
-#PID<0.41.0>
-iex> Process.alive?(self())
-true
+```elixir
+alias Math.List
 ```
 
-Processes get much more interesting when we are able to send and receive messages.
+Is the same as:
 
-## 13.2 send and receive
+```elixir
+alias Math.List, as: List
+```
 
-We can send messages with `send/2` and receive them with `receive/1`:
+Note that `alias` is **lexically scoped**, which allows you to set aliases inside specific functions:
 
-```iex
-iex> send self(), {:hello, "world"}
-{:hello, "world"}
-iex> receive do
-...>   {:hello, msg}  -> msg
-...>   {:world, msg} -> "won't match"
-...> end
-"world"
+```elixir
+defmodule Math do
+  def plus(a, b) do
+    alias Math.List
+    # ...
+  end
+
+  def minus(a, b) do
+    # ...
+  end
+end
 ```
 
-When a message is sent to a process, the message is stored in the process mailbox. The `receive/2` block goes through the current process mailbox searching for a message that matches any of the given patterns. `receive/1` supports many clauses, like `case/2`, as well as guards in the clauses.
+In the example above, since we are invoking `alias` inside the function `plus/2`, the alias will just be valid inside the function `plus/2`. `minus/2` won't be affected at all.
 
-If there is no message in the mailbox matching any of the patterns, the current process will wait until a matching message arrives. A timeout can also be specified:
+### 10.2 require
+
+Elixir provides macros as a mechanism for meta-programming (writing code that generates code).
+
+Macros are chunks of code that are executed and expanded at compilation time. This means, in order to use a macro, we need to guarantee its module and implementation are available during compilation. This is done with the `require` directive:
 
 ```iex
-iex> receive do
-...>   {:hello, msg}  -> msg
-...> after
-...>   1_000 -> "nothing after 1s"
-...> end
-"nothing after 1s"
+iex> Integer.odd?(3)
+** (CompileError) iex:1: you must require Integer before invoking the macro Integer.odd?/1
+iex> require Integer
+nil
+iex> Integer.odd?(3)
+true
 ```
 
-A timeout of 0 can be given when you already expect the message to be in the mailbox.
+In Elixir, `Integer.odd?/1` is defined as a macro so it can be used as guards. This means that, in order to invoke `Integer.odd?/1`, we need to first require the `Integer` module.
+
+In general a module does not need to be required before usage, except if we want to use the macros available in that module. An attempt to call a macro that was not loaded will raise an error. Note that like the `alias` directive, `require` is also lexically scoped. We will talk more about macros in a later chapter.
 
-Let's put all together and send messages in between processes:
+### 10.3 import
+
+We use `import` whenever we want to easily access functions or macros from other modules without using the qualified name. For instance, if we want to use the `duplicate` function from `List` several times, we can simply import it:
 
 ```iex
-iex> parent = self()
-#PID<0.41.0>
-iex> spawn fn -> send(parent, {:hello, self()}) end
-#PID<0.48.0>
-iex> receive do
-...>   {:hello, pid} -> "Got hello from #{inspect pid}"
-...> end
-"Got hello from #PID<0.48.0>"
+iex> import List, only: [duplicate: 2]
+nil
+iex> duplicate :ok, 3
+[:ok, :ok, :ok]
 ```
 
-While in the shell, you may find the helper `flush/0` quite useful. It flushes and prints all the messages in the mailbox.
+In this case, we are importing only the function `duplicate` (with arity 2) from `List`. Although `only:` is optional, its usage is recommended. `except` could also be given as an option.
 
-```iex
-iex> send self(), :hello
-:hello
-iex> flush()
-:hello
-:ok
+`import` also supports `:macros` and `:functions` to be given to `:only`. For example, to import all macros, one could write:
+
+```elixir
+import Integer, only: :macros
+```
+
+Or to import all functions, you could write:
+
+```elixir
+import Integer, only: :functions
 ```
 
-Before we finish this chapter, let's talk about process links.
+Note that `import` is also **lexically scoped**, this means we can import specific macros inside specific functions:
+
+```elixir
+defmodule Math do
+  def some_function do
+    import List, only: [duplicate: 2]
+    # call duplicate
+  end
+end
+```
 
-## 13.3 Links
+In the example above, the imported `List.duplicate/2` is only visible within that specific function. `duplicate/2` won't be available in any other function in that module (or any other module for that matter).
 
-The most common form of spawning in Elixir is actually via `spawn_link/1`. Before we show an example with `spawn_link/1`, let's try to see what happens when a process fail:
+Note that importing a module automatically requires it.
+
+## 10.4 Aliases
+
+At this point, you may be wondering, what exactly an Elixir alias is and how it is represented?
+
+An alias in Elixir is a capitalized identifier (like `String`, `Keyword`, etc) which is converted to an atom during compilation. For instance, the `String` alias translates by default to the atom `:"Elixir.String"`:
 
 ```iex
-iex> spawn fn -> raise "oops" end
-#PID<0.58.0>
+iex> is_atom(String)
+true
+iex> to_string(String)
+"Elixir.String"
+iex> :"Elixir.String"
+String
 ```
 
-Well... nothing happened. That's because processes are isolated. If we want the failure in one process to propagate to another one, we should link them. This can be done with `spawn_link/1`:
+By using the `alias/2` directive, we are simply changing what an alias translates to.
+
+Aliases work as described because in the Erlang VM (and consequently Elixir), modules are represented by atoms. For example, that's the mechanism we use to call Erlang modules:
 
 ```iex
-iex> spawn_link fn -> raise "oops" end
-#PID<0.60.0>
-** (EXIT from #PID<0.60.0>) {RuntimeError[message: "oops"], [{:erlang, :apply, 2, []}]}
+iex> :lists.flatten([1,[2],3])
+[1, 2, 3]
 ```
 
-When a failure happens in the shell, the shell automatically traps the failure and shows it nicely formatted. In order to understand what would really happen in our code, let's use `spawn_link/1` inside a file and run it:
+This is also the mechanism that allows us to dynamically call a given function in a module:
 
 ```iex
-# spawn.exs
-spawn_link fn -> raise "oops" end
+iex> mod = :lists
+:lists
+iex> mod.flatten([1,[2],3])
+[1,2,3]
+```
+
+In other words, we are simply calling the function `flatten` on the atom `:lists`.
+
+## 10.5 Nesting
 
-receive do
-  :hello -> "let's wait until the process fails"
+Now that we have talked about aliases, we can talk about nesting and how it works in Elixir. Consider the following example:
+
+```elixir
+defmodule Foo do
+  defmodule Bar do
+  end
 end
 ```
 
-This time the process failed and brought the parent process down as they are linked. Linking can also be done manually by calling `Process.link/2`. We recommend you to take a look at [the `Process` module](/docs/stable/Process.html) for other functionality provided by processes.
+The example above will define two modules `Foo` and `Foo.Bar`. The second can be accessed as `Bar` inside `Foo` as long as they are in the same lexical scope. If later the developer decides to move `Bar` to another file, it will need to be referenced by its full name (`Foo.Bar`) or an alias needs to be set using the `alias` directive discussed above.
+
+In other words, the code above is exactly the same as:
 
-Process and links play an important role when building fault-tolerant systems. In Elixir applications we often link our processes to supervisors which will detect when a process die and start a new process in its place. This is only possible because processes don't share anything by default so there is no way the crash of a process can corrupt the state of another process!
+```elixir
+defmodule Elixir.Foo do
+  defmodule Elixir.Foo.Bar do
+  end
+  alias Elixir.Foo.Bar, as: Bar
+end
+```
 
-While other languages would require us to catch/handle exceptions, in Elixir we are actually fine with letting process fail because we expect supervisors to properly restart our systems. "Failing fast" is a common philosophy when writing Elixir software!
+As we will see in later chapters, aliases also play a crucial role in macros, to guarantee they are hygienic. With this we are almost finishing our tour about Elixir modules, the last topic to cover is module attributes.
diff --git a/getting_started/14.markdown b/getting_started/14.markdown
index bfdf3a815..a890d2bb9 100644
--- a/getting_started/14.markdown
+++ b/getting_started/14.markdown
@@ -1,177 +1,174 @@
 ---
 layout: getting_started
-title: 14 IO
-guide: 14
+title: 11 Module attributes
+guide: 11
 ---
 
 # {{ page.title }}
 
-This chapter is a quick introduction to input/output mechanisms in Elixir and related modules, like [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html) and [`Path`](/docs/stable/Path.html).
+Module attributes in Elixir serves three purposes:
 
-We have originally sketched this chapter to come much earlier in the getting started guide. However, we noticed the IO system provides a great opportunity to bring some philosophies and curiosities about Elixir and the VM.
+1. They serve to annotate the module, often with information to be used by the user or the VM;
+2. They work as constants;
+3. They work as a temporary module storage to be used during compilation;
 
-## 14.1 The IO module
+Let's check each case, one by one.
 
-The `IO` module in Elixir is the main mechanism for reading and writing to the standard io (`:stdio`), standard error (`:stderr`), files and other IO devices. Usage of the module is pretty straight-forward:
+## 11.1 As annotations
 
-```iex
-iex> IO.puts "hello world"
-"hello world"
-:ok
-iex> IO.gets "yes or no? "
-yes or no? yes
-"yes\n"
-```
-
-By default, the functions in the IO module use the standard input and output. We can pass the `:stderr` as argument to write to the standard error device:
+Elixir brings the concept of module attributes from Erlang. For example:
 
-```iex
-iex> IO.puts :stderr, "hello world"
-"hello world"
-:ok
+```elixir
+defmodule MyServer do
+  @vsn 2
+end
 ```
 
-## 14.2 The File module
+In the example above, we are explicitly setting the version attribute for that module. `@vsn` is used by the code reloading mechanism in the Erlang VM to check if a module has been updated or not. If no version is specified, the version is set to the MD5 checksum of the module functions.
 
-The [`File`](/docs/stable/File.html) module contains functions that allows us to open files as IO devices. By default, files are opened in binary mode, which requires developers to use the specific `IO.binread/2` and `IO.binwrite/2` functions from the `IO` module:
+Elixir has a handful of reserved attributes. Here are just a few of them, the most commonly used ones:
 
-```iex
-iex> {:ok, file} = File.open "hello", [:write]
-{:ok, #PID<0.47.0>}
-iex> IO.binwrite file, "world"
-:ok
-iex> File.close file
-:ok
-iex> File.read "hello"
-{:ok, "world"}
-```
+* `@moduledoc` - provides documentation for the current module;
+* `@doc` - provides documentation for the function or macro that follows the attribute;
+* `@behaviour` - (notice the British spelling) used for specifying an OTP or user-defined behaviour;
+* `@before_compile` - provides a hook that will be invoked before the module is compiled. This makes it possible to inject functions inside the module exactly before compilation;
 
-A file can also be opened with `:utf8` encoding which allows the remaining functions in the `IO` module to be used:
+`@moduledoc` and `@doc` are by far the most used attributes and we expect you to use them a lot. Elixir treats documentation as first-class and provide many functions to access documentation:
 
 ```iex
-iex> {:ok, file} = File.open "another", [:write, :utf8]
-{:ok, #PID<0.48.0>}
-```
-
-Besides functions for opening, reading and writing files, the `File` module has many functions that work on the filesystem. Those functions are named after their UNIX equivalents. For example, `File.rm/1` can be used to remove files, `File.mkdir/1` to create directories, `File.mkdir_p/1` creates directories guaranteeing their parents exists and there is even `File.cp_r/2` and `File.rm_rf/2` which copy and remove files and directories recursively.
+iex> defmodule MyModule do
+...>  @moduledoc "It does **x**"
+...>
+...>  @doc """
+...>  Returns the version
+...>  """
+...>  def version, do: 1
+...> end
+{:module, MyModule, <<70, 79, 82, ...>>, {:version, 0}}
+iex> h MyModule
+* MyModule
 
-You will also notice that functions in the `File` module have two variants, one with `!` (bang) in its name and others without. For example, when we read the "hello" file above, we have used the one without `!`. Let's try some new examples:
+It does **x**
 
-```iex
-iex> File.read "hello"
-{:ok, "world"}
-iex> File.read! "hello"
-"world"
-iex> File.read "unknwon"
-{:error, :enoent}
-iex> File.read! "unknown"
-** (File.Error) could not read file unknown: no such file or directory
-```
+iex> h MyModule.version
+* def version()
 
-Notice that when the file does not exist, the version with `!` raises an error. That said, the version without `!` is preferred when you want to handle different outcomes with pattern matching. However, if you expect the file to be there, the bang variation is more useful as it raises a meaningful error message. That said, never write:
+Returns the version
 
-```elixir
-{:ok, body} = File.read(file)
 ```
 
-Instead write:
+Elixir promotes the use of markdown with heredocs to write readable documentation. Heredocs are multiline strings, they start and end with triple quotes, keeping the formatting of the inner text:
 
 ```elixir
-case File.read(file) do
-  {:ok, body} -> # handle ok
-  {:error, r} -> # handle error
-end
-```
+defmodule Math do
+  @moduledoc """
+  This module provides mathematical functions
+  as sin, cos and constants like pi.
 
-or
+  ## Examples
 
-```elixir
-File.read!(file)
+      Math.pi
+      #=> 3.1415...
+
+  """
+end
 ```
 
-## 14.3 The Path module
+We also provide a tool called [ExDoc](https://github.com/elixir-lang/ex_doc) which is used to generate HTML pages with the documentation.
 
-The majority of the functions in the File module expects paths as arguments. Most commonly, those paths will be binaries and they can be manipulated with the [`Path`](/docs/stable/Path.html) module:
+You can take a look at the docs for [Module](/docs/stable/Module.html) for a complete list of supported attributes. Elixir also uses attributes to define [typespecs](/docs/stable/Kernel.Typespec.html), via:
 
-```iex
-iex> Path.join("foo", "bar")
-"foo/bar"
-iex> Path.expand("~/hello")
-"/Users/jose/hello"
-```
+* `@spec` - provides a specification for a function;
+* `@callback` - provides a specification for the behavior callback;
+* `@type` - defines a type to be used in `@spec`;
+* `@typep` - defines a private type to be used in `@spec`;
+* `@opaque` - defines an opaque type to be used in `@spec`;
 
-With this, we have covered the main modules for doing IO and interacting with the filesystem. However there are some advanced topics to discuss regarding IO but feel free to skip them if you are in a hurry.
+This section covers built-in attributes. However, attributes can also be used by developers or extended by libraries to support custom behaviour.
 
-## 14.4 Processes and group leaders
+## 11.2 As constants
 
-You may have noticed that `File.open/2` returned a tuple containing a PID:
+Elixir developers will often use module attributes to be used as constants:
 
-```iex
-iex> {:ok, file} = File.open "hello", [:write]
-{:ok, #PID<0.47.0>}
+```elixir
+defmodule MyServer do
+  @initial_state %{host: "117.0.0.1", port: 3456}
+  IO.inspect @initial_state
+end
 ```
 
-That's because the IO module actually works with processes. When you say `IO.write(pid, binary)`, the IO module will send a message to the process to the desired operation. Let's see what happens if we use our own process:
+> Note: Unlike Erlang, user defined attributes are not stored in the module by default. The value exists only during compilation time. A developer can configure an attribute to behave closer to Erlang by calling [`Module.register_attribute/3`](/docs/stable/Module.html#register_attribute/3).
 
-```iex
-iex> pid = spawn fn ->
-...>  receive do: (msg -> IO.inspect msg)
-...> end
-#PID<0.57.0>
-iex> IO.write(pid, "hello")
-{:io_request, #PID<0.41.0>, #PID<0.57.0>, {:put_chars, :unicode, "hello"}}
-** (ErlangError) erlang error: :terminated
+Trying to access an attribute that was not defined will print a warning:
+
+```elixir
+defmodule MyServer do
+  @unknown
+end
+warning: undefined module attribute @unknown, please remove access to @unknown or explicitly set it to nil before access
 ```
 
-After `IO.write/2`, we can see the request sent by the IO module printed, which then fails since the IO module expected some kind of result, which we did not supply.
+Finally, attributes can also be read inside functions:
 
-The [`StringIO`](/docs/stable/StringIO.html) module provides an implementation of the IO device messages on top of a string:
+```elixir
+defmodule MyServer do
+  @my_data 11
+  def first_data, do: @my_data
+  @my_data 13
+  def second_data, do: @my_data
+end
 
-```iex
-iex> {:ok, pid} = StringIO.start("hello")
-{:ok, #PID<0.43.0>}
-iex> IO.read(pid, 2)
-"he"
+MyServer.first_data #=> 11
+MyServer.second_data #=> 13
 ```
 
-By modelling IO devices with processes, the Erlang VM allows different nodes in the same network to exchange file processes and read/write files in between nodes. Of all IO devices, there is one that is special to each process, called group leader.
+Notice that reading an attribute inside a function takes a snapshot of its current value. In other words, the value is read at compilation time and not at runtime. As we are going to see, this makes attributes useful to be used as storage during the module compilation.
 
-When you write to `:stdio`, you are actually sending a message to the group leader, which writes to `:stdio`:
+## 11.3 As temporary storage
 
-```iex
-iex> IO.puts :stdio, "hello"
-hello
-:ok
-iex> IO.puts Process.group_leader, "hello"
-hello
-:ok
-```
+One of the projects in the Elixir organization is [the `Plug` project](https://github.com/elixir-lang/plug), which is meant to be a common foundation for building web libraries and frameworks in Elixir.
 
-The group leader can be configured per process and is used in different situations, for example, when executing code in remote nodes, it guarantees messages printed in the remote node are redirected and printed in the "executor" one.
+The Plug library also allows developers to define their own plugs which can be run in a web server:
 
-## 14.5 `iodata` and `char_data`
+```elixir
+defmodule MyPlug do
+  use Plug.Builder
 
-In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
+  plug :set_header
+  plug :send_ok
 
-The functions in `IO` and `File` also allow lists to given as arguments. Not only that, they also allow a mixed list of lists, integers and binaries to be given:
+  def set_header(conn, _opts) do
+    put_resp_header(conn, "x-header", "set")
+  end
 
-```iex
-iex> IO.puts 'hello world'
-hello world
-:ok
-iex> IO.puts ['hello', ?\s, "world"]
-hello world
-:ok
+  def send_ok(conn, _opts) do
+    send(conn, 200, "ok")
+  end
+end
+
+IO.puts "Running MyPlug with Cowboy on http://localhost:4000"
+Plug.Adapters.Cowboy.http MyPlug, []
 ```
 
-However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
+In the example above, we have used the `plug/1` macro to connect functions that will be invoked when there is a web request. Internally, every time you call `plug/1`, the Plug library stores the given arguments as a list in a `@plugs` attribute. At the end, before the module is compiled, Plug runs a callback that will then compile all `@plugs` into actual function calls.
 
-On the other hand, `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
+In order to understand the underlying code, we'd need macros, so we will revisit this pattern later on. However, the focus here is exactly on how using module attributes as storage allow developers to create DSLs.
 
-Although this is a subtle difference, you only need to worry about those details if you intend to pass lists to those functions. Binaries are already represented by the underlying bytes and as such their representation is always raw.
+Another example comes from the ExUnit framework, that uses module attributes as annotation and storage:
+
+```elixir
+defmodule MyTest do
+  use ExUnit.Case
+
+  @tag :external
+  test "contacts external service" do
+    # ...
+  end
+end
+```
 
-When working with iodata and char data, Elixir provides `iodata_to_binary/1` to convert any `iodata` to binary. The functions `String.from_char_data!/1` and `List.from_char_data!/1` can be used to convert char data into strings or char lists respectively. Unless you are working closely with some devices, you will rarely need to use those functions.
+Tags in ExUnit are used to annotate tests. Tags can be later used to filter tests, so you don't run external tests by default unless explicitly desired. Internally, those tags are stored in temporary module attributes, associating each test to their respective tags, so tests with particular tags can be later fetched and filtered by the test framework.
 
-This finishes our tour on IO devices and IO related functionality. We have learned about four Elixir modules, [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html), [`Path`](/docs/stable/Path.html) and [`StringIO`](/docs/stable/StringIO.html), as well as how the VM uses processes for the underlying IO mechanisms and how to use (char and io) lists for IO operations.
+We hope this section shines some light on how Elixir supports meta-programming and how module attributes play an important role when doing so.
 
-In the next chapters, we will explore structs and protocols, before moving to exception handling and other constructs like sigils and comprehensions.
+In the next chapters we'll explore structs and protocols before moving to exception handling and other constructs like sigils and comprehensions.
diff --git a/getting_started/9.markdown b/getting_started/9.markdown
index d32b7d1d3..b515b9bbe 100644
--- a/getting_started/9.markdown
+++ b/getting_started/9.markdown
@@ -113,4 +113,4 @@ iex> Enum.map([1, 2, 3], &(&1 * 2))
 [2, 4, 6]
 ```
 
-We will learn more about Enumerables in the "Enumerables and streams" chapter.
+Next we'll take a deeper look at Enumerables and Streams.

From e9bdc309ae6cce422540b4e0c57ee0cbba2c2a9a Mon Sep 17 00:00:00 2001
From: parroty <parroty00@gmail.com>
Date: Sat, 29 Mar 2014 23:17:59 +0900
Subject: [PATCH 099/160] Minor fixes for meta section of getting_started guide

---
 getting_started/meta/1.markdown | 6 +++---
 getting_started/meta/2.markdown | 6 ++++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/getting_started/meta/1.markdown b/getting_started/meta/1.markdown
index 32dffe7d1..d5fc87d49 100644
--- a/getting_started/meta/1.markdown
+++ b/getting_started/meta/1.markdown
@@ -98,7 +98,7 @@ iex> Macro.to_string(quote do: 11 + unquote(number))
 
 ```iex
 iex> fun = :hello
-iex> Macro.to_string(quote do: unquote(hello)(:world))
+iex> Macro.to_string(quote do: unquote(fun)(:world))
 "hello(:world)"
 ```
 
@@ -107,7 +107,7 @@ In some cases, it may be necessary to inject many values inside a list. For exam
 ```iex
 iex> inner = [3, 4, 5]
 iex> Macro.to_string(quote do: [1, 2, unquote(inner), 6])
-[1, 2, [3, 4, 5], 6]
+"[1, 2, [3, 4, 5], 6]"
 ```
 
 That's when `unquote_splicing` becomes handy:
@@ -115,7 +115,7 @@ That's when `unquote_splicing` becomes handy:
 ```iex
 iex> inner = [3, 4, 5]
 iex> Macro.to_string(quote do: [1, 2, unquote_splicing(inner), 6])
-[1, 2, 3, 4, 5, 6]
+"[1, 2, 3, 4, 5, 6]"
 ```
 
 Unquoting is very useful when working with macros. When writing macros, developers are able to receive code chunks and inject them inside other code chunks, being able to transform code or write code that generates code during compilation.
diff --git a/getting_started/meta/2.markdown b/getting_started/meta/2.markdown
index 1c9ebcab2..4f1f5bef3 100644
--- a/getting_started/meta/2.markdown
+++ b/getting_started/meta/2.markdown
@@ -45,7 +45,7 @@ iex> Unless.fun_unless true, IO.puts "this should never be printed"
 nil
 ```
 
-Note that in our macro implementation, the sentence was not printed, although it was printed in our function implementation. That's because the arguments to a function call are evaluated before calling the function. However macros do not evaluate the arguments, instead they receive the arguments as quoted expressions which are then transformed into other quoted expressions. In this case, we have rewriten our `unless` macro to become an `if` behind the scenes.
+Note that in our macro implementation, the sentence was not printed, although it was printed in our function implementation. That's because the arguments to a function call are evaluated before calling the function. However macros do not evaluate the arguments, instead they receive the arguments as quoted expressions which are then transformed into other quoted expressions. In this case, we have rewritten our `unless` macro to become an `if` behind the scenes.
 
 In other words, when invoked as:
 
@@ -239,10 +239,12 @@ iex> __ENV__.file
 iex> __ENV__.requires
 [IEx.Helpers, Kernel, Kernel.Typespec]
 iex> require Integer
+nil
+iex> __ENV__.requires
 [IEx.Helpers, Integer, Kernel, Kernel.Typespec]
 ```
 
-Many of the functions in the `Macro` module expect an environment. You can read more about them in [the docs for the `Macro` module](/docs/stable/Macro.html) and learn mor about the compilation environment with [`Macro.Env`](/docs/stable/Macro.Env.html).
+Many of the functions in the `Macro` module expect an environment. You can read more about them in [the docs for the `Macro` module](/docs/stable/Macro.html) and learn more about the compilation environment with [`Macro.Env`](/docs/stable/Macro.Env.html).
 
 ## 2.5 Private macros
 

From def0fea25447c6bdd7ec15f453fd0d70b2fb8511 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?=
 <rafael.franca@plataformatec.com.br>
Date: Sun, 30 Mar 2014 21:38:03 -0300
Subject: [PATCH 100/160] Upgrade the copyright year

---
 _includes/bottom.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/_includes/bottom.html b/_includes/bottom.html
index cf7a187ee..ad4721366 100644
--- a/_includes/bottom.html
+++ b/_includes/bottom.html
@@ -4,7 +4,7 @@
       </div>
 
       <div id="copyright">
-        © 2012-2013 <a href="http://plataformatec.com.br/" target="_blank">Plataformatec</a>. All rights reserved.
+        © 2012-2014 <a href="http://plataformatec.com.br/" target="_blank">Plataformatec</a>. All rights reserved.
       </p>
     </div><!-- .wrap -->
   </div><!-- #container -->
@@ -21,4 +21,4 @@
     })();
   </script>
 </body>
-</html>
\ No newline at end of file
+</html>

From 4e31160cb80978bc463ed9d4357c1451e2c67602 Mon Sep 17 00:00:00 2001
From: Jim Tittsler <jwt@onjapan.net>
Date: Tue, 1 Apr 2014 12:44:57 +0900
Subject: [PATCH 101/160] word choice

---
 getting_started/16.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/16.markdown b/getting_started/16.markdown
index fb2fb7cbb..cbabe4ebf 100644
--- a/getting_started/16.markdown
+++ b/getting_started/16.markdown
@@ -114,7 +114,7 @@ end
 
 If desired you could come up with your own semantics for a user being blank. Not only that, you could use structs to build more robust data types, like queues, and implemented all relevant protocols, like `Enumerable` and possibly `Blank` for such data type.
 
-In many cases though, developers may want to provide a default implementation for structs, as explicitly implementing the protocol for all structs can be tedious. That's when falling back to Any comes in hand.
+In many cases though, developers may want to provide a default implementation for structs, as explicitly implementing the protocol for all structs can be tedious. That's when falling back to Any comes in handy.
 
 ### 16.2 Falling back to Any
 

From 894720edd120fd1bbfa3239c53084b6c1dbb7d68 Mon Sep 17 00:00:00 2001
From: Jim Tittsler <jwt@onjapan.net>
Date: Tue, 1 Apr 2014 12:50:33 +0900
Subject: [PATCH 102/160] grammar

---
 getting_started/17.markdown | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/getting_started/17.markdown b/getting_started/17.markdown
index f7ee2402f..ec5b886e6 100644
--- a/getting_started/17.markdown
+++ b/getting_started/17.markdown
@@ -6,7 +6,7 @@ guide: 17
 
 # {{ page.title }}
 
-Elixir has three error mechanisms: errors, throws and exits. In this chapter we will explore each of them and include remarks when each should be used.
+Elixir has three error mechanisms: errors, throws and exits. In this chapter we will explore each of them and include remarks about when each should be used.
 
 ## 17.1 Errors
 
@@ -25,7 +25,7 @@ iex> raise "oops"
 ** (RuntimeError) oops
 ```
 
-Other error can be raised with `raise/2` passing the error name and a list of keyword arguments:
+Other errors can be raised with `raise/2` passing the error name and a list of keyword arguments:
 
 ```iex
 iex> raise ArgumentError, message: "invalid argument foo"
@@ -53,7 +53,7 @@ iex> try do
 RuntimeError[message: "oops"]
 ```
 
-The example above rescues the runtime error and returns the error itself which is then printed in the `iex` session. In practice Elixir developers rarely use the `try/rescue` construct though. For example, many languages would force you to rescue an error when a file cannot open succcessfully. Elixir instead provides a `File.read/1` function which returns a tuple containing information if the file was open with success or not:
+The example above rescues the runtime error and returns the error itself which is then printed in the `iex` session. In practice Elixir developers rarely use the `try/rescue` construct though. For example, many languages would force you to rescue an error when a file cannot open succcessfully. Elixir instead provides a `File.read/1` function which returns a tuple containing information if the file was opened with success or not:
 
 ```iex
 iex> File.read "hello"
@@ -73,7 +73,7 @@ iex> case File.read "hello" do
 ...> end
 ```
 
-At the end of the day, it is up to your application to decide if an error while opening a file is exceptional or not. That's why Elixir doesn't impose in exceptions on `File.read/1` and many other functions. Instead we leave it up to the developer to choose the best way to proceed.
+At the end of the day, it is up to your application to decide if an error while opening a file is exceptional or not. That's why Elixir doesn't impose exceptions on `File.read/1` and many other functions. Instead we leave it up to the developer to choose the best way to proceed.
 
 For the cases where you do expect a file to exist (and the lack of a file is truly an error) you can simply use `File.read!/1`:
 
@@ -87,7 +87,7 @@ In other words, we avoid using `try/rescue` because **we don't use errors for co
 
 ## 17.2 Throws
 
-In Elixir, one can throw a value to be caught later. `throw` and `catch` are reserved to situations where it is not possible to retrieve a value unless by using `throw` and `catch`.
+In Elixir, one can throw a value to be caught later. `throw` and `catch` are reserved for situations where it is not possible to retrieve a value unless by using `throw` and `catch`.
 
 Those situations are quite uncommon in practice unless when interfacing with a library that does not provide the proper APIs. For example, let's imagine the `Enum` module did not provide any API for finding a value and we need to find the first number that is a multiple of 13:
 

From 3abf08adb198786fef681342637cfec0a68870b5 Mon Sep 17 00:00:00 2001
From: Jim Tittsler <jwt@onjapan.net>
Date: Tue, 1 Apr 2014 16:47:44 +0900
Subject: [PATCH 103/160] fix blog URL

plural verb
---
 getting_started/20.markdown | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/getting_started/20.markdown b/getting_started/20.markdown
index 1e9aac992..f9286d166 100644
--- a/getting_started/20.markdown
+++ b/getting_started/20.markdown
@@ -15,7 +15,7 @@ In order to get your first project started, Elixir ships with a build tool calle
 
     mix new path/to/new/project
 
-You can learn more about Mix and other applications that ships with Elixir in the links below:
+You can learn more about Mix and other applications that ship with Elixir in the links below:
 
 * [Mix - a build tool for Elixir](/getting_started/mix/1.html)
 * [ExUnit - a unit test framework](/getting_started/ex_unit/1.html)
@@ -24,7 +24,7 @@ You can learn more about Mix and other applications that ships with Elixir in th
 
 On the sidebar, you can find the link to some Elixir books and screencasts. They are plenty of Elixir resources out there, like conference talks, open source projects, and other learning material produced by the community.
 
-Remember that in case of any difficulties, you can always visit the **#elixir-lang** channel on **irc.freenode.net** or send a message to the [mailing list](http://groups.google.com/group/elixir-lang-talk). You can be sure that there will be someone willing to help. And to keep posted on the latest news and announcements, follow the [blog][9] and follow language developments on the [elixir-core mailing list](http://groups.google.com/group/elixir-lang-core).
+Remember that in case of any difficulties, you can always visit the **#elixir-lang** channel on **irc.freenode.net** or send a message to the [mailing list](http://groups.google.com/group/elixir-lang-talk). You can be sure that there will be someone willing to help. And to keep posted on the latest news and announcements, follow the [blog](http://elixir-lang.org/blog/) and follow language developments on the [elixir-core mailing list](http://groups.google.com/group/elixir-lang-core).
 
 Don't forget [you can also check the source code of Elixir itself](https://github.com/elixir-lang/elixir), which is mostly written in Elixir (mainly the `lib` directory), or [explore Elixir's documentation](http://elixir-lang.org/docs.html).
 

From b6d05b4f14eec89640ec82ea0d89a72c47d5fac6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Tue, 1 Apr 2014 12:06:32 +0200
Subject: [PATCH 104/160] Add a chapter about unquote fragments

---
 _layouts/getting_started.html   |   1 +
 getting_started/meta/2.markdown |  74 +-----------
 getting_started/meta/3.markdown |   1 -
 getting_started/meta/4.markdown | 202 ++++++++++++++++++++++++++++++++
 4 files changed, 209 insertions(+), 69 deletions(-)
 create mode 100644 getting_started/meta/4.markdown

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index 4a80e28e4..08f800650 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -52,6 +52,7 @@ <h3 class="widget-title">Meta-programming in Elixir</h3>
       <li><a class="spec" href="/getting_started/meta/1.html">Quote and unquote</a></li>
       <li><a class="spec" href="/getting_started/meta/2.html">Macros</a></li>
       <li><a class="spec" href="/getting_started/meta/3.html">Domain Specific Languages</a></li>
+      <li><a class="spec" href="/getting_started/meta/3.html">Binding and unquote fragments</a></li>
     </ol>
   </div>
 
diff --git a/getting_started/meta/2.markdown b/getting_started/meta/2.markdown
index 4f1f5bef3..e9bc0bdbe 100644
--- a/getting_started/meta/2.markdown
+++ b/getting_started/meta/2.markdown
@@ -159,71 +159,9 @@ Sample.quoted #=> {:x, [line: 3], Sample}
 
 Notice that the third element in the quoted variable is the atom `Sample`, instead of `nil`, which marks the variable as coming from the `Sample` module. Therefore, Elixir considers those two variables come from different contexts and handle them accordingly.
 
-Elixir provides similar mechanisms for imports and aliases too. This guarantees macros will behave as specified by its source module rather than conflicting with the target module where the macro is expanded.
+Elixir provides similar mechanisms for imports and aliases too. This guarantees macros will behave as specified by its source module rather than conflicting with the target module where the macro is expanded. Hygiene can be passed under specific situations by using macros like `var!/2` and `alias!/2`, although one must be careful when using those as they directly change the user environment.
 
-## 2.3 Compile-time vs. runtime
-
-Macros are expanded at compile-time. That's a very important distinction to make when working with macros and failing to understand this distinction can cause a lot of confusion when working with macros.
-
-In general, code execution in Elixir is done in two steps:
-
-1) All the macros in the code are expanded recursively;
-
-2) The expanded code is compiled to Erlang bytecode and executed
-
-This behavior is important to understand because it affects how we think about our code structure. Consider the following code:
-
-```elixir
-defmodule Sample do
-  case System.get_env("FULL") do
-    "true" ->
-      def full?(), do: true
-    _ ->
-      def full?(), do: false
-  end
-end
-```
-
-The code above will define a function `full?` which will return true or false depending on the value of the environment variable `FULL` at **compilation time**. In order to execute this code, Elixir will first expand all macros. Considering that `defmodule` and `def` are macros, the code will expand to something like:
-
-```elixir
-:elixir_module.store Sample, fn ->
-  case System.get_env("FULL") do
-    "true" ->
-      :elixir_def.store(Foo, :def, :full?, [], true)
-    _ ->
-      :elixir_def.store(Foo, :def, :full?, [], false)
-  end
-end
-```
-
-This code will then be executed, define a module `Sample` and store the appropriate function based on the value of the environment variable `FULL`. We achieve this by using the modules `:elixir_module` and `:elixir_def`, which are Elixir internal modules written in Erlang.
-
-There are two lessons to take away from this example:
-
-1) a macro is always expanded, regardless if it is inside a `case` branch that won't actually match when executed;
-
-2) we cannot invoke a function or macro just after it is defined in a module. For example, consider:
-
-```elixir
-defmodule Sample do
-  def full?, do: true
-  IO.puts full?
-end
-```
-
-  The example above will fail because it translates to:
-
-```elixir
-:elixir_module.store Sample, fn ->
-  :elixir_def.store(Foo, :def, :full?, [], true)
-  IO.puts full?
-end
-```
-
-At the moment the module is being defined, there isn't **yet** a function named `full?` defined in the module, so `IO.puts full?` will cause the compilation to fail.
-
-## 2.4 The environment
+## 2.3 The environment
 
 When using `Macro.expand_once/2` earlier in this chapter, we have used the special form `__ENV__`.
 
@@ -246,7 +184,7 @@ iex> __ENV__.requires
 
 Many of the functions in the `Macro` module expect an environment. You can read more about them in [the docs for the `Macro` module](/docs/stable/Macro.html) and learn more about the compilation environment with [`Macro.Env`](/docs/stable/Macro.Env.html).
 
-## 2.5 Private macros
+## 2.4 Private macros
 
 Elixir also supports private macros via `defmacrop`. As private functions, these macros are only available inside the module that defines them, and only at compilation time.
 
@@ -260,7 +198,7 @@ iex> defmodule Sample do
 ** (CompileError) iex:2: function two/0 undefined
 ```
 
-## 2.6 Write macros responsibly
+## 2.5 Write macros responsibly
 
 Macros are a powerful construct and Elixir provides many mechanisms to ensure they are used responsibly:
 
@@ -272,6 +210,6 @@ Macros are a powerful construct and Elixir provides many mechanisms to ensure th
 
 * Macros' language is clear: many languages provide syntax shortcuts for `quote` and `unquote`. In Elixir, we preferred to have those explicitly spelled out, in order to clearly delimit the boundaries of a macro definition;
 
-Even if Elixir attempts its best to provide a safe environment, the major responsibility still falls on the developers. That's why the first rule of the macro club is **write macros responsibly**. Macros are harder to write than ordinary Elixir functions, and it's considered to be bad style to use them when they're not necessary. Elixir already provides elegant mechanisms to write your every day code and macros should be saved as last resort.
+Even if Elixir attempts its best to provide a safe environment, the major responsibility still falls on the developers. That's why the first rule of the macro club is **write macros responsibly**. Macros are harder to write than ordinary Elixir functions and it's considered to be bad style to use them when they're not necessary. Elixir already provides elegant mechanisms to write your every day code and macros should be saved as last resort.
 
-With those lessons, we finish our discussion about macros. The next (and last) chapter is a brief discussion on DSLs, showing how we can mix macros and module attributes to annotate and extend modules and functions.
+With those lessons, we finish our introduction to macros. The next chapter is a brief discussion on DSLs, showing how we can mix macros and module attributes to annotate and extend modules and functions.
diff --git a/getting_started/meta/3.markdown b/getting_started/meta/3.markdown
index de81650e3..e3827c9bf 100644
--- a/getting_started/meta/3.markdown
+++ b/getting_started/meta/3.markdown
@@ -2,7 +2,6 @@
 layout: getting_started
 title: 3 Domain Specific Languages
 guide: 3
-last: true
 ---
 
 # {{ page.title }}
diff --git a/getting_started/meta/4.markdown b/getting_started/meta/4.markdown
new file mode 100644
index 000000000..f57476424
--- /dev/null
+++ b/getting_started/meta/4.markdown
@@ -0,0 +1,202 @@
+---
+layout: getting_started
+title: 4 Binding and unquote fragments
+guide: 4
+last: true
+---
+
+# {{ page.title }}
+
+Throughout this tutorial, we have learned about quoted expressions, macros and built a very simple DSL. In this chapter, we will explore more advanced macro facilities and how to use `bind_quoted` and unquote fragments to avoid common macro pitfalls.
+
+## 4.1 Unquote fragments
+
+In order to facilitate the dynamic generation of functions, `def/2`, `defp/2` and friends allow unquote fragments to be injected into their source. The example we will use throughout this chapter is a `defkv/1` macro that receives a keyword list and generates function names given by key and return the respective values when invoked.
+
+Unquote fragments allows us to generate those function names without providing a macro:
+
+```elixir
+defmodule KV do
+  kv = [foo: 1, bar: 2, baz: 3]
+
+  for {key, value} <- kv do
+    def unquote(key)(), do: unquote(value)
+  end
+end
+
+KV.foo
+#=> 1
+```
+
+The functionality above works because, as `def/2` and friends are implemented as macros, they control how unquote is expanded, effectively injecting those values during the function definition.
+
+However, the example above is useful for one-off cases. If there is a frequent need for defining functions based on a keyword list, it would be convenient to implement such as a macro. Let's give it a try:
+
+```elixir
+defmodule KV do
+  defmacro defkv(kv) do
+    for {key, value} <- kv do
+      quote do
+        def unquote(key)(), do: unquote(value)
+      end
+    end
+  end
+end
+
+defmodule MyModule do
+  import KV
+  defkv [foo: 1, bar: 2]
+end
+
+MyModule.foo
+#=> 1
+```
+
+Excellent! Our example works as expected... or does it?
+
+## 4.2 Bind quoted
+
+Our `defkv` macro implementation above has fallen into a common pitfall: we are expecting values to have a specific shape at compilation time. Let's see what happens if we try to define values dynamically:
+
+```elixir
+defmodule OtherModule do
+  import KV
+  kv = [foo: 1, bar: 2]
+  defkv kv
+end
+```
+
+The example above is going to fail because our `defkv` is expecting to receive a keyword list at compilation time. However, in the example above, our macro is receiving the quoted expression for the variable `kv`.
+
+The solution to this problem is to avoid work inside the macro body. Instead we should pass the variable as is to the quoted expression and use unquote fragments to generate the desired functions. Our first attempt at such macro would look like:
+
+```elixir
+defmodule KV do
+  defmacro defkv(kv) do
+    quote do
+      for {key, value} <- unquote(kv) do
+        def unquote(key)(), do: unquote(value)
+      end
+    end
+  end
+end
+```
+
+However, if you try to compile the code above, you will notice it fail with "undefined variable or function key/0". This happens because the macro is attempting to `unquote(key)` and the variable `key` is not available inside the macro, only inside the quoted expression. The issue here is that we have two unquotes, `unquote(kv)` and `unquote(key)`, and we want them to be executed at different times.
+
+We could attempt to disable unquoting in the quote expression. However, by doing so, we would be unable to inject the value for `kv` inside the quoted expression:
+
+```iex
+iex> Macro.to_string quote unquote: false, do: unquote(kv)
+"unquote(kv)"
+```
+
+The `bind_quoted` option exists to solve exactly this problem. By using `bind_quoted`, we can inject values inside the quoted expression without the need to unquote them. Furthermore, when `bind_quoted` is given, `unquote` is also automatically set to false. Let's rewrite the macro:
+
+```elixir
+defmodule KV do
+  defmacro defkv(kv) do
+    quote bind_quoted: [kv: kv] do
+      for {key, value} <- kv do
+        def unquote(key)(), do: unquote(value)
+      end
+    end
+  end
+end
+```
+
+In the example above, we have introduced the `kv` value inside the quoted expression with `bind_quoted` and used unquote fragments to generate the values dynamically. Using `bind_quoted` is considered a good practice as it helps avoid many common macro pitfalls.
+
+## 4.3 To escape or not to escape?
+
+There is one final limitation in our macro: it only accepts values that are valid quoted expressions. In order to make it easier to understand the issue, let's define our key and values by hand once again:
+
+```elixir
+defmodule KV do
+  kv = [foo: {1, 2, 3}]
+
+  for {key, value} <- kv do
+    def unquote(key)(), do: unquote(value)
+  end
+end
+** (CompileError) iex: invalid quoted expression: {1, 2, 3}
+```
+
+The code above failed to compile because we are trying to unquote `{1, 2, 3}`. Remember that `unquote/1` expects valid quoted expressions and `{1, 2, 3}` is not one of them. The solution here is to escape the value bejore unquoting it:
+
+```elixir
+defmodule KV do
+  kv = [foo: {1, 2, 3}]
+
+  for {key, value} <- kv do
+    def unquote(key)(), do: unquote(Macro.escape(value))
+  end
+end
+** (CompileError) iex: invalid quoted expression: {1, 2, 3}
+```
+
+To fix our macro, we just need to escape the values there too.
+
+## 4.4 Macros expansion
+
+Macros are expanded at compile-time. That's a very important distinction to make when working with macros and failing to understand this distinction can cause a lot of confusion when working with macros.
+
+In general, code execution in Elixir is done in two steps:
+
+1. All the macros in the code are expanded recursively;
+
+2. The expanded code is compiled to Erlang bytecode and executed
+
+This behavior is important to understand because it affects how we think about our code structure. Consider the following code:
+
+```elixir
+defmodule Sample do
+  case System.get_env("FULL") do
+    "true" ->
+      def full?(), do: true
+    _ ->
+      def full?(), do: false
+  end
+end
+```
+
+The code above will define a function `full?` which will return true or false depending on the value of the environment variable `FULL` at **compilation time**. In order to execute this code, Elixir will first expand all macros. Considering that `defmodule/2` and `def/2` are macros, the code will expand to something like:
+
+```elixir
+:elixir_module.define Sample, fn ->
+  case System.get_env("FULL") do
+    "true" ->
+      :elixir_def.define(Foo, :def, :full?, [], true)
+    _ ->
+      :elixir_def.define(Foo, :def, :full?, [], false)
+  end
+end
+```
+
+This code will then be executed, define a module `Sample` and define the appropriate function based on the value of the environment variable `FULL`. We achieve this by using the modules `:elixir_module` and `:elixir_def` which are Elixir internal modules written in Erlang responsible for module and function compilation.
+
+There are two lessons to take away from this example:
+
+1. a macro is always expanded, regardless if it is inside a `case` branch that won't actually match when executed;
+
+2. we cannot invoke a function or macro just after it is defined in a module. For example, consider:
+
+```elixir
+defmodule Sample do
+  def full?, do: true
+  IO.puts full?
+end
+```
+
+  The example above will fail because it translates to:
+
+```elixir
+:elixir_module.store Sample, fn ->
+  :elixir_def.store(Foo, :def, :full?, [], true)
+  IO.puts full?
+end
+```
+
+At the moment the module is being defined, there isn't **yet** a function named `full?` defined in the module so `IO.puts full?` will cause the compilation to fail.
+
+With those notes, we finish our discussion about macros. When working with macros, there are pitfalls developers should be aware of and while Elixir helps developers to avoid many of them, like by having hygiene being on by default, other pitfalls can only be avoided if developers use the proper idioms, like `bind_quoted`, when implementing their own macros.

From 5daee4fc2234a3d4ecf9221094793a82fd9d9971 Mon Sep 17 00:00:00 2001
From: Tallak Tveide <tallak.tveide@nov.com>
Date: Wed, 2 Apr 2014 07:47:30 +0200
Subject: [PATCH 105/160] fix typo wrt single and double quoted strings

---
 getting_started/2.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 70d057d19..444a4ab5a 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -179,7 +179,7 @@ Keep in mind `single-quoted` and `double-quoted` strings are not equivalent in E
 
 ```iex
 iex> 'hellö' == "hellö"
-true
+false
 ```
 
 We will talk more about Unicode support and the difference in between single and double-quoted strings in the "Binaries, strings and char lists" chapter.

From 3d2ece04436481df63db8a441335fac51e6fc464 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Fri, 4 Apr 2014 18:53:21 +0200
Subject: [PATCH 106/160] Ensure chapters have proper enumeration

---
 _layouts/getting_started.html | 10 +++++-----
 getting_started/10.markdown   | 12 ++++++------
 getting_started/11.markdown   | 10 +++++-----
 getting_started/12.markdown   | 16 ++++++++--------
 getting_started/13.markdown   | 14 +++++++-------
 getting_started/14.markdown   | 22 +++++++++++-----------
 getting_started/9.markdown    |  6 ++++--
 7 files changed, 46 insertions(+), 44 deletions(-)

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index 08f800650..aa10553b8 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -19,11 +19,11 @@ <h3 class="widget-title">Index</h3>
       <li><a class="spec" href="/getting_started/7.html">Keywords, maps and dicts</a></li>
       <li><a class="spec" href="/getting_started/8.html">Modules</a></li>
       <li><a class="spec" href="/getting_started/9.html">Recursion</a></li>
-      <li><a class="spec" href="/getting_started/10.html">alias, require and import</a></li>
-      <li><a class="spec" href="/getting_started/11.html">Module attributes</a></li>
-      <li><a class="spec" href="/getting_started/12.html">Enumerables and streams</a></li>
-      <li><a class="spec" href="/getting_started/13.html">Processes</a></li>
-      <li><a class="spec" href="/getting_started/14.html">IO</a></li>
+      <li><a class="spec" href="/getting_started/10.html">Enumerables and streams</a></li>
+      <li><a class="spec" href="/getting_started/11.html">Processes</a></li>
+      <li><a class="spec" href="/getting_started/12.html">IO</a></li>
+      <li><a class="spec" href="/getting_started/13.html">alias, require and import</a></li>
+      <li><a class="spec" href="/getting_started/14.html">Module attributes</a></li>
       <li><a class="spec" href="/getting_started/15.html">Structs</a></li>
       <li><a class="spec" href="/getting_started/16.html">Protocols</a></li>
       <li><a class="spec" href="/getting_started/17.html">try, catch and rescue</a></li>
diff --git a/getting_started/10.markdown b/getting_started/10.markdown
index b215817de..ccb9ec860 100644
--- a/getting_started/10.markdown
+++ b/getting_started/10.markdown
@@ -1,12 +1,12 @@
 ---
 layout: getting_started
-title: 12 Enumerables and Streams
-guide: 12
+title: 10 Enumerables and Streams
+guide: 10
 ---
 
 # {{ page.title }}
 
-## 12.1 Enumerables
+## 10.1 Enumerables
 
 Elixir provides the concept of enumerables and [the `Enum` module](/docs/stable/Enum.html) to work with them. We have already learned two enumerables: lists and maps.
 
@@ -14,7 +14,7 @@ Elixir provides the concept of enumerables and [the `Enum` module](/docs/stable/
 iex> Enum.map([1, 2, 3], fn x -> x * 2 end)
 [2, 4, 6]
 iex> Enum.map(%{1 => 2, 3 => 4}, fn {k, v} -> k * v end)
-[2, 12]
+[2, 10]
 ```
 
 The `Enum` module provides a huge range of functions to transform, sort, group, filter and retrieve items from enumerables. It is one of the modules developers use frequently in their Elixir code.
@@ -32,7 +32,7 @@ Since the Enum module was designed to work across different data types, its API
 
 We say the functions in the `Enum` module are polymorphic because they can work with diverse data types. In particular, the functions in the `Enum` module can work with any data type that implements [the `Enumerable` protocol](/docs/stable/Enumerable.html). We are going to discuss Protocols in a later chapter, for now we are going to move on to a specific kind of enumerable called streams.
 
-## 12.2 Eager vs Lazy
+## 10.2 Eager vs Lazy
 
 All the functions in the `Enum` module are eager. Many functions expect an enumerable and return a list back:
 
@@ -61,7 +61,7 @@ iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(odd?) |> Enum.sum
 
 Instead of generating intermediate lists, streams create a series of computations that are invoked only when we pass it to the `Enum` module. Streams are useful when working with large, *possibly infinite*, collections.
 
-## 12.3 Streams
+## 10.3 Streams
 
 Streams are lazy, composable enumerables.
 
diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index 658160f04..2c471ed11 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -1,14 +1,14 @@
 ---
 layout: getting_started
-title: 13 Processes
-guide: 13
+title: 11 Processes
+guide: 11
 ---
 
 # {{ page.title }}
 
 In Elixir, all of your code run inside processes. Those processes are isolated from each other and they communicate with message passing. In this chapter, we will learn about the basic constructs for spawning new processes, sending and receiving messages.
 
-## 13.1 spawn
+## 11.1 spawn
 
 The basic mechanism for spawning new processes is with the auto-imported `spawn/1` function:
 
@@ -39,7 +39,7 @@ true
 
 Processes get much more interesting when we are able to send and receive messages.
 
-## 13.2 send and receive
+## 11.2 send and receive
 
 We can send messages with `send/2` and receive them with `receive/1`:
 
@@ -93,7 +93,7 @@ iex> flush()
 
 Before we finish this chapter, let's talk about process links.
 
-## 13.3 Links
+## 11.3 Links
 
 The most common form of spawning in Elixir is actually via `spawn_link/1`. Before we show an example with `spawn_link/1`, let's try to see what happens when a process fail:
 
diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index a40d92ec9..c7ebb5289 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -1,7 +1,7 @@
 ---
 layout: getting_started
-title: 14 IO
-guide: 14
+title: 12 IO
+guide: 12
 ---
 
 # {{ page.title }}
@@ -10,7 +10,7 @@ This chapter is a quick introduction to input/output mechanisms in Elixir and re
 
 We have originally sketched this chapter to come much earlier in the getting started guide. However, we noticed the IO system provides a great opportunity to bring some philosophies and curiosities about Elixir and the VM.
 
-## 14.1 The IO module
+## 12.1 The IO module
 
 The `IO` module in Elixir is the main mechanism for reading and writing to the standard io (`:stdio`), standard error (`:stderr`), files and other IO devices. Usage of the module is pretty straight-forward:
 
@@ -31,7 +31,7 @@ iex> IO.puts :stderr, "hello world"
 :ok
 ```
 
-## 14.2 The File module
+## 12.2 The File module
 
 The [`File`](/docs/stable/File.html) module contains functions that allows us to open files as IO devices. By default, files are opened in binary mode, which requires developers to use the specific `IO.binread/2` and `IO.binwrite/2` functions from the `IO` module:
 
@@ -89,7 +89,7 @@ or
 File.read!(file)
 ```
 
-## 14.3 The Path module
+## 12.3 The Path module
 
 The majority of the functions in the File module expects paths as arguments. Most commonly, those paths will be binaries and they can be manipulated with the [`Path`](/docs/stable/Path.html) module:
 
@@ -100,9 +100,9 @@ iex> Path.expand("~/hello")
 "/Users/jose/hello"
 ```
 
-With this, we have covered the main modules for doing IO and interacting with the filesystem. However there are some advanced topics to discuss regarding IO but feel free to skip them if you are in a hurry.
+With this we have covered the main modules for doing IO and interacting with the filesystem. Next we will discuss some curiosities and advanced topics regarding IO. Those sections are not necessary to write Elixir code, so feel free to skip them, but they do provide an overview of how the IO system is implemented in the VM and other curiosities.
 
-## 14.4 Processes and group leaders
+## 12.4 Processes and group leaders
 
 You may have noticed that `File.open/2` returned a tuple containing a PID:
 
@@ -149,7 +149,7 @@ hello
 
 The group leader can be configured per process and is used in different situations, for example, when executing code in remote nodes, it guarantees messages printed in the remote node are redirected and printed in the "executor" one.
 
-## 14.5 `iodata` and `char_data`
+## 12.5 `iodata` and `char_data`
 
 In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
 
diff --git a/getting_started/13.markdown b/getting_started/13.markdown
index ab895f2c5..1411ec074 100644
--- a/getting_started/13.markdown
+++ b/getting_started/13.markdown
@@ -1,14 +1,14 @@
 ---
 layout: getting_started
-title: 10 alias, require and import
-guide: 10
+title: 13 alias, require and import
+guide: 13
 ---
 
 # {{ page.title }}
 
 In order to facilitate software reuse, Elixir provides three directives. As we are going to see below, they are called directives because they have **lexical scope**.
 
-### 10.1 alias
+### 13.1 alias
 
 `alias` allows you to set up aliases for any given module name. Imagine our `Math` module uses a special list implementation for doing math specific operations:
 
@@ -57,7 +57,7 @@ end
 
 In the example above, since we are invoking `alias` inside the function `plus/2`, the alias will just be valid inside the function `plus/2`. `minus/2` won't be affected at all.
 
-### 10.2 require
+### 13.2 require
 
 Elixir provides macros as a mechanism for meta-programming (writing code that generates code).
 
@@ -76,7 +76,7 @@ In Elixir, `Integer.odd?/1` is defined as a macro so it can be used as guards. T
 
 In general a module does not need to be required before usage, except if we want to use the macros available in that module. An attempt to call a macro that was not loaded will raise an error. Note that like the `alias` directive, `require` is also lexically scoped. We will talk more about macros in a later chapter.
 
-### 10.3 import
+### 13.3 import
 
 We use `import` whenever we want to easily access functions or macros from other modules without using the qualified name. For instance, if we want to use the `duplicate` function from `List` several times, we can simply import it:
 
@@ -116,7 +116,7 @@ In the example above, the imported `List.duplicate/2` is only visible within tha
 
 Note that importing a module automatically requires it.
 
-## 10.4 Aliases
+## 13.4 Aliases
 
 At this point, you may be wondering, what exactly an Elixir alias is and how it is represented?
 
@@ -151,7 +151,7 @@ iex> mod.flatten([1,[2],3])
 
 In other words, we are simply calling the function `flatten` on the atom `:lists`.
 
-## 10.5 Nesting
+## 13.5 Nesting
 
 Now that we have talked about aliases, we can talk about nesting and how it works in Elixir. Consider the following example:
 
diff --git a/getting_started/14.markdown b/getting_started/14.markdown
index a890d2bb9..89424fe7b 100644
--- a/getting_started/14.markdown
+++ b/getting_started/14.markdown
@@ -1,7 +1,7 @@
 ---
 layout: getting_started
-title: 11 Module attributes
-guide: 11
+title: 14 Module attributes
+guide: 14
 ---
 
 # {{ page.title }}
@@ -14,7 +14,7 @@ Module attributes in Elixir serves three purposes:
 
 Let's check each case, one by one.
 
-## 11.1 As annotations
+## 14.1 As annotations
 
 Elixir brings the concept of module attributes from Erlang. For example:
 
@@ -86,13 +86,13 @@ You can take a look at the docs for [Module](/docs/stable/Module.html) for a com
 
 This section covers built-in attributes. However, attributes can also be used by developers or extended by libraries to support custom behaviour.
 
-## 11.2 As constants
+## 14.2 As constants
 
 Elixir developers will often use module attributes to be used as constants:
 
 ```elixir
 defmodule MyServer do
-  @initial_state %{host: "117.0.0.1", port: 3456}
+  @initial_state %{host: "147.0.0.1", port: 3456}
   IO.inspect @initial_state
 end
 ```
@@ -112,19 +112,19 @@ Finally, attributes can also be read inside functions:
 
 ```elixir
 defmodule MyServer do
-  @my_data 11
+  @my_data 14
   def first_data, do: @my_data
   @my_data 13
   def second_data, do: @my_data
 end
 
-MyServer.first_data #=> 11
+MyServer.first_data #=> 14
 MyServer.second_data #=> 13
 ```
 
 Notice that reading an attribute inside a function takes a snapshot of its current value. In other words, the value is read at compilation time and not at runtime. As we are going to see, this makes attributes useful to be used as storage during the module compilation.
 
-## 11.3 As temporary storage
+## 14.3 As temporary storage
 
 One of the projects in the Elixir organization is [the `Plug` project](https://github.com/elixir-lang/plug), which is meant to be a common foundation for building web libraries and frameworks in Elixir.
 
@@ -150,9 +150,9 @@ IO.puts "Running MyPlug with Cowboy on http://localhost:4000"
 Plug.Adapters.Cowboy.http MyPlug, []
 ```
 
-In the example above, we have used the `plug/1` macro to connect functions that will be invoked when there is a web request. Internally, every time you call `plug/1`, the Plug library stores the given arguments as a list in a `@plugs` attribute. At the end, before the module is compiled, Plug runs a callback that will then compile all `@plugs` into actual function calls.
+In the example above, we have used the `plug/1` macro to connect functions that will be invoked when there is a web request. Internally, every time you call `plug/1`, the Plug library stores the given argument in a `@plugs` attribute. At the end, before the module is compiled, Plug runs a callback that will then compile all `@plugs` into the `call/2` used to serve requests.
 
-In order to understand the underlying code, we'd need macros, so we will revisit this pattern later on. However, the focus here is exactly on how using module attributes as storage allow developers to create DSLs.
+In order to understand the underlying code, we'd need macros, so we will revisit this pattern in the meta-programming guide. However the focus here is exactly on how using module attributes as storage allow developers to create DSLs.
 
 Another example comes from the ExUnit framework, that uses module attributes as annotation and storage:
 
@@ -167,7 +167,7 @@ defmodule MyTest do
 end
 ```
 
-Tags in ExUnit are used to annotate tests. Tags can be later used to filter tests, so you don't run external tests by default unless explicitly desired. Internally, those tags are stored in temporary module attributes, associating each test to their respective tags, so tests with particular tags can be later fetched and filtered by the test framework.
+Tags in ExUnit are used to annotate tests. Tags can be later used to filter tests, for example, you can avoid running external tests in your machine because they are slow and dependent on other services, while they can still be enabled in your build system.
 
 We hope this section shines some light on how Elixir supports meta-programming and how module attributes play an important role when doing so.
 
diff --git a/getting_started/9.markdown b/getting_started/9.markdown
index b515b9bbe..04c2e4647 100644
--- a/getting_started/9.markdown
+++ b/getting_started/9.markdown
@@ -95,7 +95,9 @@ Math.double_each([1, 2, 3]) #=> [2, 4, 6]
 
 Here we have used recursion to traverse a list doubling each element and returning a new list. The process of taking a list and "mapping" over it is known as a "map" algorithm.
 
-Recursion and tail call optimization are an important part of Elixir and are commonly used to create loops. However, when programming Elixir you will rarely use recursion as above to manipulate lists. [The `Enum` module](/docs/stable/Enum.html) already provides many conveniences for working with lists. For instance, the examples above could be written as:
+Recursion and tail call optimization are an important part of Elixir and are commonly used to create loops. However, when programming Elixir you will rarely use recursion as above to manipulate lists.
+
+The [`Enum` module](/docs/stable/Enum.html), which we are going to study in the next chapter, already provides many conveniences for working with lists. For instance, the examples above could be written as:
 
 ```iex
 iex> Enum.reduce([1, 2, 3], 0, fn(x, acc) -> x + acc end)
@@ -113,4 +115,4 @@ iex> Enum.map([1, 2, 3], &(&1 * 2))
 [2, 4, 6]
 ```
 
-Next we'll take a deeper look at Enumerables and Streams.
+So let's take a deeper look at Enumerables and Streams.

From 04e407bc645afb9e53a952865b9209b12b29b4cc Mon Sep 17 00:00:00 2001
From: Ryan Levick <ryan@6wunderkinder.com>
Date: Sat, 5 Apr 2014 01:41:28 +0200
Subject: [PATCH 107/160] Give more of an explanation of processes

---
 getting_started/11.markdown | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index 2c471ed11..4dd32a2a9 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -6,7 +6,11 @@ guide: 11
 
 # {{ page.title }}
 
-In Elixir, all of your code run inside processes. Those processes are isolated from each other and they communicate with message passing. In this chapter, we will learn about the basic constructs for spawning new processes, sending and receiving messages.
+In Elixir, all code runs inside processes. Processes are isolated from each other, run concurrent to one another and communicate via message passing. Processes are not only the basis for concurrency in Elixir, but they also provide the means for building distributed and highly fault-tolerant programs.
+
+Processes are extremely lightweight in terms of memory and CPU (unlike threads in many other programming languages). Because of this, it is not uncommon to have thousands of processes running simultaneously.
+
+In this chapter, we will learn about the basic constructs for spawning new processes, as well as sending and receiving messages between different processes.
 
 ## 11.1 spawn
 
@@ -17,6 +21,8 @@ iex> spawn fn -> 1 + 2 end
 #PID<0.43.0>
 ```
 
+`spawn/1` takes a function which it will execute in another process.
+
 Notice `spawn/1` returns a PID (process identifier). At this point, the process you spawned is very likely dead. The spawned process will execute the given function and exit after the function is done:
 
 ```iex
@@ -41,7 +47,7 @@ Processes get much more interesting when we are able to send and receive message
 
 ## 11.2 send and receive
 
-We can send messages with `send/2` and receive them with `receive/1`:
+We can send messages to a process with `send/2` and receive them with `receive/1`:
 
 ```iex
 iex> send self(), {:hello, "world"}

From 6d4d06eeaf1a863800b7b50dca1d01eb905b4bd8 Mon Sep 17 00:00:00 2001
From: Ryan Levick <ryan@6wunderkinder.com>
Date: Sat, 5 Apr 2014 02:00:20 +0200
Subject: [PATCH 108/160] Small Improvements to Chapter 12

---
 getting_started/12.markdown | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index c7ebb5289..5ae6fe082 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -8,7 +8,7 @@ guide: 12
 
 This chapter is a quick introduction to input/output mechanisms in Elixir and related modules, like [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html) and [`Path`](/docs/stable/Path.html).
 
-We have originally sketched this chapter to come much earlier in the getting started guide. However, we noticed the IO system provides a great opportunity to bring some philosophies and curiosities about Elixir and the VM.
+We had originally sketched this chapter to come much earlier in the getting started guide. However, we noticed the IO system provides a great opportunity to shed some light on some philosophies and curiosities of Elixir and the VM.
 
 ## 12.1 The IO module
 
@@ -62,7 +62,7 @@ iex> File.read "hello"
 {:ok, "world"}
 iex> File.read! "hello"
 "world"
-iex> File.read "unknwon"
+iex> File.read "unknown"
 {:error, :enoent}
 iex> File.read! "unknown"
 ** (File.Error) could not read file unknown: no such file or directory
@@ -111,7 +111,7 @@ iex> {:ok, file} = File.open "hello", [:write]
 {:ok, #PID<0.47.0>}
 ```
 
-That's because the IO module actually works with processes. When you say `IO.write(pid, binary)`, the IO module will send a message to the process to the desired operation. Let's see what happens if we use our own process:
+That's because the IO module actually works with processes. When you say `IO.write(pid, binary)`, the IO module will send a message to the process with the desired operation. Let's see what happens if we use our own process:
 
 ```iex
 iex> pid = spawn fn ->

From b2f93beca0a16dca97b6a4f8308b59b9ac75ac24 Mon Sep 17 00:00:00 2001
From: Ryan Levick <ryan@6wunderkinder.com>
Date: Sat, 5 Apr 2014 12:08:25 +0200
Subject: [PATCH 109/160] Small Changes to Chapter 14

---
 getting_started/14.markdown | 38 ++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/getting_started/14.markdown b/getting_started/14.markdown
index 89424fe7b..70bf2b05c 100644
--- a/getting_started/14.markdown
+++ b/getting_started/14.markdown
@@ -6,11 +6,11 @@ guide: 14
 
 # {{ page.title }}
 
-Module attributes in Elixir serves three purposes:
+Module attributes in Elixir serve three purposes:
 
-1. They serve to annotate the module, often with information to be used by the user or the VM;
-2. They work as constants;
-3. They work as a temporary module storage to be used during compilation;
+1. They serve to annotate the module, often with information to be used by the user or the VM.
+2. They work as constants.
+3. They work as a temporary module storage to be used during compilation.
 
 Let's check each case, one by one.
 
@@ -28,12 +28,12 @@ In the example above, we are explicitly setting the version attribute for that m
 
 Elixir has a handful of reserved attributes. Here are just a few of them, the most commonly used ones:
 
-* `@moduledoc` - provides documentation for the current module;
-* `@doc` - provides documentation for the function or macro that follows the attribute;
-* `@behaviour` - (notice the British spelling) used for specifying an OTP or user-defined behaviour;
-* `@before_compile` - provides a hook that will be invoked before the module is compiled. This makes it possible to inject functions inside the module exactly before compilation;
+* `@moduledoc` - provides documentation for the current module.
+* `@doc` - provides documentation for the function or macro that follows the attribute.
+* `@behaviour` - (notice the British spelling) used for specifying an OTP or user-defined behaviour.
+* `@before_compile` - provides a hook that will be invoked before the module is compiled. This makes it possible to inject functions inside the module exactly before compilation.
 
-`@moduledoc` and `@doc` are by far the most used attributes and we expect you to use them a lot. Elixir treats documentation as first-class and provide many functions to access documentation:
+`@moduledoc` and `@doc` are by far the most used attributes, and we expect you to use them a lot. Elixir treats documentation as first-class and provides many functions to access documentation:
 
 ```iex
 iex> defmodule MyModule do
@@ -74,15 +74,15 @@ defmodule Math do
 end
 ```
 
-We also provide a tool called [ExDoc](https://github.com/elixir-lang/ex_doc) which is used to generate HTML pages with the documentation.
+We also provide a tool called [ExDoc](https://github.com/elixir-lang/ex_doc) which is used to generate HTML pages from the documentation.
 
 You can take a look at the docs for [Module](/docs/stable/Module.html) for a complete list of supported attributes. Elixir also uses attributes to define [typespecs](/docs/stable/Kernel.Typespec.html), via:
 
-* `@spec` - provides a specification for a function;
-* `@callback` - provides a specification for the behavior callback;
-* `@type` - defines a type to be used in `@spec`;
-* `@typep` - defines a private type to be used in `@spec`;
-* `@opaque` - defines an opaque type to be used in `@spec`;
+* `@spec` - provides a specification for a function.
+* `@callback` - provides a specification for the behavior callback.
+* `@type` - defines a type to be used in `@spec`.
+* `@typep` - defines a private type to be used in `@spec`.
+* `@opaque` - defines an opaque type to be used in `@spec`.
 
 This section covers built-in attributes. However, attributes can also be used by developers or extended by libraries to support custom behaviour.
 
@@ -122,7 +122,7 @@ MyServer.first_data #=> 14
 MyServer.second_data #=> 13
 ```
 
-Notice that reading an attribute inside a function takes a snapshot of its current value. In other words, the value is read at compilation time and not at runtime. As we are going to see, this makes attributes useful to be used as storage during the module compilation.
+Notice that reading an attribute inside a function takes a snapshot of its current value. In other words, the value is read at compilation time and not at runtime. As we are going to see, this makes attributes useful to be used as storage during module compilation.
 
 ## 14.3 As temporary storage
 
@@ -150,11 +150,11 @@ IO.puts "Running MyPlug with Cowboy on http://localhost:4000"
 Plug.Adapters.Cowboy.http MyPlug, []
 ```
 
-In the example above, we have used the `plug/1` macro to connect functions that will be invoked when there is a web request. Internally, every time you call `plug/1`, the Plug library stores the given argument in a `@plugs` attribute. At the end, before the module is compiled, Plug runs a callback that will then compile all `@plugs` into the `call/2` used to serve requests.
+In the example above, we have used the `plug/1` macro to connect functions that will be invoked when there is a web request. Internally, every time you call `plug/1`, the Plug library stores the given argument in a `@plugs` attribute. Just before the module is compiled, Plug runs a callback that defines a method (`call/2`) which handles http requests. This method will run all plugs inside `@plugs` in order.
 
 In order to understand the underlying code, we'd need macros, so we will revisit this pattern in the meta-programming guide. However the focus here is exactly on how using module attributes as storage allow developers to create DSLs.
 
-Another example comes from the ExUnit framework, that uses module attributes as annotation and storage:
+Another example comes from the ExUnit framework which uses module attributes as annotation and storage:
 
 ```elixir
 defmodule MyTest do
@@ -167,7 +167,7 @@ defmodule MyTest do
 end
 ```
 
-Tags in ExUnit are used to annotate tests. Tags can be later used to filter tests, for example, you can avoid running external tests in your machine because they are slow and dependent on other services, while they can still be enabled in your build system.
+Tags in ExUnit are used to annotate tests. Tags can be later used to filter tests. For example, you can avoid running external tests on your machine because they are slow and dependent on other services, while they can still be enabled in your build system.
 
 We hope this section shines some light on how Elixir supports meta-programming and how module attributes play an important role when doing so.
 

From 0f591bc07d03b95db6b8949eeea38636bba5633a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sun, 6 Apr 2014 11:54:43 +0200
Subject: [PATCH 110/160] Add rebar executable

---
 rebar | Bin 0 -> 164740 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100755 rebar

diff --git a/rebar b/rebar
new file mode 100755
index 0000000000000000000000000000000000000000..f28a1d353e515806d58938409392dc4c75b2bda5
GIT binary patch

From 8aa69d257d4ca3fc33c976eccf815f22b3858169 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Thu, 10 Apr 2014 16:25:49 +0200
Subject: [PATCH 111/160] Mention the h helper

---
 getting_started/1.markdown | 2 +-
 getting_started/2.markdown | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/getting_started/1.markdown b/getting_started/1.markdown
index 820039dfe..90b31d259 100644
--- a/getting_started/1.markdown
+++ b/getting_started/1.markdown
@@ -84,4 +84,4 @@ iex> "hello" <> " world"
 "hello world"
 ```
 
-It seems we are ready to go!  We will use the interactive shell quite a lot in the next chapters to get a bit more familiar with the language constructs and basic types, starting in the next chapter.
+It seems we are ready to go! We will use the interactive shell quite a lot in the next chapters to get a bit more familiar with the language constructs and basic types, starting in the next chapter.
\ No newline at end of file
diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index c7027c043..955eb1f1c 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -90,6 +90,8 @@ false
 
 You can also use `is_integer/1`, `is_float/1` or `is_number/1` to check, respectively, if an argument is an integer, a float or either.
 
+> Note: at any moment you can type `h` in the shell to print information on how to use the shell. The `h` helper can also be used to access documentation for any function. For example, typing `h is_integer/1` is going to print the documentation for the `is_integer/1` function. It also works with operators and other constructs (try `h ==/2`).
+
 ## 2.3 Atoms
 
 Atoms are constants where their name is their own value. Some other languages call these symbols.

From 863cec5c77d81eb9e3b2b9c9505cd23f791fa49b Mon Sep 17 00:00:00 2001
From: Susanne Dewein <susanne.dewein@gmail.com>
Date: Fri, 11 Apr 2014 14:41:36 +0200
Subject: [PATCH 112/160] Add dot between variable and parenthesis

---
 getting_started/2.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 955eb1f1c..36669531c 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -210,7 +210,7 @@ Note a dot (`.`) in between the variable and parenthesis is required to invoke a
 Anonymous functions are closures, and as such they can access variables that are in scope when the function is defined:
 
 ```iex
-iex> add_two = fn a -> add(a, 2) end
+iex> add_two = fn a -> add.(a, 2) end
 #Function<6.71889879/1 in :erl_eval.expr/5>
 iex> add_two.(2)
 4

From 6040fb4cdc8ca4cd640c4a182152f86389c972ab Mon Sep 17 00:00:00 2001
From: "Augie De Blieck Jr." <augiedb@gmail.com>
Date: Sat, 12 Apr 2014 13:56:34 -0400
Subject: [PATCH 113/160] Minor grammatical tweaks

Fixed a subject/verb agreement issue in the final paragraph, moved a couple verbs into more active tense, etc.
---
 getting_started/10.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/10.markdown b/getting_started/10.markdown
index ccb9ec860..24f788101 100644
--- a/getting_started/10.markdown
+++ b/getting_started/10.markdown
@@ -109,4 +109,4 @@ The example above will fetch the first 10 lines of the file you have selected. T
 
 The amount of functions and functionality in [`Enum`](/docs/stable/Enum.html) and [`Stream`](/docs/stable/Stream.html) modules can be daunting at first but you will get familiar with them case by case. In particular, focus on the `Enum` module first and only move to `Stream` for the particular scenarios where laziness is required to either deal with slow resources or large, possibly infinite, collections.
 
-Next we'll look at a feature central to Elixir, Processes, which allow us to write concurrent, parallel and distributed programs in an easy and understandable way.
+Next we'll look at a feature central to Elixir, Processes, which allows us to write concurrent, parallel and distributed programs in an easy and understandable way.

From 8ecbc086b01f65be96a36002110c5dca33dfce55 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sun, 20 Apr 2014 13:08:29 +0200
Subject: [PATCH 114/160] Remove bound mention

---
 getting_started/4.markdown | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/getting_started/4.markdown b/getting_started/4.markdown
index f14bc64b4..28a0288e6 100644
--- a/getting_started/4.markdown
+++ b/getting_started/4.markdown
@@ -10,7 +10,7 @@ In this chapter, we will show how the `=` operator in Elixir is actually a match
 
 ## 4.1 The match operator
 
-We have used the `=` operator a couple times to "assign" variables in Elixir.
+We have used the `=` operator a couple times to assign variables in Elixir.
 
 ```iex
 iex> x = 1
@@ -19,7 +19,7 @@ iex> x
 1
 ```
 
-However, the `=` operator is actually called *the match operator*. Let's see why:
+In Elixir, the `=` operator is actually called *the match operator*. Let's see why:
 
 ```iex
 iex> 1 = x
@@ -30,14 +30,14 @@ iex> 2 = x
 
 Notice that `1 = x` is a valid expression, and it matched because both the left and right side are equal to 1. When the sides do not match, a `MatchError` is raised.
 
-Also, in Elixir parlance, we don't say a variable is assigned. We say a variable is bound or not. A variable can only be bound on the left side of `=`:
+A variable can only be assigned on the left side of `=`:
 
 ```iex
 iex> 1 = unknown
 ** (RuntimeError) undefined function: unknown/0
 ````
 
-Since there is no variable unknown previously defined, Elixir imagined you were trying to call a function named `unknown/0`, but there isn't such function.
+Since there is no variable `unknown` previously defined, Elixir imagined you were trying to call a function named `unknown/0`, but there isn't such function.
 
 ## 4.2 Pattern matching
 

From 70c9b36ccfff8ce71a39f751a09de0da2b9d1666 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sun, 20 Apr 2014 14:59:41 +0200
Subject: [PATCH 115/160] Add notes about hex.pm and ElixirConf

---
 _includes/search.html                         |  2 +-
 ...014-03-26-elixir-v0-13-0-released.markdown | 92 +++++++++++--------
 index.html                                    |  2 +-
 3 files changed, 58 insertions(+), 38 deletions(-)

diff --git a/_includes/search.html b/_includes/search.html
index abc92d1dd..5a97f401b 100644
--- a/_includes/search.html
+++ b/_includes/search.html
@@ -1,6 +1,6 @@
 <div class="widget news">
   <h3>
-    News: <a href="/blog/2014/03/26/elixir-v0-13-0-released/">Elixir v0.13.0 released</a>
+    News: <a href="/blog/2014/03/26/elixir-v0-13-0-released/">Elixir v0.13.0 released, hex.pm and ElixirConf announced</a>
   </h3>
 </div>
 
diff --git a/_posts/2014-03-26-elixir-v0-13-0-released.markdown b/_posts/2014-03-26-elixir-v0-13-0-released.markdown
index 580c680f6..704dc696b 100644
--- a/_posts/2014-03-26-elixir-v0-13-0-released.markdown
+++ b/_posts/2014-03-26-elixir-v0-13-0-released.markdown
@@ -1,30 +1,42 @@
 ---
 layout: post
-title: Elixir v0.13.0 released
+title: Elixir v0.13.0 released, hex.pm and ElixirConf announced
 author: José Valim
 category: Releases
-excerpt: Elixir v0.13.0 comes with the biggest changes to the language since it was first released: maps, structs, comprehensiona and more. But don't worry, many changes will take effect over a series of releases in order to avoid breaking changes
+excerpt: Elixir v0.13.0 comes with substantial improvements to the language: maps, structs, comprehensiona and more. It also marks the announcement of the hex.pm package manager and the announcment of ElixirConf!
 ---
 
 Hello folks!
 
-Elixir v0.13.0 has been released promoting the biggest changes to the language since it was first released. On this blog post, we are going to cover some of those changes and the road to Elixir v1.0. In a nutshell, here is what new:
+Elixir v0.13.0 has been released. It contains changes that will effectively shape how developers will write Elixir code from now on, making it an important milestone towards v1.0! On this post we are going to cover some of those changes, the road to Elixir v1.0, as well as the announcement of [hex.pm](http://hex.pm).
 
-* Elixir now runs on and requires Erlang R17;
+Before we go into the changes, let's briefly talk about ElixirConf!
+
+## ElixirConf
+
+We are excited to announce [ElixirConf](http://elixirconf.com), the first ever Elixir conference, happening July 25-26, 2014 in Austin, TX. The Call For Proposals is open and we are waiting for your talks!
+
+The registration is also open and we hope you will join us on this exciting event. We welcome Elixir developers and enthusiasts that are looking forward to be part of our thrilling community!
+
+## Summary
 
-* The [Getting Started guide](http://elixir-lang.org/getting_started/1.html) was rewritten from scratch. The previous guide was comprised of 7 chapters and was about to become 2 years old. The new guide features 20 chapters, exploring the new maps and structs as part of this release, going deeper into topics like IO and File handling, as well as an extra guide, still in development, about [Meta-Programming in Elixir](http://elixir-lang.org/getting_started/meta/1.html);
+In a nutshell, here is what new:
+
+* Elixir now runs on and requires Erlang R17;
 
 * With Erlang R17, Elixir also adds support for maps, which are key-value data structures that supports pattern matching. We'll explore maps, their features and limitations in this post;
 
 * Elixir v0.13 also provides structs, an alternative to Elixir records. Structs are more flexible than records, provide faster polymorphic operations, and still provide the same compile-time guarantees many came to love in records;
 
+* The [Getting Started guide](http://elixir-lang.org/getting_started/1.html) was rewritten from scratch. The previous guide was comprised of 7 chapters and was about to become 2 years old. The new guide features 20 chapters, it explores the new maps and structs (which are part of this release), and it goes deeper into topics like IO and File handling. It also includes an extra guide, still in development, about [Meta-Programming in Elixir](http://elixir-lang.org/getting_started/meta/1.html);
+
 * Elixir v0.13 provides a new comprehension syntax that not only works with lists, but with any [`Enumerable`](/docs/stable/Enumerable.html). The output of a comprehension is also extensible via the [`Collectable`](/docs/stable/Collectable.html) protocol;
 
 * Mix, Elixir's build tool, has been improved in order to provide better workflows when compiling projects and working with dependencies;
 
-* There are many other changes, like the [StringIO](/docs/stable/StringIO.html), support for [tags and filters in ExUnit](/docs/stable/ExUnit.Case.html) and more. Please check the [CHANGELOG](https://github.com/elixir-lang/elixir/blob/v0.13.0/CHANGELOG.md) for the complete list.
+* There are many other changes, like the addition of [StringIO](/docs/stable/StringIO.html), support for [tags and filters in ExUnit](/docs/stable/ExUnit.Case.html) and more. Please check the [CHANGELOG](https://github.com/elixir-lang/elixir/blob/v0.13.0/CHANGELOG.md) for the complete list.
 
-Keep in mind that some of the major changes described here were and will continue to be applied throughout a series of releases to avoid breaking changes. In fact, Elixir v0.13.0 is completely compatible with Elixir v0.12.5 and upgrading should be a clean process.
+Even with all those improvements, Elixir v0.13.0 is backwards compatible with Elixir v0.12.5 and upgrading should be a clean process. 
 
 ## Maps
 
@@ -58,7 +70,7 @@ A map pattern will match any map that has the given keys and values. For example
 
 Developers can use the functions in the [`Map` module](/docs/stable/Map.html) to work with maps. For more information on maps and how they compare to other associative data structures in the language, please check the [Maps chapter in our new Getting Started guide](/getting_started/7.html). Elixir Sips has also released two episodes that cover maps ([part 1](http://elixirsips.com/episodes/054_maps_part_1.html) and [part 2](http://elixirsips.com/episodes/055_maps_part_2.html)).
 
-Finally, maps also provide special syntax for creating, accessing and updating maps with atom keys:
+Maps also provide special syntax for creating, accessing and updating maps with atom keys:
 
 ```iex
 iex> user = %{name: "josé", age: 27}
@@ -79,7 +91,7 @@ iex> %{ user | address: [] }
      :maps.update(:address, [], %{})
 ```
 
-As we will see, this functionality becomes very useful when discussing structs.
+As we will see, this functionality becomes very useful when working with structs.
 
 ## Structs
 
@@ -89,7 +101,7 @@ Structs are meant to replace Elixir records. Records in Elixir are simply tuples
 defrecord User, name: nil, age: 0
 ```
 
-Internally, this record is represeted as the following tuple:
+Internally, this record is represented as the following tuple:
 
 ```elixir
 # {tag, name, age}
@@ -98,7 +110,7 @@ Internally, this record is represeted as the following tuple:
 
 Records can also be created and pattern matched on:
 
-```elixir
+```iex
 iex> user = User[name: "josé"]
 User[name: "josé", age: 0]
 iex> user.name
@@ -109,7 +121,9 @@ iex> name
 "josé"
 ```
 
-However, records came with their own issues. First of all, since records were made of data (the underlying tuple) and a module (functions/behaviour), they were frequently misused as an attempt to write "Object Oriented" code in Elixir, for example:
+Pattern matching works because the record meta-data is stored in the User module which can be accessed when building patterns.
+
+However, records came with their own issues. First of all, since records were made of data (the underlying tuple) and a module (functions/behaviour), they were frequently misused as an attempt to bundle data and behaviour together in Elixir, for example:
 
 ```elixir
 defrecord User, name: nil, age: 0 do
@@ -121,18 +135,18 @@ end
 User["josé valim"].first_name #=> "josé"
 ```
 
-Not only that, when used in protocols for polymorphic dispatch, records were often slow because we had to check every tuple if it was an actual record or not.
+Not only that, records were often slow in protocol dispatches because every tuple can potentially be a record, sometimes leading to expensive checks at runtime.
 
-Since maps are meant to replace many cases of records in Erlang, we saw with the introduction of maps the perfect opportunity to revisit Elixir records as well. In order to understand the reasoning behind structs, let's list the features we got from records:
+Since maps are meant to replace many cases of records in Erlang, we saw with the introduction of maps the perfect opportunity to revisit Elixir records as well. In order to understand the reasoning behind structs, let's list the features we got from Elixir records:
 
 1. A way to organize data by fields
 2. Efficient in-memory representation and operations
 3. Compile-time structures with compile-time errors
 4. The basic foundation for polymorphism in Elixir
 
-Maps naturally solve issues `1.` and `2.` above. In particular, maps that have same keys share the same key-space in memory. That's why the update operation `%{map | ...}` we have seen above is relevant: if we know we are updating an existing key, the new map created as result of the update operation can share the same key space as the old map. For more details on why Maps are efficient, I would recommend [reading Joe's blog post on the matter](http://joearms.github.io/2014/02/01/big-changes-to-erlang.html).
+Maps naturally solve issues `1.` and `2.` above. In particular, maps that have same keys share the same key-space in memory. That's why the update operation `%{map | ...}` we have seen above is relevant: if we know we are updating an existing key, the new map created as result of the update operation can share the same key space as the old map without extra checks. For more details on why Maps are efficient, I would recommend [reading Joe's blog post on the matter](http://joearms.github.io/2014/02/01/big-changes-to-erlang.html).
 
-Structs address features `3.` and `4.` as follows. A struct needs to be explicitly defined via `defstruct`:
+Structs were added to address features `3.` and `4.`. A struct needs to be explicitly defined via `defstruct`:
 
 ```elixir
 defmodule User do
@@ -142,51 +156,51 @@ end
 
 Now a `User` struct can be created without a need to explicitly list all necessary fields:
 
-```elixir
+```iex
 iex> user = %User{name: "josé"}
 %User{name: "josé", age: 0}
 ```
 
 Trying to create a struct with an unknown key raises an error during compilation:
 
-```elixir
+```iex
 iex> user = %User{address: []}
 ** (CompileError) unknown key :unknown for struct User
 ```
 
 Furthermore, every struct has a `__struct__` field which contains the struct name:
 
-```elixir
+```iex
 iex> user.__struct__
 User
 ```
 
-Now, everytime there is a protocol dispatch, the protocol mechanism searches for the `__struct__` tag in order to do a polymorphic dispatch.
+The `__struct__` field is also used for polymorphic dispatch in protocols, addressing issue `4.`.
 
-It is interesting to note that structs solve both drawbacks we have earlier mentioned regarding records. Structs do not support the Object Oriented style of programming that was possible with records. Furthermore, polymorphic dispatch is now faster and more robust, because polymorphic dispatch only happens for explicitly tagged structs.
+It is interesting to note that structs solve both drawbacks we have earlier mentioned regarding records. Structs are purely data and polymorphic dispatch is now faster and more robust as it happens only for explicitly tagged structs.
 
 For more information on structs, check out the [Structs chapter in the getting started guide](/getting_started/15.html) (you may also want to read the new Protocols chapter after it).
 
 ## Maps, structs and the future
 
-With the introduction of maps and structs, some deprecations will be landing on master. First of all, the `ListDict` data structure is being deprecated and phased out. Records are also being deprecated from the language, although it is going to be a longer processes, as many projects and Elixir itself still uses records in many occasions.
+With the introduction of maps and structs, some deprecations will arrive on upcoming releases. First of all, the `ListDict` data structure is being deprecated and phased out. Records are also being deprecated from the language, although it is going to be a longer process, as many projects and Elixir itself still use records in diverse occasions.
 
-Note though, only Elixir records are being deprecated, i.e. records backed by a module. Erlang records, which are basically syntax sugar around tuples, will remain in the language for the cases Elixir developers need to interact with Erlang libraries that provide records. We expect though such cases to be rare, as records will become less common even in Erlang itself. For this reason, the new getting started guide does not even mention records.
+Note though only Elixir records are being deprecated. Erlang records, which are basically syntax sugar around tuples, will remain in the language for the rare cases Elixir developers need to interact with Erlang libraries that provide records. In particular, the [Record](/docs/stable/Record.html) has been updated to provide the new Record API (while keeping the old one for backwards compatibility).
 
 Finally, structs are still in active development and new features, like `@derive`, should land in upcoming Elixir releases. For those interested, the [original maps and structs proposal is still availble](https://gist.github.com/josevalim/b30c881df36801611d13).
 
 ## Comprehensions
 
-Erlang R17 also introduced recursion to anonymous functions. This feature, while still not available from Elixir, allows Elixir to provide a more flexible and extensible comprehensions syntax.
+Erlang R17 also introduced recursion to anonymous functions. This feature, while still not available from Elixir, allows Elixir to provide a more flexible and extensible comprehension syntax.
 
-The most common use case of a comprehensions are list comprehensions. We can get all the square values of elements in a list as follows:
+The most common use case of a comprehension are [list comprehensions](https://en.wikipedia.org/wiki/List_comprehension). For example, we can get all the square values of elements in a list as follows:
 
 ```iex
 iex> for n <- [1, 2, 3, 4], do: n * n
 [1, 4, 9, 16]
 ```
 
-We say the `n <- [1, 2, 3, 4]` part is a comprehension generator. In previous Elixir versions, Elixir supported only lists in generators. In Elixir v0.13, any Enumerable is supported:
+We say the `n <- [1, 2, 3, 4]` part is a comprehension generator. In previous Elixir versions, Elixir supported only lists in generators. In Elixir v0.13.0, any Enumerable is supported (ranges, maps, etc):
 
 ```iex
 iex> for n <- 1..4, do: n * n
@@ -198,10 +212,10 @@ As in previous Elixir versions, there is also support for a bitstring generator.
 ```iex
 iex> pixels = <<213, 45, 132, 64, 76, 32, 76, 0, 0, 234, 32, 15>>
 iex> for <<r::8, g::8, b::8 <- pixels>>, do: {r, g, b}
-[{213,45,132},{64,76,32},{76,0,0},{234,32,15}]
+[{213,45,132}, {64,76,32}, {76,0,0}, {234,32,15}]
 ```
 
-By default, a comprehension returns a list as a result. However, the result of a comprehension can be inserted into different data structures by passing the `:into` option. For example, we can use bitstring generators with the `:into` option to easily remove all spaces in a string:
+By default, a comprehension returns a list as a result. However the result of a comprehension can be inserted into different data structures by passing the `:into` option. For example, we can use bitstring generators with the `:into` option to easily remove all spaces in a string:
 
 ```iex
 iex> for <<c <- " hello world ">>, c != ?\s, into: "", do: <<c>>
@@ -210,7 +224,7 @@ iex> for <<c <- " hello world ">>, c != ?\s, into: "", do: <<c>>
 
 Sets, maps and other dictionaries can also be given with the `:into` option. In general, the `:into` accepts any structure as long as it implements the [`Collectable` protocol](/docs/stable/Collectable.html).
 
-For example, the `IO` module provides streams, that are both `Enumerable` and `Collectable`. You can implement an echo terminal that returns whatever is typed, but in upcase, using comprehensions:
+For example, the `IO` module provides streams, that are both `Enumerable` and `Collectable`. You can implement an echo terminal that returns whatever is typed into the shell, but in upcase, using comprehensions:
 
 ```iex
 iex> stream = IO.stream(:stdio, :line)
@@ -219,13 +233,13 @@ iex> for line <- stream, into: stream do
 ...> end
 ```
 
-This makes comprehensions useful not only for working with in-memory collections but also files and other sources. In future releases, we will continue exploring how to make comprehensions more expressive, following the foot steps of many functional programming research on the topic.
+This makes comprehensions useful not only for working with in-memory collections but also with files, io devices, and other sources. In future releases, we will continue exploring how to make comprehensions more expressive, following in the footsteps of other functional programming research on the topic (like Comprehensive Comprehensions and Parallel Comprehensions).
 
 ## Mix workflows
 
-The last big change we want to discuss in this release are the improvements done to Mix, Elixir's build tool. Mix is an essential tool to Elixir developers, it helps developers to compile their projects, manage their dependencies, run tests and so on. 
+The last big change we want to discuss in this release are the improvements done to Mix, Elixir's build tool. Mix is an essential tool to Elixir developers and helps developers to compile their projects, manage their dependencies, run tests and so on. 
 
-In previous releases, Mix was used to download and compile dependencies per environment. That meant the every day workflow was less than ideal: every time a dependency was updated, when swapping in between development and test environments, developers had to fetch the dependencies for each environment in distinct steps. The workflow would be something like:
+In previous releases, Mix was used to download and compile dependencies per environment. That meant the usual workflow was less than ideal: every time a dependency was updated, developers had to explicitly fetch and compile the dependencies for each environment. The workflow would be something like:
 
 ```
 $ mix deps.get
@@ -234,7 +248,7 @@ $ MIX_ENV=test mix deps.get
 $ mix test
 ```
 
-In Elixir v0.13, `mix deps.get` only fetches dependencies and it does so accross all environments (unless an `--only` flag is specified). To support this new change of behaviour, dependencies now support the `:only` option:
+In Elixir v0.13, `mix deps.get` only fetches dependencies and it does so accross all environments (unless an `--only` flag is specified). To support this new behaviour, dependencies now support the `:only` option:
 
 ```elixir
 def deps do
@@ -243,13 +257,19 @@ def deps do
 end
 ```
 
-Dependencies are now automatically compiled before you run a command. For example, `mix compile` will automatically compile pending dependencies for the current environment. `mix test` will do the same for test dependencies. In fact, if you pass an external command to Mix, like `mix ecto.migrate`, Mix will compile pending dependencies in case the command exists in any of the to-be-compiled dependencies.
+Dependencies now are also automatically compiled before you run a command. For example, `mix compile` will automatically compile pending dependencies for the current environment. `mix test` will do the same for test dependencies and so on, interrupting less the developer workflow.
+
+## hex.pm
+
+This release also marks the announcement of [hex.pm](http://hex.pm/), a package manager for the Erlang VM. Hex allows you to package and publish your projects while fetching them and performing dependency resolution in your applications.
+
+Currently Hex only integrates with Mix and contributions to extend it to other tools and other languages in the Erlang VM are welcome!
 
 ## The next steps
 
 As seen in this announcement, this release dictates many of the developments that will happen in Elixir and its community in the following weeks. All projects are recommended to start moving from records to structs, paving the way for the deprecation of records before 1.0.
 
-The next months will also focus on integrating Elixir more tightly to OTP. During the keynote at Erlang Factory, [Catalyse Change](http://www.youtube.com/watch?v=Djv4C9H9yz4), Dave Thomas and I argued that are many useful patterns, re-implemented everyday by developers, that can make development more productive within the Erlang VM if exposed accordingly.
+The next months will also focus on integrating Elixir more tightly to OTP. During the keynote at Erlang Factory, [Catalyse Change](http://www.youtube.com/watch?v=Djv4C9H9yz4), Dave Thomas and I argued that are many useful patterns, re-implemented everyday by developers, that could make development more productive within the Erlang VM if exposed accordingly.
 
 That said, in the next months we plan to:
 
@@ -259,4 +279,4 @@ That said, in the next months we plan to:
 * Study how patterns like tasks and agents can be integrated into the language, often picking up the lessons learned by libraries like [e2](http://e2project.org/erlang.html) and [functionality exposed by OTP itself](http://erlang.org/doc/man/rpc.html);
 * Rewrite the Mix and ExUnit guides to focus on applications and OTP as a whole, rebranding it to "Building Apps with Mix and OTP";
 
-You can learn more about Elixir in our [Getting Started guide](/getting_started/1.html) and download this release in the [v0.13 announcement](https://github.com/elixir-lang/elixir/releases/tag/v0.13.0).
\ No newline at end of file
+You can learn more about Elixir in our [Getting Started guide](/getting_started/1.html) and download this release in the [v0.13 announcement](https://github.com/elixir-lang/elixir/releases/tag/v0.13.0). We hope to see you in [ElixirConf](http://elixirconf.com/) as well as pushing your packages to [hex.pm](http://hex.pm/).
diff --git a/index.html b/index.html
index fa4438ae0..f84911dac 100644
--- a/index.html
+++ b/index.html
@@ -8,7 +8,7 @@
     <img src="/images/contents/home-code.png" alt="Elixir Sample" class="archive-thumbnail" />
 
     <div class="entry-summary">
-      <p>Elixir is a functional, meta-programming aware language built on top of the Erlang VM. It is a dynamic language with flexible syntax and macro support that leverages Erlang's abilities to build concurrent, distributed and fault-tolerant applications with hot code upgrades.</p>
+      <p>Elixir is a functional, meta-programming aware language built on top of the Erlang VM. It is a dynamic language that focuses on tooling to leverage Erlang's abilities to build concurrent, distributed and fault-tolerant applications with hot code upgrades.</p>
       <p>To install Elixir or learn more about it, check our <a href="/getting_started/1.html">getting started guide</a>. We also have <a href="/docs.html">online documentation available</a> and a <a href="/crash-course.html">Crash Course for Erlang developers</a>. Or you can just keep on reading for a few code samples!</p>
     </div>
   </div>

From 6f6d848d60fd16834f44804c11e211835cd868dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Mon, 21 Apr 2014 19:14:33 +0200
Subject: [PATCH 116/160] Update blog post and packages link

---
 _includes/search.html                                           | 2 +-
 _includes/top.html                                              | 2 +-
 ...sed.markdown => 2014-04-21-elixir-v0-13-0-released.markdown} | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename _posts/{2014-03-26-elixir-v0-13-0-released.markdown => 2014-04-21-elixir-v0-13-0-released.markdown} (100%)

diff --git a/_includes/search.html b/_includes/search.html
index 5a97f401b..de4b10526 100644
--- a/_includes/search.html
+++ b/_includes/search.html
@@ -1,6 +1,6 @@
 <div class="widget news">
   <h3>
-    News: <a href="/blog/2014/03/26/elixir-v0-13-0-released/">Elixir v0.13.0 released, hex.pm and ElixirConf announced</a>
+    News: <a href="/blog/2014/04/21/elixir-v0-13-0-released/">Elixir v0.13.0 released, hex.pm and ElixirConf announced</a>
   </h3>
 </div>
 
diff --git a/_includes/top.html b/_includes/top.html
index ba54713b1..26d5a7114 100644
--- a/_includes/top.html
+++ b/_includes/top.html
@@ -32,7 +32,7 @@ <h1 id="site-title">
             <li class="menu-item docs"><a class="spec" href="/docs.html">Docs</a></li>
             <li class="menu-item blog"><a class="spec" href="/blog">Blog</a></li>
             <li class="menu-item source"><a class="spec" href="https://github.com/elixir-lang/elixir" target="_blank">Source</a></li>
-            <li class="menu-item packages"><a class="spec" href="http://expm.co/" target="_blank">Packages</a></li>
+            <li class="menu-item packages"><a class="spec" href="http://hex.pm/" target="_blank">Packages</a></li>
 
           </ul>
         </div>
diff --git a/_posts/2014-03-26-elixir-v0-13-0-released.markdown b/_posts/2014-04-21-elixir-v0-13-0-released.markdown
similarity index 100%
rename from _posts/2014-03-26-elixir-v0-13-0-released.markdown
rename to _posts/2014-04-21-elixir-v0-13-0-released.markdown

From 0d7ecc4cc9d57971dd5cb8a4d0d7ca2e94a3ff41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Mon, 21 Apr 2014 19:15:55 +0200
Subject: [PATCH 117/160] Fix YAML mistake

---
 _posts/2014-04-21-elixir-v0-13-0-released.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/_posts/2014-04-21-elixir-v0-13-0-released.markdown b/_posts/2014-04-21-elixir-v0-13-0-released.markdown
index 704dc696b..0e404ef8f 100644
--- a/_posts/2014-04-21-elixir-v0-13-0-released.markdown
+++ b/_posts/2014-04-21-elixir-v0-13-0-released.markdown
@@ -3,7 +3,7 @@ layout: post
 title: Elixir v0.13.0 released, hex.pm and ElixirConf announced
 author: José Valim
 category: Releases
-excerpt: Elixir v0.13.0 comes with substantial improvements to the language: maps, structs, comprehensiona and more. It also marks the announcement of the hex.pm package manager and the announcment of ElixirConf!
+excerpt: "Elixir v0.13.0 comes with substantial improvements to the language: maps, structs, comprehensiona and more. It also marks the announcement of the hex.pm package manager and the announcment of ElixirConf!"
 ---
 
 Hello folks!

From ad9e24e9c25a9ce4193ff0b450e9c635491e3400 Mon Sep 17 00:00:00 2001
From: Alexei Sholik <alcosholik@gmail.com>
Date: Mon, 21 Apr 2014 21:06:40 +0300
Subject: [PATCH 118/160] Fix typo/grammar

---
 _posts/2014-04-21-elixir-v0-13-0-released.markdown | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/_posts/2014-04-21-elixir-v0-13-0-released.markdown b/_posts/2014-04-21-elixir-v0-13-0-released.markdown
index 0e404ef8f..798c11dd3 100644
--- a/_posts/2014-04-21-elixir-v0-13-0-released.markdown
+++ b/_posts/2014-04-21-elixir-v0-13-0-released.markdown
@@ -269,7 +269,7 @@ Currently Hex only integrates with Mix and contributions to extend it to other t
 
 As seen in this announcement, this release dictates many of the developments that will happen in Elixir and its community in the following weeks. All projects are recommended to start moving from records to structs, paving the way for the deprecation of records before 1.0.
 
-The next months will also focus on integrating Elixir more tightly to OTP. During the keynote at Erlang Factory, [Catalyse Change](http://www.youtube.com/watch?v=Djv4C9H9yz4), Dave Thomas and I argued that are many useful patterns, re-implemented everyday by developers, that could make development more productive within the Erlang VM if exposed accordingly.
+The next months will also focus on integrating Elixir more tightly to OTP. During the keynote at Erlang Factory, [Catalyse Change](http://www.youtube.com/watch?v=Djv4C9H9yz4), Dave Thomas and I argued that there are many useful patterns, re-implemented everyday by developers, that could make development more productive within the Erlang VM if exposed accordingly.
 
 That said, in the next months we plan to:
 
@@ -279,4 +279,4 @@ That said, in the next months we plan to:
 * Study how patterns like tasks and agents can be integrated into the language, often picking up the lessons learned by libraries like [e2](http://e2project.org/erlang.html) and [functionality exposed by OTP itself](http://erlang.org/doc/man/rpc.html);
 * Rewrite the Mix and ExUnit guides to focus on applications and OTP as a whole, rebranding it to "Building Apps with Mix and OTP";
 
-You can learn more about Elixir in our [Getting Started guide](/getting_started/1.html) and download this release in the [v0.13 announcement](https://github.com/elixir-lang/elixir/releases/tag/v0.13.0). We hope to see you in [ElixirConf](http://elixirconf.com/) as well as pushing your packages to [hex.pm](http://hex.pm/).
+You can learn more about Elixir in our [Getting Started guide](/getting_started/1.html) and download this release in the [v0.13 announcement](https://github.com/elixir-lang/elixir/releases/tag/v0.13.0). We hope to see you at [ElixirConf](http://elixirconf.com/) as well as pushing your packages to [hex.pm](http://hex.pm/).

From 7147b6fab7255f9873ee11f6cb27211deb0bb907 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Tue, 22 Apr 2014 12:31:03 +0200
Subject: [PATCH 119/160] Get rid of 4 meta programming chapter for now

---
 _layouts/getting_started.html   |   1 -
 getting_started/meta/3.markdown |  10 +-
 getting_started/meta/4.markdown | 202 --------------------------------
 3 files changed, 9 insertions(+), 204 deletions(-)
 delete mode 100644 getting_started/meta/4.markdown

diff --git a/_layouts/getting_started.html b/_layouts/getting_started.html
index aa10553b8..71d3d304e 100644
--- a/_layouts/getting_started.html
+++ b/_layouts/getting_started.html
@@ -52,7 +52,6 @@ <h3 class="widget-title">Meta-programming in Elixir</h3>
       <li><a class="spec" href="/getting_started/meta/1.html">Quote and unquote</a></li>
       <li><a class="spec" href="/getting_started/meta/2.html">Macros</a></li>
       <li><a class="spec" href="/getting_started/meta/3.html">Domain Specific Languages</a></li>
-      <li><a class="spec" href="/getting_started/meta/3.html">Binding and unquote fragments</a></li>
     </ol>
   </div>
 
diff --git a/getting_started/meta/3.markdown b/getting_started/meta/3.markdown
index e3827c9bf..d1b200256 100644
--- a/getting_started/meta/3.markdown
+++ b/getting_started/meta/3.markdown
@@ -2,6 +2,7 @@
 layout: getting_started
 title: 3 Domain Specific Languages
 guide: 3
+last: true
 ---
 
 # {{ page.title }}
@@ -111,7 +112,14 @@ defmodule TestCase do
   end
 
   @doc """
-  ...
+  Defines a test case with the given description.
+
+  ## Examples
+
+      test "arithmetic operations" do
+        4 = 2 + 2
+      end
+
   """
   defmacro test(description, do: block) do
     function_name = binary_to_atom("test " <> description)
diff --git a/getting_started/meta/4.markdown b/getting_started/meta/4.markdown
deleted file mode 100644
index f57476424..000000000
--- a/getting_started/meta/4.markdown
+++ /dev/null
@@ -1,202 +0,0 @@
----
-layout: getting_started
-title: 4 Binding and unquote fragments
-guide: 4
-last: true
----
-
-# {{ page.title }}
-
-Throughout this tutorial, we have learned about quoted expressions, macros and built a very simple DSL. In this chapter, we will explore more advanced macro facilities and how to use `bind_quoted` and unquote fragments to avoid common macro pitfalls.
-
-## 4.1 Unquote fragments
-
-In order to facilitate the dynamic generation of functions, `def/2`, `defp/2` and friends allow unquote fragments to be injected into their source. The example we will use throughout this chapter is a `defkv/1` macro that receives a keyword list and generates function names given by key and return the respective values when invoked.
-
-Unquote fragments allows us to generate those function names without providing a macro:
-
-```elixir
-defmodule KV do
-  kv = [foo: 1, bar: 2, baz: 3]
-
-  for {key, value} <- kv do
-    def unquote(key)(), do: unquote(value)
-  end
-end
-
-KV.foo
-#=> 1
-```
-
-The functionality above works because, as `def/2` and friends are implemented as macros, they control how unquote is expanded, effectively injecting those values during the function definition.
-
-However, the example above is useful for one-off cases. If there is a frequent need for defining functions based on a keyword list, it would be convenient to implement such as a macro. Let's give it a try:
-
-```elixir
-defmodule KV do
-  defmacro defkv(kv) do
-    for {key, value} <- kv do
-      quote do
-        def unquote(key)(), do: unquote(value)
-      end
-    end
-  end
-end
-
-defmodule MyModule do
-  import KV
-  defkv [foo: 1, bar: 2]
-end
-
-MyModule.foo
-#=> 1
-```
-
-Excellent! Our example works as expected... or does it?
-
-## 4.2 Bind quoted
-
-Our `defkv` macro implementation above has fallen into a common pitfall: we are expecting values to have a specific shape at compilation time. Let's see what happens if we try to define values dynamically:
-
-```elixir
-defmodule OtherModule do
-  import KV
-  kv = [foo: 1, bar: 2]
-  defkv kv
-end
-```
-
-The example above is going to fail because our `defkv` is expecting to receive a keyword list at compilation time. However, in the example above, our macro is receiving the quoted expression for the variable `kv`.
-
-The solution to this problem is to avoid work inside the macro body. Instead we should pass the variable as is to the quoted expression and use unquote fragments to generate the desired functions. Our first attempt at such macro would look like:
-
-```elixir
-defmodule KV do
-  defmacro defkv(kv) do
-    quote do
-      for {key, value} <- unquote(kv) do
-        def unquote(key)(), do: unquote(value)
-      end
-    end
-  end
-end
-```
-
-However, if you try to compile the code above, you will notice it fail with "undefined variable or function key/0". This happens because the macro is attempting to `unquote(key)` and the variable `key` is not available inside the macro, only inside the quoted expression. The issue here is that we have two unquotes, `unquote(kv)` and `unquote(key)`, and we want them to be executed at different times.
-
-We could attempt to disable unquoting in the quote expression. However, by doing so, we would be unable to inject the value for `kv` inside the quoted expression:
-
-```iex
-iex> Macro.to_string quote unquote: false, do: unquote(kv)
-"unquote(kv)"
-```
-
-The `bind_quoted` option exists to solve exactly this problem. By using `bind_quoted`, we can inject values inside the quoted expression without the need to unquote them. Furthermore, when `bind_quoted` is given, `unquote` is also automatically set to false. Let's rewrite the macro:
-
-```elixir
-defmodule KV do
-  defmacro defkv(kv) do
-    quote bind_quoted: [kv: kv] do
-      for {key, value} <- kv do
-        def unquote(key)(), do: unquote(value)
-      end
-    end
-  end
-end
-```
-
-In the example above, we have introduced the `kv` value inside the quoted expression with `bind_quoted` and used unquote fragments to generate the values dynamically. Using `bind_quoted` is considered a good practice as it helps avoid many common macro pitfalls.
-
-## 4.3 To escape or not to escape?
-
-There is one final limitation in our macro: it only accepts values that are valid quoted expressions. In order to make it easier to understand the issue, let's define our key and values by hand once again:
-
-```elixir
-defmodule KV do
-  kv = [foo: {1, 2, 3}]
-
-  for {key, value} <- kv do
-    def unquote(key)(), do: unquote(value)
-  end
-end
-** (CompileError) iex: invalid quoted expression: {1, 2, 3}
-```
-
-The code above failed to compile because we are trying to unquote `{1, 2, 3}`. Remember that `unquote/1` expects valid quoted expressions and `{1, 2, 3}` is not one of them. The solution here is to escape the value bejore unquoting it:
-
-```elixir
-defmodule KV do
-  kv = [foo: {1, 2, 3}]
-
-  for {key, value} <- kv do
-    def unquote(key)(), do: unquote(Macro.escape(value))
-  end
-end
-** (CompileError) iex: invalid quoted expression: {1, 2, 3}
-```
-
-To fix our macro, we just need to escape the values there too.
-
-## 4.4 Macros expansion
-
-Macros are expanded at compile-time. That's a very important distinction to make when working with macros and failing to understand this distinction can cause a lot of confusion when working with macros.
-
-In general, code execution in Elixir is done in two steps:
-
-1. All the macros in the code are expanded recursively;
-
-2. The expanded code is compiled to Erlang bytecode and executed
-
-This behavior is important to understand because it affects how we think about our code structure. Consider the following code:
-
-```elixir
-defmodule Sample do
-  case System.get_env("FULL") do
-    "true" ->
-      def full?(), do: true
-    _ ->
-      def full?(), do: false
-  end
-end
-```
-
-The code above will define a function `full?` which will return true or false depending on the value of the environment variable `FULL` at **compilation time**. In order to execute this code, Elixir will first expand all macros. Considering that `defmodule/2` and `def/2` are macros, the code will expand to something like:
-
-```elixir
-:elixir_module.define Sample, fn ->
-  case System.get_env("FULL") do
-    "true" ->
-      :elixir_def.define(Foo, :def, :full?, [], true)
-    _ ->
-      :elixir_def.define(Foo, :def, :full?, [], false)
-  end
-end
-```
-
-This code will then be executed, define a module `Sample` and define the appropriate function based on the value of the environment variable `FULL`. We achieve this by using the modules `:elixir_module` and `:elixir_def` which are Elixir internal modules written in Erlang responsible for module and function compilation.
-
-There are two lessons to take away from this example:
-
-1. a macro is always expanded, regardless if it is inside a `case` branch that won't actually match when executed;
-
-2. we cannot invoke a function or macro just after it is defined in a module. For example, consider:
-
-```elixir
-defmodule Sample do
-  def full?, do: true
-  IO.puts full?
-end
-```
-
-  The example above will fail because it translates to:
-
-```elixir
-:elixir_module.store Sample, fn ->
-  :elixir_def.store(Foo, :def, :full?, [], true)
-  IO.puts full?
-end
-```
-
-At the moment the module is being defined, there isn't **yet** a function named `full?` defined in the module so `IO.puts full?` will cause the compilation to fail.
-
-With those notes, we finish our discussion about macros. When working with macros, there are pitfalls developers should be aware of and while Elixir helps developers to avoid many of them, like by having hygiene being on by default, other pitfalls can only be avoided if developers use the proper idioms, like `bind_quoted`, when implementing their own macros.

From 144db93948cf1284d0b10d9e90bba8c08a2359b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Tue, 22 Apr 2014 12:41:48 +0200
Subject: [PATCH 120/160] Improve maps description

---
 _posts/2014-04-21-elixir-v0-13-0-released.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/_posts/2014-04-21-elixir-v0-13-0-released.markdown b/_posts/2014-04-21-elixir-v0-13-0-released.markdown
index 798c11dd3..bf6e179a2 100644
--- a/_posts/2014-04-21-elixir-v0-13-0-released.markdown
+++ b/_posts/2014-04-21-elixir-v0-13-0-released.markdown
@@ -66,7 +66,7 @@ iex> %{"other" => value} = map
 ** (MatchError) no match of right hand side value
 ```
 
-A map pattern will match any map that has the given keys and values. For example, `%{"hello" => world}` will match any map that has the key `"hello"`. An empty map therefore matches all maps.
+A map pattern will match any map that has all the keys specified in the pattern. The values for the matching keys must also match. For example, `%{"hello" => world}` will match any map that has the key `"hello"` and assign the value to `world`, while `%{"hello" => "world"}` will match any map that has the key `"hello"` with value equals to `"world"`. An empty map pattern (`%{}`) will match all maps.
 
 Developers can use the functions in the [`Map` module](/docs/stable/Map.html) to work with maps. For more information on maps and how they compare to other associative data structures in the language, please check the [Maps chapter in our new Getting Started guide](/getting_started/7.html). Elixir Sips has also released two episodes that cover maps ([part 1](http://elixirsips.com/episodes/054_maps_part_1.html) and [part 2](http://elixirsips.com/episodes/055_maps_part_2.html)).
 

From 9fb8734a73622e552ca63aff87fa019a35a8776b Mon Sep 17 00:00:00 2001
From: Pete Nicholls <pete@metanation.com>
Date: Thu, 24 Apr 2014 15:09:02 +1200
Subject: [PATCH 121/160] Link to IRC channel

---
 _includes/important-links.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/_includes/important-links.html b/_includes/important-links.html
index 69e53e5f0..5622ba913 100644
--- a/_includes/important-links.html
+++ b/_includes/important-links.html
@@ -1,7 +1,7 @@
 <div class="widget">
   <h3 class="widget-title">Join the Community</h3>
   <ul>
-    <li>#elixir-lang on freenode IRC</li>
+    <li><a class="spec" href="irc://irc.freenode.net/elixir-lang">#elixir-lang on freenode IRC</a></li>
     <li><a class="spec" href="http://groups.google.com/group/elixir-lang-talk" target="_blank">elixir-talk mailing list (questions)</a></li>
     <li><a class="spec" href="http://groups.google.com/group/elixir-lang-core" target="_blank">elixir-core mailing list (development)</a></li>
     <li><a class="spec" href="https://github.com/elixir-lang/elixir/issues" target="_blank">Issues tracker</a></li>

From 1d735dfe6bbb1e5342bbe6e53092b8ea8ae46cdb Mon Sep 17 00:00:00 2001
From: "Dickson S. Guedes" <guedes@guedesoft.net>
Date: Thu, 24 Apr 2014 00:51:44 -0300
Subject: [PATCH 122/160] fixing a typo

---
 getting_started/10.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/10.markdown b/getting_started/10.markdown
index 24f788101..fca91ff6b 100644
--- a/getting_started/10.markdown
+++ b/getting_started/10.markdown
@@ -14,7 +14,7 @@ Elixir provides the concept of enumerables and [the `Enum` module](/docs/stable/
 iex> Enum.map([1, 2, 3], fn x -> x * 2 end)
 [2, 4, 6]
 iex> Enum.map(%{1 => 2, 3 => 4}, fn {k, v} -> k * v end)
-[2, 10]
+[2, 12]
 ```
 
 The `Enum` module provides a huge range of functions to transform, sort, group, filter and retrieve items from enumerables. It is one of the modules developers use frequently in their Elixir code.

From 8cddb5a8cefe982eb56653c08a85a2104e872a32 Mon Sep 17 00:00:00 2001
From: Alexei Sholik <alcosholik@gmail.com>
Date: Thu, 24 Apr 2014 14:38:53 +0300
Subject: [PATCH 123/160] Typo, grammar, and style fixes in Sigils

---
 getting_started/19.markdown | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/getting_started/19.markdown b/getting_started/19.markdown
index 364dbb121..d0f806adc 100644
--- a/getting_started/19.markdown
+++ b/getting_started/19.markdown
@@ -26,7 +26,7 @@ iex> "bat" =~ regex
 false
 ```
 
-Elixir provides Perl-compatible regular expressions (regexes), as provided by the [PCRE](http://www.pcre.org/) library. Regexes also support modifiers. For example, the `i` modifier makes a regular expression case insensitive:
+Elixir provides Perl-compatible regular expressions (regexes), as implemented by the [PCRE](http://www.pcre.org/) library. Regexes also support modifiers. For example, the `i` modifier makes a regular expression case insensitive:
 
 ```iex
 iex> "HELLO" =~ ~r/hello/
@@ -50,7 +50,7 @@ So far, all examples have used `/` to delimit a regular expression. However sigi
 ~r<hello>
 ```
 
-The reasoning in supporting different operators is that different separators can be more convenient to different sigils. For example, using parentheses for regular expressions may be a confusing choice as they can get mixed with the parentheses inside the regex. However, parentheses can be handy for for other sigils, as we will see in the next section.
+The reasoning in supporting different operators is that different separators can be more convenient to different sigils. For example, using parentheses for regular expressions may be a confusing choice as they can get mixed with the parentheses inside the regex. However, parentheses can be handy for other sigils, as we will see in the next section.
 
 ## 19.2 Strings, char lists and words sigils
 
@@ -93,7 +93,7 @@ iex> ~S(String without escape codes and without #{interpolation})
 "String without escape codes and without \#{interpolation}"
 ```
 
-The following escape codes applies to strings and char lists:
+The following escape codes can be used in strings and char lists:
 
 * `\"` – double quote
 * `\'` – single quote
@@ -110,7 +110,7 @@ The following escape codes applies to strings and char lists:
 * `\v` – vertial tab
 * `\DDD`, `\DD`, `\D` - character with octal representation DDD, DD or D (example: `\377`)
 * `\xDD`	- character with hexadecimal representation DD (example: `\x13`)
-* `\x{D...}` -	character with hexadecimal representation with one or more hexadecimal characters (example: `\x{abc13}`)
+* `\x{D...}` -	character with hexadecimal representation with one or more hexadecimal digits (example: `\x{abc13}`)
 
 Sigils also support heredocs which is when tripe double- or single-quotes are used as separators:
 
@@ -121,7 +121,7 @@ iex> ~s"""
 ...> """
 ```
 
-The most common case for heredoc sigils is when writing documentation. For example, if you need to write escape characters in your documentation, it can become error prone as we would need to double escape some characters:
+The most common case for heredoc sigils is when writing documentation. For example, if you need to write escape characters in your documentation, it can become error prone as we would need to double-escape some characters:
 
 ```elixir
 @doc """
@@ -178,4 +178,4 @@ iex> ~i(13)
 13
 ```
 
-Sigils can also be used to do compile-time work with the help of macros. For example, regular expressions in Elixir are compiled during compilation time, therefore skipping the compilation step at runtime. If you have interest on the subject, we recommend you to check to learn more about macros and check how those sigils are implemented in the `Kernel` module.
+Sigils can also be used to do compile-time work with the help of macros. For example, regular expressions in Elixir are compiled into efficient representation during compilation of the source code, therefore skipping this step at runtime. If you have interest in the subject, we recommend you to learn more about macros and check how those sigils are implemented in the `Kernel` module.

From 13441e7b6e14b4743129091c25fbf73fc8047ce4 Mon Sep 17 00:00:00 2001
From: Dimitri Roche <dimroc@gmail.com>
Date: Fri, 25 Apr 2014 19:56:18 -0400
Subject: [PATCH 124/160] Fix code highlighting in page 10 of getting started
 docs

---
 getting_started/10.markdown | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/getting_started/10.markdown b/getting_started/10.markdown
index fca91ff6b..0a5209f40 100644
--- a/getting_started/10.markdown
+++ b/getting_started/10.markdown
@@ -81,21 +81,21 @@ iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(odd?)
 
 Many functions in the `Stream` module accept any enumerable as argument and return a stream as result. It also provides functions for creating streams, possibly infinite. For example, `Stream.cycle/1` can be used to create a stream that cycles a given enumerable infinitely. Be careful to not call a function like `Enum.map/2` on such streams, as they would cycle forever:
 
-    ```iex
-    iex> stream = Stream.cycle([1, 2, 3])
-    #Function<15.16982430/2 in Stream.cycle/1>
-    iex> Enum.take(stream, 10)
-    [1, 2, 3, 1, 2, 3, 1, 2, 3, 1]
-    ```
+```iex
+iex> stream = Stream.cycle([1, 2, 3])
+#Function<15.16982430/2 in Stream.cycle/1>
+iex> Enum.take(stream, 10)
+[1, 2, 3, 1, 2, 3, 1, 2, 3, 1]
+```
 
 On the other hand, `Stream.unfold/2` can be used to generate values from a given initial value:
 
-    ```iex
-    iex> stream = Stream.unfold("hełło", &String.next_codepoint/1)
-    #Function<15.16982430/2 in Stream.cycle/1>
-    iex> Enum.take(stream, 3)
-    ["h", "e", "ł"]
-    ```
+```iex
+iex> stream = Stream.unfold("hełło", &String.next_codepoint/1)
+#Function<15.16982430/2 in Stream.cycle/1>
+iex> Enum.take(stream, 3)
+["h", "e", "ł"]
+```
 
 Another interesting function is `Stream.resource/3` which can be used to wrap around resources, guaranteeing they are opened right before enumeration and closed afterwards, even in case of failures. For example, we can use it to stream a file:
 

From 1cdc027ee7f85af9792794cf5fc7d23382f3f591 Mon Sep 17 00:00:00 2001
From: Yu Haidong <yuhaidongyhd@gmail.com>
Date: Sat, 26 Apr 2014 22:34:12 +0800
Subject: [PATCH 125/160] Fix typo in Chapter 6

The code sample of `String.valid?/1` lacks a `<`.
---
 getting_started/6.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index 7760d9ba0..d61e724e0 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -70,7 +70,7 @@ iex> byte_size <<0, 1, 2, 3>>
 A binary is just a sequence of bytes. Of course, those bytes can be organized in any way, even in a sequence that does not make them a valid string:
 
 ```iex
-iex> String.valid?(<239, 191, 191>>)
+iex> String.valid?(<<239, 191, 191>>)
 false
 ```
 

From f17e5118cb18b933ba2a4bdb1cce0c329764ce0f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eric=20Meadows-J=C3=B6nsson?=
 <eric.meadows.jonsson@gmail.com>
Date: Tue, 29 Apr 2014 10:26:50 +0200
Subject: [PATCH 126/160] Function clause without body => function head

---
 getting_started/8.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/8.markdown b/getting_started/8.markdown
index 1c30f3f29..1de2a519d 100644
--- a/getting_started/8.markdown
+++ b/getting_started/8.markdown
@@ -190,7 +190,7 @@ hello
 :ok
 ```
 
-If a function with default values has multiple clauses, it is recommended to create a separate clause without an actual body, just for declaring defaults:
+If a function with default values has multiple clauses, it is recommended to create a function head (without an actual body), just for declaring defaults:
 
 ```elixir
 defmodule Concat do

From 0380cc926e66355aa7b1b19577d951e50aa1a65d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Thu, 1 May 2014 15:08:10 +0200
Subject: [PATCH 127/160] Update Mix docs to talk about hex

---
 getting_started/mix/1.markdown | 50 ++++++++++++++++++----------------
 getting_started/mix/3.markdown |  4 +--
 2 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/getting_started/mix/1.markdown b/getting_started/mix/1.markdown
index 66c2326ee..9a9601d4e 100644
--- a/getting_started/mix/1.markdown
+++ b/getting_started/mix/1.markdown
@@ -48,9 +48,9 @@ defmodule MyProject.Mixfile do
   use Mix.Project
 
   def project do
-    [ app: :my_project,
-      version: "0.0.1",
-      deps: deps ]
+    [app: :my_project,
+     version: "0.0.1",
+     deps: deps]
   end
 
   # Configuration for the OTP application
@@ -59,10 +59,10 @@ defmodule MyProject.Mixfile do
   end
 
   # Returns the list of dependencies in the format:
-  # { :foobar, git: "https://github.com/elixir-lang/foobar.git", tag: "0.1" }
+  # {:foobar, git: "https://github.com/elixir-lang/foobar.git", tag: "0.1"}
   #
   # To specify particular versions, regardless of the tag, do:
-  # { :barbat, "~> 0.1", github: "elixir-lang/barbat" }
+  # {:barbat, "~> 0.1", github: "elixir-lang/barbat"}
   defp deps do
     []
   end
@@ -142,20 +142,22 @@ Mix is also able to manage dependencies. Dependencies should be listed in the pr
 
 ```elixir
 def project do
-  [ app: :my_project,
-    version: "0.0.1",
-    deps: deps ]
+  [app: :my_project,
+   version: "0.0.1",
+   deps: deps]
 end
 
 defp deps do
-  [ { :some_project, github: "some_project/other", tag: "0.3.0" },
-    { :another_project, ">= 1.0.2", git: "https://example.com/another/repo.git" } ]
+  [{:some_project, ">= 0.3.0"},
+   {:another_project, git: "https://example.com/another/repo.git", tag: "v1.0.2"}]
 end
 ```
 
 **Note:** Although not required, it is common to split dependencies into their own function.
 
-The dependency is represented by an atom, followed by an optional the version requirement and some options detailed in the next section. Since most of the dependencies are git repositories, it is recommended to depend on a particular tag. However, if you want to depend on master or in a particular branch, you can define a version requirement to specify which versions of a given dependency you are willing to work against. It supports common operators like `>=`, `<=`, `>`, `==` as follows:
+The dependency is represented by an atom, followed by a requirement and some options. By default, Mix uses [hex.pm](https://hex.pm) to fetch dependencies but it can also fetch them from a git repository or directly from the filesystem.
+
+When using Hex, you must use requirements to specify which versions of a given dependency you accept. It supports common operators like `>=`, `<=`, `>`, `==` as follows:
 
     # Only version 2.0.0
     "== 2.0.0"
@@ -172,7 +174,7 @@ Since the example above is such a common requirement, it can be expressed as:
 
     "~> 2.0.0"
 
-Note that setting the version requirement does not affect the branch or tag that is checked out, so while a definition like the following is possible:
+Note that setting the version requirement for git repositories does not affect the branch or tag that is checked out, so while a definition like the following is possible:
 
     { :some_project, "~> 0.5.0", github: "some_project/other", tag: "0.3.0" }
 
@@ -180,7 +182,7 @@ It will lead to a dependency that will never be satisfied, because the tag being
 
 ### 1.4.1 Source Code Management (SCM)
 
-In the example above, we have used `git` to specify our dependencies. Mix is designed in a way it can support multiple SCM tools, shipping with `:git` and `:path` support by default. The most common options are:
+Mix is designed in a way it can support multiple SCM tools, Hex packages being the default, while `:git` and `:path` are supported as options. The most common options are:
 
 * `:git` - the dependency is a git repository that is retrieved and updated by Mix;
 * `:path` - the dependency is simply a path in the filesystem;
@@ -206,7 +208,7 @@ In order to compile a dependency, Mix looks into the repository for the best way
 If the dependency does not contain any of the above, you can specify a command directly with the `:compile` option:
 
 ```elixir
-    compile: "./configure && make"
+{:some_dep, git: "...", compile: "./configure && make"}
 ```
 
 If `:compile` is set to false, nothing is done.
@@ -249,7 +251,7 @@ defmodule Project.Mixfile do
   use Mix.Project
 
   def project do
-    [ apps_path: "apps" ]
+    [apps_path: "apps"]
   end
 end
 ```
@@ -263,14 +265,14 @@ defmodule A.Mixfile do
   use Mix.Project
 
   def project do
-    [ app: :a,
-      deps_path: "../../deps",
-      lockfile: "../../mix.lock",
-      deps: deps ]
+    [app: :a,
+     deps_path: "../../deps",
+     lockfile: "../../mix.lock",
+     deps: deps]
   end
 
   defp deps do
-    [ { :b, in_umbrella: true } ]
+    [{ :b, in_umbrella: true }]
   end
 end
 ```
@@ -285,13 +287,15 @@ Mix has the concept of environments that allows a developer to customize compila
 * `test` - used by `mix test`;
 * `prod` - the environment in which dependencies are loaded and compiled;
 
-By default, these environments behave the same and all configuration we have seen so far will affect all three environments. Customization per environment can be done using the `env:` option:
+By default, these environments behave the same and all configuration we have seen so far will affect all three environments. Customization per environment can be done by accessing `Mix.env`:
 
 ```elixir
 def project do
-  [ env: [
-    prod: [compile_path: "prod_ebin"] ] ]
+  [deps_path: deps_path(Mix.env)]
 end
+
+defp deps_path(:prod), do: "prod_deps"
+defp deps_path(_), do: "deps"
 ```
 
 Mix will default to the `dev` environment (except for tests). The environment can be changed via the `MIX_ENV` environment variable:
diff --git a/getting_started/mix/3.markdown b/getting_started/mix/3.markdown
index 30cbafa0e..0ab3f81b5 100644
--- a/getting_started/mix/3.markdown
+++ b/getting_started/mix/3.markdown
@@ -44,9 +44,9 @@ Besides those two, there is also `@hidden` attribute that, when set to true, mar
 
 When writing tasks, there are some common mix functionality we would like to access. There is a gist:
 
-* `Mix.project` - Returns the project configuration under the function `project`; Notice this function returns an empty configuration if no `mix.exs` file exists in the current directory, allowing many Mix functions to work even if a `mix.exs` project is not defined;
+* `Mix.Project.config` - Returns the project configuration under the function `project`; Notice this function returns an empty configuration if no `mix.exs` file exists in the current directory, allowing many Mix functions to work even if a `mix.exs` project is not defined;
 
-* `Mix.Project.current` - Access the module for the current project, useful in case you want to access special functions in the project. It raises an exception if no project is defined;
+* `Mix.Project.get!` - Access the module for the current project, useful in case you want to access special functions in the project. It raises an exception if no project is defined;
 
 * `Mix.shell` - The shell is a simple abstraction for doing IO in Mix. Such abstractions make it easy to test existing mix tasks. In the future, the shell will provide conveniences for colored output and getting user input;
 

From fd71c3c720d93b24160c2f4637ede63c506e395b Mon Sep 17 00:00:00 2001
From: parroty <parroty00@gmail.com>
Date: Sat, 3 May 2014 22:01:23 +0900
Subject: [PATCH 128/160] Fix link to www.erlang.org in the Maps section

---
 getting_started/7.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/7.markdown b/getting_started/7.markdown
index bcc75eac7..3161e06e1 100644
--- a/getting_started/7.markdown
+++ b/getting_started/7.markdown
@@ -156,7 +156,7 @@ In future chapters, we will also learn about structs, which provide compile-time
 
 Manipulating maps is done via [the `Map` module](/docs/stable/Map.html), it provides a very similar API to the `Keyword` module. This is because both modules implement the `Dict` behaviour.
 
-> Note: Maps were recently introduced into the Erlang VM with [EEP 43](www.erlang.org/eeps/eep-0043.html). Erlang 17 provides a partial implementation of the EEP, where only "small maps" are supported. This means maps have good performance characteristics only when storing at maximum a couple of dozens keys. To fill in this gap, Elixir also provides [the `HashDict` module](/docs/stable/HashDict.html) which uses a hashing algorithm to provide a dictionary that supports hundreds of thousands keys with good performance.
+> Note: Maps were recently introduced into the Erlang VM with [EEP 43](http://www.erlang.org/eeps/eep-0043.html). Erlang 17 provides a partial implementation of the EEP, where only "small maps" are supported. This means maps have good performance characteristics only when storing at maximum a couple of dozens keys. To fill in this gap, Elixir also provides [the `HashDict` module](/docs/stable/HashDict.html) which uses a hashing algorithm to provide a dictionary that supports hundreds of thousands keys with good performance.
 
 ## 7.3 Dicts
 

From fd22ef32ec9aee61ca2709d60f5ee2ea22019ef9 Mon Sep 17 00:00:00 2001
From: lidashuang <ldshuang@gmail.com>
Date: Mon, 5 May 2014 20:47:39 +0800
Subject: [PATCH 129/160] use defimpl

---
 getting_started/16.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/16.markdown b/getting_started/16.markdown
index cbabe4ebf..c2ef0b1d7 100644
--- a/getting_started/16.markdown
+++ b/getting_started/16.markdown
@@ -107,7 +107,7 @@ iex> Blank.blank?(%User{})
 Instead of sharing protocol implementation with maps, structs require their own protocol implementation:
 
 ```elixir
-defprotocol Blank, for: User do
+defimpl Blank, for: User do
   def blank?(_), do: false
 end
 ```

From 68bb621b28499ff6272c5fa62b11fea861033938 Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus.larsson@gmail.com>
Date: Mon, 5 May 2014 19:41:46 +0200
Subject: [PATCH 130/160] Clarified 6.3 concerning iex output of char lists

iex will only output codepoints when a char list contains a char outside the ascii range. Added result of is_list (true) in example.
---
 getting_started/6.markdown | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index d61e724e0..dd77eab61 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -159,9 +159,12 @@ A char list is nothing more than a list of characters:
 iex> 'hełło'
 [104, 101, 322, 322, 111]
 iex> is_list 'hełło'
+true
+iex> 'hello'
+'hello'
 ```
 
-You can see that, instead of containing bytes, a char list contains the codepoints of the characters in between single-quotes. So while double-quotes represents a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
+You can see that, instead of containing bytes, a char list contains the codepoints of the characters in between single-quotes (note that chars in the ASCII range are displayed as chars). So while double-quotes represents a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
 
 In practice, char lists are used mostly when interfacing with Erlang, in particular old libraries that do not accept binaries as arguments. You can convert a char list to a string and back by using the `to_string/1` and `to_char_list/1` functions:
 

From 80d27f05b5ef818073164baf3307755f11eaa6d5 Mon Sep 17 00:00:00 2001
From: Rasmus Larsson <rasmus.larsson@gmail.com>
Date: Mon, 5 May 2014 19:50:45 +0200
Subject: [PATCH 131/160] Revert "Clarified 6.3 concerning iex output of char
 lists"

This reverts commit 68bb621b28499ff6272c5fa62b11fea861033938.
---
 getting_started/6.markdown | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index dd77eab61..d61e724e0 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -159,12 +159,9 @@ A char list is nothing more than a list of characters:
 iex> 'hełło'
 [104, 101, 322, 322, 111]
 iex> is_list 'hełło'
-true
-iex> 'hello'
-'hello'
 ```
 
-You can see that, instead of containing bytes, a char list contains the codepoints of the characters in between single-quotes (note that chars in the ASCII range are displayed as chars). So while double-quotes represents a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
+You can see that, instead of containing bytes, a char list contains the codepoints of the characters in between single-quotes. So while double-quotes represents a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
 
 In practice, char lists are used mostly when interfacing with Erlang, in particular old libraries that do not accept binaries as arguments. You can convert a char list to a string and back by using the `to_string/1` and `to_char_list/1` functions:
 

From 7b80f12ac3e0bd22e257c9152f2560186795a5c9 Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus.larsson@gmail.com>
Date: Mon, 5 May 2014 19:53:23 +0200
Subject: [PATCH 132/160] Clarified 6.3 concerning iex output of char lists

---
 getting_started/6.markdown | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index d61e724e0..b46790134 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -159,9 +159,12 @@ A char list is nothing more than a list of characters:
 iex> 'hełło'
 [104, 101, 322, 322, 111]
 iex> is_list 'hełło'
+true
+iex> 'hello'
+'hello'
 ```
 
-You can see that, instead of containing bytes, a char list contains the codepoints of the characters in between single-quotes. So while double-quotes represents a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
+You can see that, instead of containing bytes, a char list contains the codepoints of the characters in between single-quotes (note that iex will only output codepoints if any of the chars is outside the ASCII range). So while double-quotes represent a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
 
 In practice, char lists are used mostly when interfacing with Erlang, in particular old libraries that do not accept binaries as arguments. You can convert a char list to a string and back by using the `to_string/1` and `to_char_list/1` functions:
 

From 2b64f918cffe2723b7e8c24625f638dec75255e9 Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus.larsson@gmail.com>
Date: Mon, 5 May 2014 19:53:23 +0200
Subject: [PATCH 133/160] Clarified 6.3 concerning iex output of char lists

---
 getting_started/6.markdown | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index d61e724e0..b46790134 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -159,9 +159,12 @@ A char list is nothing more than a list of characters:
 iex> 'hełło'
 [104, 101, 322, 322, 111]
 iex> is_list 'hełło'
+true
+iex> 'hello'
+'hello'
 ```
 
-You can see that, instead of containing bytes, a char list contains the codepoints of the characters in between single-quotes. So while double-quotes represents a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
+You can see that, instead of containing bytes, a char list contains the codepoints of the characters in between single-quotes (note that iex will only output codepoints if any of the chars is outside the ASCII range). So while double-quotes represent a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
 
 In practice, char lists are used mostly when interfacing with Erlang, in particular old libraries that do not accept binaries as arguments. You can convert a char list to a string and back by using the `to_string/1` and `to_char_list/1` functions:
 

From 18d7380e9394e6687359bc819646fa6fa54fcf2a Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus.larsson@gmail.com>
Date: Mon, 5 May 2014 20:06:25 +0200
Subject: [PATCH 134/160] Grammar and semantic ordering

Corrected singular/plural grammar issues. Reversed iex bin/oct/hex output to match order described in text.
---
 getting_started/2.markdown | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 36669531c..0561b440f 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -47,12 +47,12 @@ Notice that parentheses are not required in order to invoke a function.
 Elixir also supports shortcut notations for entering binary, octal and hexadecimal numbers:
 
 ```iex
-iex> 0x1F
-31
-iex> 0777
-511
 iex> 0b1010
 10
+iex> 0777
+511
+iex> 0x1F
+31
 ```
 
 Float numbers require a dot followed by at least one digit and also support `e` for the exponent number:
@@ -277,7 +277,7 @@ iex> size {:ok, "hello"}
 2
 ```
 
-Tuples stores elements contiguously in memory. This means accessing a tuple element per index or getting the tuple size is a fast operation (indexes start from zero):
+Tuples store elements contiguously in memory. This means accessing a tuple element per index or getting the tuple size is a fast operation (indexes start from zero):
 
 ```iex
 iex> tuple = {:ok, "hello"}
@@ -325,9 +325,9 @@ iex> list ++ [4]
 
 The first operation is fast because we are simply adding a new cons that points to the remaining of `list`. The second one is slow because we need to rebuild the whole list and add a new element to the end.
 
-Tuples, on the other hand, are stored contiguously in memory. This means getting the tuple size or accessing an element by index is fast. However, updating or adding element to tuples is expensive because it requires copying the whole tuple in memory.
+Tuples, on the other hand, are stored contiguously in memory. This means getting the tuple size or accessing an element by index is fast. However, updating or adding elements to tuples is expensive because it requires copying the whole tuple in memory.
 
-Those performance characteristics dictates the usage of those data structures. One very common use case for tuples is to use them to return extra information from a function. For example, `File.read/1` is a function that can be used to read file contents and it returns tuples:
+Those performance characteristics dictate the usage of those data structures. One very common use case for tuples is to use them to return extra information from a function. For example, `File.read/1` is a function that can be used to read file contents and it returns tuples:
 
 ```iex
 iex> File.read("path/to/existing/file")

From 7bb1f883167166d11151094cc66981fc4ff6188a Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus.larsson@gmail.com>
Date: Mon, 5 May 2014 20:09:48 +0200
Subject: [PATCH 135/160] Grammar, missing 'be'

---
 getting_started/12.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index 5ae6fe082..4d36165ad 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -153,7 +153,7 @@ The group leader can be configured per process and is used in different situatio
 
 In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
 
-The functions in `IO` and `File` also allow lists to given as arguments. Not only that, they also allow a mixed list of lists, integers and binaries to be given:
+The functions in `IO` and `File` also allow lists to be given as arguments. Not only that, they also allow a mixed list of lists, integers and binaries to be given:
 
 ```iex
 iex> IO.puts 'hello world'

From fb7f226374d74b3bd7e2c86d5f161a20d02c520b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Wed, 7 May 2014 20:22:19 +0200
Subject: [PATCH 136/160] Reorganize language highlights a bit

---
 index.html | 90 +++++++++++++++++++++++++++---------------------------
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/index.html b/index.html
index 1f845645f..ba711a904 100644
--- a/index.html
+++ b/index.html
@@ -43,7 +43,7 @@ <h4>Everything is an expression</h4>
 Hello World
 </pre>
 
-      <p>This allows a module to be defined in terms of many expressions, programmable by the developer, being the basic foundation for meta-programming. This is similar to what Joe Armstrong (creator of Erlang) proposes in his <a href="https://github.com/joearms/erl2" target="_blank">erl2 project</a>.</p>
+      <p>This allows a module to be defined in terms of many expressions, programmable by the developer, being the basic foundation for meta-programming in Elixir.</p>
     </div>
   </div>
 
@@ -67,26 +67,6 @@ <h4>Meta-programming and DSLs</h4>
     </div>
   </div>
 
-  <div class="hentry post">
-    <h4>Polymorphism via protocols</h4>
-
-    <div class="entry-summary">
-      <p>Protocols allow developers to provide type-specific functionality at chosen extension points. For example, the <code>Enum</code> module in Elixir is commonly used to iterate collections:</p>
-
-{% highlight elixir %}
-Enum.map([1,2,3], fn(x) -> x * 2 end) #=> [2,4,6]
-{% endhighlight %}
-
-      <p>Since the <code>Enum</code> module is built on top of protocols, it is not limited to the data types that ship with Elixir. A developer can use their own collections with <code>Enum</code> as long as they implement the <code>Enumerable</code> protocol. For example, a developer can use all the convenience of the <code>Enum</code> module to easily manipulate a file, line by line:</p>
-
-{% highlight elixir %}
-file  = File.stream!("README.md")
-lines = Enum.map(file, fn(line) -> Regex.replace(~r/"/, line, "'") end)
-File.write("README.md", lines)
-{% endhighlight %}
-    </div>
-  </div>
-
   <div class="hentry post">
     <h4>Documentation as first-class citizen</h4>
 
@@ -116,7 +96,27 @@ <h4>Documentation as first-class citizen</h4>
 
 {% endhighlight %}
 
-        <p>There is also a documentation generator for Elixir called <a href="https://github.com/elixir-lang/ex_doc">ExDoc</a> that can produce a static site using docstrings extracted from the source code.</p>
+      <p>Our test framework can also extract code samples from docstrings and guarantee the documentation is updated and correct! Finally, there is also a documentation generator for Elixir called <a href="https://github.com/elixir-lang/ex_doc">ExDoc</a> that can produce a static site using docstrings extracted from the source code.</p>
+    </div>
+  </div>
+
+  <div class="hentry post">
+    <h4>Tooling included</h4>
+
+    <div class="entry-summary">
+      <p>Elixir ships with a great set of tools to ease development. Mix allows you to easily create your new project, manage tasks, dependencies and more:</p>
+
+{% highlight text %}
+$ mix new my_app
+$ cd my_app
+$ mix test
+.
+
+Finished in 0.04 seconds (0.04s on load, 0.00s on tests)
+1 tests, 0 failures
+{% endhighlight %}
+
+      <p>In the example above, we have created a new project, compiled it and ran its initial test suite powered by the ExUnit test framework.</p>
     </div>
   </div>
 
@@ -130,7 +130,7 @@ <h4>Pattern matching</h4>
 { User, name, age } = User.get("John Doe")
 {% endhighlight %}
 
-      <p>When mixed with guards, pattern matching allows us to easily express our intent:</p>
+      <p>When mixed with guards, pattern matching allows us to elegantly match on the possible scenarios and express our intent accordingly:</p>
 
 {% highlight elixir %}
 def serve_drinks({ User, name, age }) when age < 21 do
@@ -147,31 +147,11 @@ <h4>Pattern matching</h4>
     </div>
   </div>
 
-  <div class="hentry post">
-    <h4>Tooling included</h4>
-
-    <div class="entry-summary">
-      <p>Elixir ships with a great set of tools to ease development. Mix allows you to easily create your new project, manage tasks and dependencies:</p>
-
-{% highlight text %}
-$ mix new my_app
-$ cd my_app
-$ mix test
-.
-
-Finished in 0.04 seconds (0.04s on load, 0.00s on tests)
-1 tests, 0 failures
-{% endhighlight %}
-
-      <p>In the example above, we have created a new project and ran its initial test suite powered by the ExUnit test framework.</p>
-    </div>
-  </div>
-
   <div class="hentry post">
     <h4>Interactive (and remote) shells</h4>
 
     <div class="entry-summary">
-      <p>Elixir also ships with an Interactive Shell, called IEx, which provides a great set of helpers for writing code, like easy access to documentation (shown above), code reloading and so on. It is also a great companion for production, as it allows for example connecting to remote nodes. Here is a quick example you can try locally. In one terminal, do:</p>
+      <p>Elixir also ships with an Interactive Shell, called IEx, which provides a great set of helpers for writing code, like easy access to documentation, code reloading, debugging and so on. It is also a great companion for production, as it allows for example connecting to remote nodes. Here is a quick example you can try locally. In one terminal, do:</p>
 
 {% highlight text %}
 $ iex --name hello
@@ -188,7 +168,27 @@ <h4>Interactive (and remote) shells</h4>
 "Distributed hello world"
 {% endhighlight %}
 
-      <p>Notice we were able to invoke a function from a module defined in the other terminal! Even the node names are the same. This will work in between machines in the same network as long as they have the same value in the <code>~/.erlang.cookie</code> file!</p>
+      <p>Notice we were able to connect and invoke a function from a module defined in the other terminal! This will work in between machines in the same network as long as they have the same value in the <code>~/.erlang.cookie</code> file!</p>
+    </div>
+  </div>
+
+  <div class="hentry post">
+    <h4>Polymorphism via protocols</h4>
+
+    <div class="entry-summary">
+      <p>Protocols allow developers to provide type-specific functionality at chosen extension points. For example, the <code>Enum</code> module in Elixir is commonly used to enumerate collections:</p>
+
+{% highlight elixir %}
+Enum.map([1,2,3], fn(x) -> x * 2 end) #=> [2,4,6]
+{% endhighlight %}
+
+      <p>Since the <code>Enum</code> module is built on top of protocols, it is not limited to the data types that ship with Elixir. A developer can use their own collections with <code>Enum</code> as long as they implement the <code>Enumerable</code> protocol. For example, a developer can use all the convenience of the <code>Enum</code> module to easily manipulate a file, line by line:</p>
+
+{% highlight elixir %}
+file  = File.stream!("README.md")
+lines = Enum.map(file, fn(line) -> Regex.replace(~r/"/, line, "'") end)
+File.write("README.md", lines)
+{% endhighlight %}
     </div>
   </div>
 

From ef8e9bd13112c4f066f482324e8fde5c1258f832 Mon Sep 17 00:00:00 2001
From: mkb <mkb@orthogonal.org>
Date: Wed, 7 May 2014 12:00:34 -0700
Subject: [PATCH 137/160] Fix typo

Did you mean "span" instead of "spawn"?
---
 getting_started/meta/2.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/meta/2.markdown b/getting_started/meta/2.markdown
index e9bc0bdbe..1c3b2aed4 100644
--- a/getting_started/meta/2.markdown
+++ b/getting_started/meta/2.markdown
@@ -8,7 +8,7 @@ guide: 2
 
 Macros can be defined in Elixir using `defmacro/2`.
 
-> For this chapter, we will be using files instead of running code samples in IEx. That's because the code samples will spawn multiple lines of code and typing them all in IEx can be counter-productive. You should be able to run the code samples by saving them into a `macros.exs` file and running it with `elixir macros.exs` or `iex macros.exs`.
+> For this chapter, we will be using files instead of running code samples in IEx. That's because the code samples will span multiple lines of code and typing them all in IEx can be counter-productive. You should be able to run the code samples by saving them into a `macros.exs` file and running it with `elixir macros.exs` or `iex macros.exs`.
 
 ## 2.1 Our first macro
 

From 42612dbc8b134624e6e7f93605ca2c8145e35320 Mon Sep 17 00:00:00 2001
From: Benjamin Tan Wei Hao <benjamintanweihao@gmail.com>
Date: Thu, 8 May 2014 23:54:55 +0800
Subject: [PATCH 138/160] Fix map syntax.

---
 crash-course.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crash-course.markdown b/crash-course.markdown
index f0e9fbd43..fa5b6c746 100644
--- a/crash-course.markdown
+++ b/crash-course.markdown
@@ -333,7 +333,7 @@ Value =:= 1
 ```elixir
 map = %{:key => 0}
 map = %{map | :key => 1}
-#{:key => value} = map
+%{:key => value} = map
 value === 1
 ```
 

From 2ae0e9fce6311399c0ed53e03297a1d33a1ce39e Mon Sep 17 00:00:00 2001
From: Benjamin Tan Wei Hao <benjamintanweihao@gmail.com>
Date: Fri, 9 May 2014 00:02:21 +0800
Subject: [PATCH 139/160] Fix typo in Maps

---
 crash-course.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crash-course.markdown b/crash-course.markdown
index f0e9fbd43..7aaee9660 100644
--- a/crash-course.markdown
+++ b/crash-course.markdown
@@ -342,7 +342,7 @@ If the keys are all atoms, Elixir allows developers to use `key: 0` for defining
 ```elixir
 map = %{key: 0}
 map = %{map | key: 1}
-map.value === 1
+map.key === 1
 ```
 
 ### Regular expressions

From f2b12e2b66a986942130f4e7ac2d5c4fd4ae8e48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sat, 10 May 2014 11:04:14 +0200
Subject: [PATCH 140/160] Improve wording regarding processes

---
 getting_started/11.markdown |  4 ++--
 index.html                  | 23 +++++++++++++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index 4dd32a2a9..49a35eb9a 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -6,9 +6,9 @@ guide: 11
 
 # {{ page.title }}
 
-In Elixir, all code runs inside processes. Processes are isolated from each other, run concurrent to one another and communicate via message passing. Processes are not only the basis for concurrency in Elixir, but they also provide the means for building distributed and highly fault-tolerant programs.
+In Elixir, all code runs inside processes. Processes are isolated from each other, run concurrent to one another and communicate via message passing. Processes are not only the basis for concurrency in Elixir, but they also provide the means for building distributed and fault-tolerant programs.
 
-Processes are extremely lightweight in terms of memory and CPU (unlike threads in many other programming languages). Because of this, it is not uncommon to have thousands of processes running simultaneously.
+Elixir's processes should not be confused with operating system processes. Processes in Elixir are extremely lightweight in terms of memory and CPU (unlike threads in many other programming languages). Because of this, it is not uncommon to have dozens of thousands of processes running simultaneously.
 
 In this chapter, we will learn about the basic constructs for spawning new processes, as well as sending and receiving messages between different processes.
 
diff --git a/index.html b/index.html
index ba711a904..e9343d85c 100644
--- a/index.html
+++ b/index.html
@@ -147,6 +147,29 @@ <h4>Pattern matching</h4>
     </div>
   </div>
 
+  <div class="hentry post">
+    <h4>Lightweight concurrency</h4>
+    <div class="entry-summary">
+      <p>All Elixir code runs inside tiny processes that are isolated and exchange information via messages:</p>
+
+{% highlight elixir %}
+parent = self()
+
+# Spawn a child process
+spawn_link(fn ->
+  send parent, {:msg, "hello world"}
+end)
+
+# Block until the message is received
+receive do
+  {:msg, contents} -> IO.puts contents
+end
+{% endhighlight %}
+
+      <p>Since processes are lightweight and isolated, Elixir it is not uncommon to have dozens of thousands of processes running simultaneously. Proceses are provide the means for building distributed and fault-tolerant applications.</p>
+    </div>
+  </div>
+
   <div class="hentry post">
     <h4>Interactive (and remote) shells</h4>
 

From cfd471882400d75d3eb4d81b42d67e307e47ad39 Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus.larsson@gmail.com>
Date: Sat, 10 May 2014 12:43:17 +0200
Subject: [PATCH 141/160] Missing 's'

---
 getting_started/11.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index 49a35eb9a..a4d665273 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -101,7 +101,7 @@ Before we finish this chapter, let's talk about process links.
 
 ## 11.3 Links
 
-The most common form of spawning in Elixir is actually via `spawn_link/1`. Before we show an example with `spawn_link/1`, let's try to see what happens when a process fail:
+The most common form of spawning in Elixir is actually via `spawn_link/1`. Before we show an example with `spawn_link/1`, let's try to see what happens when a process fails:
 
 ```iex
 iex> spawn fn -> raise "oops" end

From 5691b1e48f2f217a2e0ab6c3d81c4abce9f4436b Mon Sep 17 00:00:00 2001
From: Alexei Sholik <alcosholik@gmail.com>
Date: Thu, 15 May 2014 03:31:34 +0300
Subject: [PATCH 142/160] Fix broken headers in some chapters

---
 getting_started/1.markdown  | 8 ++++----
 getting_started/13.markdown | 6 +++---
 getting_started/16.markdown | 4 ++--
 getting_started/5.markdown  | 6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/getting_started/1.markdown b/getting_started/1.markdown
index 90b31d259..43ea9ba22 100644
--- a/getting_started/1.markdown
+++ b/getting_started/1.markdown
@@ -30,7 +30,7 @@ Notice that depending on how you installed Erlang, Erlang binaries won't be avai
 
 After Erlang is up and running, it is time to install Elixir. You can do that via Distributions, Precompiled package or Compiling from Source.
 
-### 1.2 Distributions
+## 1.2 Distributions
 
 This tutorial requires Elixir v0.13 or later and it may be available in some distributions:
 
@@ -51,11 +51,11 @@ This tutorial requires Elixir v0.13 or later and it may be available in some dis
 
 If you don't use any of the distributions above, don't worry, we also provide a precompiled package!
 
-### 1.3 Precompiled package
+## 1.3 Precompiled package
 
 Elixir provides a [precompiled package for every release](https://github.com/elixir-lang/elixir/releases/). After downloading and unzip-ing the package, you are ready to run the `elixir` and `iex` commands from the `bin` directory. It is recommended that you also add Elixir's `bin` path to your PATH environment variable to ease development.
 
-### 1.4 Compiling from source (Unix and MinGW)
+## 1.4 Compiling from source (Unix and MinGW)
 
 You can download and compile Elixir in few steps. You can get the [latest stable release here](https://github.com/elixir-lang/elixir/releases/), unpack it and then run `make` inside the unpacked directory. After that, you are ready to run the `elixir` and `iex` commands from the `bin` directory. It is recommended that you add Elixir's `bin` path to your PATH environment variable to ease development:
 
@@ -84,4 +84,4 @@ iex> "hello" <> " world"
 "hello world"
 ```
 
-It seems we are ready to go! We will use the interactive shell quite a lot in the next chapters to get a bit more familiar with the language constructs and basic types, starting in the next chapter.
\ No newline at end of file
+It seems we are ready to go! We will use the interactive shell quite a lot in the next chapters to get a bit more familiar with the language constructs and basic types, starting in the next chapter.
diff --git a/getting_started/13.markdown b/getting_started/13.markdown
index 1411ec074..6edc1e95e 100644
--- a/getting_started/13.markdown
+++ b/getting_started/13.markdown
@@ -8,7 +8,7 @@ guide: 13
 
 In order to facilitate software reuse, Elixir provides three directives. As we are going to see below, they are called directives because they have **lexical scope**.
 
-### 13.1 alias
+## 13.1 alias
 
 `alias` allows you to set up aliases for any given module name. Imagine our `Math` module uses a special list implementation for doing math specific operations:
 
@@ -57,7 +57,7 @@ end
 
 In the example above, since we are invoking `alias` inside the function `plus/2`, the alias will just be valid inside the function `plus/2`. `minus/2` won't be affected at all.
 
-### 13.2 require
+## 13.2 require
 
 Elixir provides macros as a mechanism for meta-programming (writing code that generates code).
 
@@ -76,7 +76,7 @@ In Elixir, `Integer.odd?/1` is defined as a macro so it can be used as guards. T
 
 In general a module does not need to be required before usage, except if we want to use the macros available in that module. An attempt to call a macro that was not loaded will raise an error. Note that like the `alias` directive, `require` is also lexically scoped. We will talk more about macros in a later chapter.
 
-### 13.3 import
+## 13.3 import
 
 We use `import` whenever we want to easily access functions or macros from other modules without using the qualified name. For instance, if we want to use the `duplicate` function from `List` several times, we can simply import it:
 
diff --git a/getting_started/16.markdown b/getting_started/16.markdown
index c2ef0b1d7..637cc320e 100644
--- a/getting_started/16.markdown
+++ b/getting_started/16.markdown
@@ -116,7 +116,7 @@ If desired you could come up with your own semantics for a user being blank. Not
 
 In many cases though, developers may want to provide a default implementation for structs, as explicitly implementing the protocol for all structs can be tedious. That's when falling back to Any comes in handy.
 
-### 16.2 Falling back to Any
+## 16.2 Falling back to Any
 
 It may be convenient to provide a default implementation for all types. This can be achieved by setting `@fallback_to_any` to `true` in the protocol definition:
 
@@ -137,7 +137,7 @@ end
 
 Now all data types (including structs) that we have not implemented the `Blank` protocol for will be considered non-blank.
 
-### 16.3 Built-in protocols
+## 16.3 Built-in protocols
 
 Elixir ships with some built-in protocols. In previous chapters, we have discussed the `Enum` module which provides many functions that work with any data structure that implements the `Enumerable` protocol:
 
diff --git a/getting_started/5.markdown b/getting_started/5.markdown
index 80d0744e0..70854128a 100644
--- a/getting_started/5.markdown
+++ b/getting_started/5.markdown
@@ -128,7 +128,7 @@ iex> f.(-1, 3)
 
 The number of arguments in each anonymous function clause needs to be the same, otherwise an error is raised.
 
-### 5.2 cond
+## 5.2 cond
 
 `case` is useful when you need to match against different values. However, in many circumstances, we want to check different conditions and find the first one that evaluates to true. In such cases, one may use `cond`:
 
@@ -169,7 +169,7 @@ iex> cond do
 "1 is considered as true"
 ```
 
-### 5.3 if and unless
+## 5.3 if and unless
 
 Besides `case` and `cond`, Elixir also provides the macros `if/2` and `unless/2` which are useful when you need to check for just one condition:
 
@@ -199,7 +199,7 @@ iex> if nil do
 
 > Note: An interesting note regarding `if/2` and `unless/2` is that they are implemented as macros in the language; they are special language constructs as they would be in many languages. You can check the documentation and the source of `if/2` in [the `Kernel` module docs](/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
 
-### 5.4 `do` blocks
+## 5.4 `do` blocks
 
 At this point, we have learned four control structures: `case`, `cond`, `if` and `unless`, and they were all wrapped in `do`/`end` blocks. It happens we could also write `if` as follows:
 

From 98de8772ef1ab8e606359d99108eee79593f5b1f Mon Sep 17 00:00:00 2001
From: Alexei Sholik <alcosholik@gmail.com>
Date: Thu, 15 May 2014 03:34:42 +0300
Subject: [PATCH 143/160] Add table of contents to the guide

---
 _includes/bottom.html       | 12 ++++++++
 getting_started/1.markdown  |  2 ++
 getting_started/10.markdown |  3 ++
 getting_started/11.markdown |  2 ++
 getting_started/12.markdown |  2 ++
 getting_started/13.markdown |  2 ++
 getting_started/14.markdown |  2 ++
 getting_started/15.markdown |  2 ++
 getting_started/16.markdown |  2 ++
 getting_started/17.markdown |  2 ++
 getting_started/18.markdown |  2 ++
 getting_started/19.markdown |  2 ++
 getting_started/2.markdown  |  2 ++
 getting_started/20.markdown |  2 ++
 getting_started/3.markdown  |  2 ++
 getting_started/4.markdown  |  2 ++
 getting_started/5.markdown  |  2 ++
 getting_started/6.markdown  |  2 ++
 getting_started/7.markdown  |  2 ++
 getting_started/8.markdown  |  2 ++
 getting_started/9.markdown  |  2 ++
 js/toc/LICENSE.txt          | 19 ++++++++++++
 js/toc/toc.js               | 61 +++++++++++++++++++++++++++++++++++++
 23 files changed, 133 insertions(+)
 create mode 100644 js/toc/LICENSE.txt
 create mode 100644 js/toc/toc.js

diff --git a/_includes/bottom.html b/_includes/bottom.html
index ad4721366..260664e72 100644
--- a/_includes/bottom.html
+++ b/_includes/bottom.html
@@ -20,5 +20,17 @@
       var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
     })();
   </script>
+
+  <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
+  <script src="/js/toc/toc.js" type="text/javascript" charset="utf-8"></script>
+  <script type="text/javascript">
+    $(document).ready(function() {
+        $('.toc').toc({
+          title: '',
+          listType: 'ul',
+          showSpeed: 0,
+        });
+    });
+  </script>
 </body>
 </html>
diff --git a/getting_started/1.markdown b/getting_started/1.markdown
index 43ea9ba22..0aeeb3fa2 100644
--- a/getting_started/1.markdown
+++ b/getting_started/1.markdown
@@ -6,6 +6,8 @@ guide: 1
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 Welcome!
 
 In this tutorial we are going to show you how to get started with Elixir. This chapter will cover installation and how to get started with the Interactive Elixir shell called IEx.
diff --git a/getting_started/10.markdown b/getting_started/10.markdown
index 0a5209f40..6f05eb4cc 100644
--- a/getting_started/10.markdown
+++ b/getting_started/10.markdown
@@ -6,6 +6,9 @@ guide: 10
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+  <p></p>
+
 ## 10.1 Enumerables
 
 Elixir provides the concept of enumerables and [the `Enum` module](/docs/stable/Enum.html) to work with them. We have already learned two enumerables: lists and maps.
diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index 49a35eb9a..207e5df89 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -6,6 +6,8 @@ guide: 11
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 In Elixir, all code runs inside processes. Processes are isolated from each other, run concurrent to one another and communicate via message passing. Processes are not only the basis for concurrency in Elixir, but they also provide the means for building distributed and fault-tolerant programs.
 
 Elixir's processes should not be confused with operating system processes. Processes in Elixir are extremely lightweight in terms of memory and CPU (unlike threads in many other programming languages). Because of this, it is not uncommon to have dozens of thousands of processes running simultaneously.
diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index 5ae6fe082..bc35a6347 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -6,6 +6,8 @@ guide: 12
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 This chapter is a quick introduction to input/output mechanisms in Elixir and related modules, like [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html) and [`Path`](/docs/stable/Path.html).
 
 We had originally sketched this chapter to come much earlier in the getting started guide. However, we noticed the IO system provides a great opportunity to shed some light on some philosophies and curiosities of Elixir and the VM.
diff --git a/getting_started/13.markdown b/getting_started/13.markdown
index 6edc1e95e..7654fbbcd 100644
--- a/getting_started/13.markdown
+++ b/getting_started/13.markdown
@@ -6,6 +6,8 @@ guide: 13
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 In order to facilitate software reuse, Elixir provides three directives. As we are going to see below, they are called directives because they have **lexical scope**.
 
 ## 13.1 alias
diff --git a/getting_started/14.markdown b/getting_started/14.markdown
index 70bf2b05c..ff9658982 100644
--- a/getting_started/14.markdown
+++ b/getting_started/14.markdown
@@ -6,6 +6,8 @@ guide: 14
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 Module attributes in Elixir serve three purposes:
 
 1. They serve to annotate the module, often with information to be used by the user or the VM.
diff --git a/getting_started/15.markdown b/getting_started/15.markdown
index 2f8286c3a..935dd5eff 100644
--- a/getting_started/15.markdown
+++ b/getting_started/15.markdown
@@ -6,6 +6,8 @@ guide: 15
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 In early chapters, we have learned about maps:
 
 ```iex
diff --git a/getting_started/16.markdown b/getting_started/16.markdown
index 637cc320e..73b1207e4 100644
--- a/getting_started/16.markdown
+++ b/getting_started/16.markdown
@@ -6,6 +6,8 @@ guide: 16
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 Protocols are a mechanism to achieve polymorphism in Elixir. Dispatching on a protocol is available to any data type as long as it implements the protocol. Let's see an example.
 
 In Elixir, only `false` and `nil` are treated as false. Everything else evaluates to true. Depending on the application, it may be important to specify a `blank?` protocol that returns a boolean for other data types that should be considered blank. For instance, an empty list or an empty binary could be considered blanks.
diff --git a/getting_started/17.markdown b/getting_started/17.markdown
index ec5b886e6..83b2b9c5c 100644
--- a/getting_started/17.markdown
+++ b/getting_started/17.markdown
@@ -6,6 +6,8 @@ guide: 17
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 Elixir has three error mechanisms: errors, throws and exits. In this chapter we will explore each of them and include remarks about when each should be used.
 
 ## 17.1 Errors
diff --git a/getting_started/18.markdown b/getting_started/18.markdown
index d927ecda6..c360c9823 100644
--- a/getting_started/18.markdown
+++ b/getting_started/18.markdown
@@ -6,6 +6,8 @@ guide: 18
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 In Elixir, it is common to loop over Enumerables, often filtering some results, and mapping to another list of values. Comprehensions are syntax sugar for such constructs, grouping those common tasks into the `for` special form.
 
 For example, we can get all the square values of elements in a list as follows:
diff --git a/getting_started/19.markdown b/getting_started/19.markdown
index d0f806adc..7e88415fd 100644
--- a/getting_started/19.markdown
+++ b/getting_started/19.markdown
@@ -6,6 +6,8 @@ guide: 19
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 We have already learned Elixir provides double-quoted strings and single-quoted char lists. However, this only covers the surface of structures that have textual representation in the language. Atoms are, for example, another structure which are mostly created via the `:atom` representation.
 
 One of Elixir's goals is extensibility: developers should be able to extend the language to particular domains. Computer science has become such a wide field that it is impossible for a language to tackle many fields as part of its core. Our best bet is to rather make the language extensible, so developers, companies and communities can extend the language to their relevant domains.
diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index 36669531c..b33c8a058 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -6,6 +6,8 @@ guide: 2
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 In this chapter we will learn more about Elixir basic types: integers, floats, atoms, lists and strings. Some basic types are:
 
 ```iex
diff --git a/getting_started/20.markdown b/getting_started/20.markdown
index f9286d166..758ae75b5 100644
--- a/getting_started/20.markdown
+++ b/getting_started/20.markdown
@@ -7,6 +7,8 @@ last: true
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 Eager to learn more? Keep on reading!
 
 ## 20.1 Build your first Elixir project
diff --git a/getting_started/3.markdown b/getting_started/3.markdown
index a457d9a08..cb17c874b 100644
--- a/getting_started/3.markdown
+++ b/getting_started/3.markdown
@@ -6,6 +6,8 @@ guide: 3
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 In the previous chapter, we saw Elixir provides `+`, `-`, `*`, `/` as arithmetic operators, plus the functions `div/2` and `rem/2` for integer division and remainder.
 
 Elixir also provides `++` and `--` to manipulate lists:
diff --git a/getting_started/4.markdown b/getting_started/4.markdown
index 28a0288e6..c545cd215 100644
--- a/getting_started/4.markdown
+++ b/getting_started/4.markdown
@@ -6,6 +6,8 @@ guide: 4
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 In this chapter, we will show how the `=` operator in Elixir is actually a match operator and how to use it to pattern match inside data structures. Finally, we will learn about the pin operator `^` used to access previously bound values.
 
 ## 4.1 The match operator
diff --git a/getting_started/5.markdown b/getting_started/5.markdown
index 70854128a..72224bbfb 100644
--- a/getting_started/5.markdown
+++ b/getting_started/5.markdown
@@ -6,6 +6,8 @@ guide: 5
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 In this chapter, we will learn about the `case`, `cond` and `if` control-flow structures.
 
 ## 5.1 case
diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index b46790134..178bc48c5 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -6,6 +6,8 @@ guide: 6
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 In "Basic Types", we learned about strings and used the `is_binary/1` function for checks:
 
 ```iex
diff --git a/getting_started/7.markdown b/getting_started/7.markdown
index 3161e06e1..871916e34 100644
--- a/getting_started/7.markdown
+++ b/getting_started/7.markdown
@@ -6,6 +6,8 @@ guide: 7
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 So far we haven't discussed any associative data structures, i.e. data structures that are able to associate a certain value (or multiple values) to a key. Different languages call these different names like dictionaries, hashes, associative arrays, maps, etc.
 
 In Elixir, we have two main associative data structures: keyword lists and maps. It's time to learn more about them!
diff --git a/getting_started/8.markdown b/getting_started/8.markdown
index 1de2a519d..2989a6416 100644
--- a/getting_started/8.markdown
+++ b/getting_started/8.markdown
@@ -6,6 +6,8 @@ guide: 8
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 In Elixir we group several functions into modules. We've already used many different modules in the previous chapters like [the `String` module](/docs/stable/String.html):
 
 ```iex
diff --git a/getting_started/9.markdown b/getting_started/9.markdown
index 04c2e4647..cbf7c8d84 100644
--- a/getting_started/9.markdown
+++ b/getting_started/9.markdown
@@ -6,6 +6,8 @@ guide: 9
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 Due to immutability, loops in Elixir (and in functional programming languages) are written differently from conventional imperative languages. For example, in an imperative language, one would write:
 
 ```c
diff --git a/js/toc/LICENSE.txt b/js/toc/LICENSE.txt
new file mode 100644
index 000000000..a7bffafe8
--- /dev/null
+++ b/js/toc/LICENSE.txt
@@ -0,0 +1,19 @@
+Copyright (c) 2013 Alex Ghiculescu
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/js/toc/toc.js b/js/toc/toc.js
new file mode 100644
index 000000000..4701f1409
--- /dev/null
+++ b/js/toc/toc.js
@@ -0,0 +1,61 @@
+// https://github.com/ghiculescu/jekyll-table-of-contents
+(function($){
+  $.fn.toc = function(options) {
+    var defaults = {
+      noBackToTopLinks: false,
+      title: '<i>Jump to...</i>',
+      listType: 'ol', // values: [ol|ul]
+      showSpeed: 'slow'
+    },
+    settings = $.extend(defaults, options);
+
+    // I modified the single line below to exlude h1 header
+    // --alco
+    var headers = $('h2, h3, h4, h5, h6').filter(function() {
+      // get all headers with an ID
+      return this.id;
+    }), output = $(this);
+    if (!headers.length || headers.length < 3 || !output.length) {
+      return;
+    }
+
+    var get_level = function(ele) { return parseInt(ele.nodeName.replace("H", ""), 10); }
+    var highest_level = headers.map(function(_, ele) { return get_level(ele); }).get().sort()[0];
+    var return_to_top = '<i class="icon-arrow-up back-to-top"> </i>';
+
+    var level = get_level(headers[0]),
+      this_level,
+      html = settings.title + " <"+settings.listType+">";
+    headers.on('click', function() {
+      if (!settings.noBackToTopLinks) {
+        window.location.hash = this.id;
+      }
+    })
+    .addClass('clickable-header')
+    .each(function(_, header) {
+      this_level = get_level(header);
+      if (!settings.noBackToTopLinks && this_level === highest_level) {
+        $(header).addClass('top-level-header').after(return_to_top);
+      }
+      if (this_level === level) // same level as before; same indenting
+        html += "<li><a href='#" + header.id + "'>" + header.innerHTML + "</a>";
+      else if (this_level < level) // higher level than before; end parent ol
+        html += "</li></"+settings.listType+"></li><li><a href='#" + header.id + "'>" + header.innerHTML + "</a>";
+      else if (this_level > level) // lower level than before; expand the previous to contain a ol
+        html += "<"+settings.listType+"><li><a href='#" + header.id + "'>" + header.innerHTML + "</a>";
+      level = this_level; // update for the next one
+    });
+    html += "</"+settings.listType+">";
+    if (!settings.noBackToTopLinks) {
+      $(document).on('click', '.back-to-top', function() {
+        $(window).scrollTop(0);
+        window.location.hash = '';
+      });
+    }
+    if (0 !== settings.showSpeed) {
+      output.hide().html(html).show(settings.showSpeed);
+    } else {
+      output.html(html);
+    }
+  };
+})(jQuery);

From f9b61b973666124985bb997192547025ceced164 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sat, 17 May 2014 00:35:37 +0200
Subject: [PATCH 144/160] Simplify iodata and chardata bit

---
 getting_started/12.markdown | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index bc35a6347..18c6d6cb7 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -151,7 +151,7 @@ hello
 
 The group leader can be configured per process and is used in different situations, for example, when executing code in remote nodes, it guarantees messages printed in the remote node are redirected and printed in the "executor" one.
 
-## 12.5 `iodata` and `char_data`
+## 12.5 `iodata` and `chardata`
 
 In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
 
@@ -166,12 +166,10 @@ hello world
 :ok
 ```
 
-However, this requires some attention. A char list needs to be encoded into bytes when written to disk and that depends on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of bytes and binaries to be given. If you provide a list of codepoints and those codepoints have value more than 255, the operation will fail since we won't know how to encode them.
+However, this requires some attention. A list may represent either a bunch of bytes or a bunch of characters and which one to use depends on the encoding of the IO device. If the file is opened without encoding, the file is expected to be in raw mode, and the functions in the `IO` module starting with `bin*` must be used. Those functions expect an `iodata` as argument, i.e. it expects a list of integers representing bytes and binaries to be given.
 
 On the other hand, `:stdio` and files opened with `:utf8` encoding work with the remaining functions in the `IO` module and those expect a `char_data` as argument, i.e. they expect a list of characters or strings to be given.
 
 Although this is a subtle difference, you only need to worry about those details if you intend to pass lists to those functions. Binaries are already represented by the underlying bytes and as such their representation is always raw.
 
-When working with iodata and char data, Elixir provides `iodata_to_binary/1` to convert any `iodata` to binary. The functions `String.from_char_data!/1` and `List.from_char_data!/1` can be used to convert char data into strings or char lists respectively. Unless you are working closely with some devices, you will rarely need to use those functions.
-
-This finishes our tour on IO devices and IO related functionality. We have learned about four Elixir modules, [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html), [`Path`](/docs/stable/Path.html) and [`StringIO`](/docs/stable/StringIO.html), as well as how the VM uses processes for the underlying IO mechanisms and how to use (char and io) lists for IO operations.
+This finishes our tour on IO devices and IO related functionality. We have learned about four Elixir modules, [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html), [`Path`](/docs/stable/Path.html) and [`StringIO`](/docs/stable/StringIO.html), as well as how the VM uses processes for the underlying IO mechanisms and how to use (char and io) data for IO operations.

From 9e9727e6f924130c441d4de2856e87023dbd5401 Mon Sep 17 00:00:00 2001
From: Alexei Sholik <alcosholik@gmail.com>
Date: Sat, 17 May 2014 02:00:09 +0300
Subject: [PATCH 145/160] Add table of contents to the remaining guides

---
 getting_started/ex_unit/1.markdown | 2 ++
 getting_started/meta/1.markdown    | 2 ++
 getting_started/meta/2.markdown    | 2 ++
 getting_started/meta/3.markdown    | 2 ++
 getting_started/mix/1.markdown     | 2 ++
 getting_started/mix/2.markdown     | 2 ++
 getting_started/mix/3.markdown     | 2 ++
 js/toc/toc.js                      | 4 +++-
 8 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/getting_started/ex_unit/1.markdown b/getting_started/ex_unit/1.markdown
index 133a1f12a..e887c19ef 100644
--- a/getting_started/ex_unit/1.markdown
+++ b/getting_started/ex_unit/1.markdown
@@ -7,6 +7,8 @@ last: true
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 ExUnit is a unit test framework that ships with Elixir.
 
 Using ExUnit is quite easy, here is a file with the minimum required:
diff --git a/getting_started/meta/1.markdown b/getting_started/meta/1.markdown
index d5fc87d49..0e8064f54 100644
--- a/getting_started/meta/1.markdown
+++ b/getting_started/meta/1.markdown
@@ -6,6 +6,8 @@ guide: 1
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 An Elixir program can be represented by its own data structures. In this chapter, we will learn how those structures look like and how to compose them. The concepts learned in this chapter are the building blocks for macros, which we are going to take a deeper look at the next chapter.
 
 ## 1.1 Quoting
diff --git a/getting_started/meta/2.markdown b/getting_started/meta/2.markdown
index 1c3b2aed4..9dc21e70d 100644
--- a/getting_started/meta/2.markdown
+++ b/getting_started/meta/2.markdown
@@ -6,6 +6,8 @@ guide: 2
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 Macros can be defined in Elixir using `defmacro/2`.
 
 > For this chapter, we will be using files instead of running code samples in IEx. That's because the code samples will span multiple lines of code and typing them all in IEx can be counter-productive. You should be able to run the code samples by saving them into a `macros.exs` file and running it with `elixir macros.exs` or `iex macros.exs`.
diff --git a/getting_started/meta/3.markdown b/getting_started/meta/3.markdown
index d1b200256..8fe81ae00 100644
--- a/getting_started/meta/3.markdown
+++ b/getting_started/meta/3.markdown
@@ -7,6 +7,8 @@ last: true
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 [Domain Specific Languages](https://en.wikipedia.org/wiki/Domain-specific_language) allows developers to specialize their application to a particular domain. There are many language features that come together to aid developers to write Domain Specific Languages and in this chapter we will focus on just one of them.
 
 In particular, we will focus on how macros and module attributes can be used together to create domain specific modules, that are focused on solving one particular example. To showcase our implementation, we will write a very simple test case implementation.
diff --git a/getting_started/mix/1.markdown b/getting_started/mix/1.markdown
index 9a9601d4e..0422efc59 100644
--- a/getting_started/mix/1.markdown
+++ b/getting_started/mix/1.markdown
@@ -6,6 +6,8 @@ guide: 1
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 Elixir ships with a few applications to make building and deploying projects with Elixir easier and Mix is certainly their backbone.
 
 Mix is a build tool that provides tasks for creating, compiling, testing (and soon releasing) Elixir projects. Mix is inspired by the [Leiningen](https://github.com/technomancy/leiningen) build tool for Clojure and was written by one of its contributors.
diff --git a/getting_started/mix/2.markdown b/getting_started/mix/2.markdown
index eb6834751..32924e27e 100644
--- a/getting_started/mix/2.markdown
+++ b/getting_started/mix/2.markdown
@@ -6,6 +6,8 @@ guide: 2
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 Where do we keep state in Elixir?
 
 Our software needs to keep state, configuration values, data about the running system, etc. We have learned in [previous sections](../2.html#receive) how we can use processes/actors to keep state, receiving and responding to messages in a loop but this approach seems to be brittle. What happens if there is an error in our actor and it crashes? Even more, is it really required to create a new process when all we want to do is to keep simple configuration values?
diff --git a/getting_started/mix/3.markdown b/getting_started/mix/3.markdown
index 0ab3f81b5..bc1e51e17 100644
--- a/getting_started/mix/3.markdown
+++ b/getting_started/mix/3.markdown
@@ -7,6 +7,8 @@ last: true
 
 # {{ page.title }}
 
+  <div class="toc"></div>
+
 In Mix, a task is simply an Elixir module inside the `Mix.Tasks` namespace containing a `run/1` function. For example, the `compile` task is a module named `Mix.Tasks.Compile`.
 
 Let's create a simple task:
diff --git a/js/toc/toc.js b/js/toc/toc.js
index 4701f1409..7b7e3e9e8 100644
--- a/js/toc/toc.js
+++ b/js/toc/toc.js
@@ -15,7 +15,9 @@
       // get all headers with an ID
       return this.id;
     }), output = $(this);
-    if (!headers.length || headers.length < 3 || !output.length) {
+    // Show the toc when there are at least 2 headers
+    // --alco
+    if (!headers.length || headers.length < 2 || !output.length) {
       return;
     }
 

From 7ae8264ef69c045c5e849871c7312f5735b2f4e6 Mon Sep 17 00:00:00 2001
From: Theo Pack <tf.pack@gmail.com>
Date: Sat, 17 May 2014 10:11:24 +0200
Subject: [PATCH 146/160] Add code editor support link for Atom

---
 _includes/important-links.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/_includes/important-links.html b/_includes/important-links.html
index 5622ba913..9b2411949 100644
--- a/_includes/important-links.html
+++ b/_includes/important-links.html
@@ -26,6 +26,7 @@ <h3 class="widget-title">Code editor support</h3>
     <li><a class="spec" href="https://github.com/elixir-lang/elixir-tmbundle" target="_blank">Textmate Bundle</a></li>
     <li><a class="spec" href="https://github.com/elixir-lang/vim-elixir" target="_blank">Vim Elixir</a></li>
     <li><a class="spec" href="https://github.com/SteffenBauer/elixir-gtksourceview" target="_blank">GtkSourceView (gedit)</a></li>
+    <li><a class="spec" href="https://github.com/lucasmazza/language-elixir" target="_blank">Atom Package</a></li>
   </ul>
 </div>
 

From 3be685194cf540ac817f3ac8b5180eb2e4d5ff00 Mon Sep 17 00:00:00 2001
From: Josh Adams <josh@isotope11.com>
Date: Sat, 17 May 2014 17:17:27 -0500
Subject: [PATCH 147/160] Type a fixo: Somtimes -> Sometimes

---
 getting_started/17.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/17.markdown b/getting_started/17.markdown
index 83b2b9c5c..d089bcb77 100644
--- a/getting_started/17.markdown
+++ b/getting_started/17.markdown
@@ -143,7 +143,7 @@ It is exactly this supervision system that makes constructs like `try/catch` and
 
 ## 17.4 After
 
-Somtimes it is necessary to use `try/after` to guarantee a resource is cleaned up after some particular action. For example, we can open a file and guarantee it is closed with `try/after` block:
+Sometimes it is necessary to use `try/after` to guarantee a resource is cleaned up after some particular action. For example, we can open a file and guarantee it is closed with `try/after` block:
 
 ```iex
 iex> {:ok, file} = File.open "sample", [:utf8, :write]

From e77f60c1b5b762927466f839e5dcab2f1a4c1bc4 Mon Sep 17 00:00:00 2001
From: Luke Imhoff <Kronic.Deth@gmail.com>
Date: Sun, 18 May 2014 17:54:23 -0500
Subject: [PATCH 148/160] StringIO.start -> StringIO.open

The function to create a StringIO is `open/1`, not `start/1` in the current versions of Elixir as confirmed by the docs and me just running through the Getting Started guide in iex.

```iex
iex(15)> {:ok, pid} = StringIO.start("hello")
** (UndefinedFunctionError) undefined function: StringIO.start/1
    (elixir) StringIO.start("hello")
iex(15)> l StringIO
{:module, StringIO}
iex(16)> {:ok, pid} = StringIO.start("hello")
** (UndefinedFunctionError) undefined function: StringIO.start/1
    (elixir) StringIO.start("hello")
iex(16)> StringIO.
close/1       contents/1    open/2
iex(16)> {:ok, pid} = StringIO.open("hello")
{:ok, #PID<0.68.0>}
```
---
 getting_started/12.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index 18c6d6cb7..1013ab015 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -130,7 +130,7 @@ After `IO.write/2`, we can see the request sent by the IO module printed, which
 The [`StringIO`](/docs/stable/StringIO.html) module provides an implementation of the IO device messages on top of a string:
 
 ```iex
-iex> {:ok, pid} = StringIO.start("hello")
+iex> {:ok, pid} = StringIO.open("hello")
 {:ok, #PID<0.43.0>}
 iex> IO.read(pid, 2)
 "he"

From 47db88770d1632c445ba88ca8f8f672de760c5ae Mon Sep 17 00:00:00 2001
From: Luke Imhoff <Kronic.Deth@gmail.com>
Date: Sun, 18 May 2014 20:20:04 -0500
Subject: [PATCH 149/160] Use defined variable

The last example showing that `:oops` is not a valid key uses the undefined variable `user` instead of the defined `User`s, either `jose` or `eric`, so instead of `ArgumentError` being raised, a `RuntimeError` is raised:

```iex
iex(26)> %{user | oops: :field}
** (RuntimeError) undefined function: user/0
iex(26)> %{eric | oops: :field}
** (ArgumentError) argument error
    (stdlib) :maps.update(:oops, :field, %User{age: 27, name: "eric"})
```
---
 getting_started/15.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/15.markdown b/getting_started/15.markdown
index 935dd5eff..e931afa2b 100644
--- a/getting_started/15.markdown
+++ b/getting_started/15.markdown
@@ -58,7 +58,7 @@ iex> jose.name
 "jose"
 iex> eric = %{jose | name: "eric"}
 %User{name: "eric", age: 27}
-iex> %{user | oops: :field}
+iex> %{eric | oops: :field}
 ** (ArgumentError) argument error
 ```
 

From 242cdf01fca048338aab35f3b8664f61f4f7c826 Mon Sep 17 00:00:00 2001
From: ChangMin Jeon <jcm1981@gmail.com>
Date: Tue, 20 May 2014 13:43:43 +0900
Subject: [PATCH 150/160] Fix a Type: iex. -> iex>

---
 getting_started/17.markdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getting_started/17.markdown b/getting_started/17.markdown
index d089bcb77..912b7138c 100644
--- a/getting_started/17.markdown
+++ b/getting_started/17.markdown
@@ -60,7 +60,7 @@ The example above rescues the runtime error and returns the error itself which i
 ```iex
 iex> File.read "hello"
 {:error, :enoent}
-iex. File.write "hello", "world"
+iex> File.write "hello", "world"
 :ok
 iex> File.read "hello"
 {:ok, "world"}

From 46de8276db77c601df2bf5cb5aadc3711456c451 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Tue, 20 May 2014 10:08:23 +0200
Subject: [PATCH 151/160] Remove reference to records from crash course

---
 crash-course.markdown | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/crash-course.markdown b/crash-course.markdown
index b37f6ba25..5bb840a82 100644
--- a/crash-course.markdown
+++ b/crash-course.markdown
@@ -434,9 +434,6 @@ defmodule HelloModule do
     end
   end
 
-  # More on this in the Records section
-  defrecord State, ponies: [:sally]
-
   def dummy do
     :ok
   end
@@ -453,9 +450,6 @@ HelloModule.Utils.util
 
 HelloModule.Utils.priv
 #=> ** (UndefinedFunctionError) undefined function: HelloModule.Utils.priv/0
-
-HelloModule.State.new
-#=> HelloModule.State[ponies: [:sally]]
 ```
 
 <div id="function_syntax"></div>

From 82781079f8067b625328528b3696e26c50ff66a7 Mon Sep 17 00:00:00 2001
From: Alexei Sholik <alcosholik@gmail.com>
Date: Wed, 21 May 2014 04:20:27 +0300
Subject: [PATCH 152/160] Fix ordinary typos in guides

---
 getting_started/12.markdown     | 4 ++--
 getting_started/17.markdown     | 2 +-
 getting_started/19.markdown     | 2 +-
 getting_started/2.markdown      | 2 +-
 getting_started/meta/3.markdown | 2 +-
 getting_started/mix/1.markdown  | 4 ++--
 getting_started/mix/2.markdown  | 8 ++++----
 7 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index 1013ab015..bf4f632b8 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -55,7 +55,7 @@ iex> {:ok, file} = File.open "another", [:write, :utf8]
 {:ok, #PID<0.48.0>}
 ```
 
-Besides functions for opening, reading and writing files, the `File` module has many functions that work on the filesystem. Those functions are named after their UNIX equivalents. For example, `File.rm/1` can be used to remove files, `File.mkdir/1` to create directories, `File.mkdir_p/1` creates directories guaranteeing their parents exists and there is even `File.cp_r/2` and `File.rm_rf/2` which copy and remove files and directories recursively.
+Besides functions for opening, reading and writing files, the `File` module has many functions that work on the file system. Those functions are named after their UNIX equivalents. For example, `File.rm/1` can be used to remove files, `File.mkdir/1` to create directories, `File.mkdir_p/1` creates directories guaranteeing their parents exists and there is even `File.cp_r/2` and `File.rm_rf/2` which copy and remove files and directories recursively.
 
 You will also notice that functions in the `File` module have two variants, one with `!` (bang) in its name and others without. For example, when we read the "hello" file above, we have used the one without `!`. Let's try some new examples:
 
@@ -102,7 +102,7 @@ iex> Path.expand("~/hello")
 "/Users/jose/hello"
 ```
 
-With this we have covered the main modules for doing IO and interacting with the filesystem. Next we will discuss some curiosities and advanced topics regarding IO. Those sections are not necessary to write Elixir code, so feel free to skip them, but they do provide an overview of how the IO system is implemented in the VM and other curiosities.
+With this we have covered the main modules for doing IO and interacting with the file system. Next we will discuss some curiosities and advanced topics regarding IO. Those sections are not necessary to write Elixir code, so feel free to skip them, but they do provide an overview of how the IO system is implemented in the VM and other curiosities.
 
 ## 12.4 Processes and group leaders
 
diff --git a/getting_started/17.markdown b/getting_started/17.markdown
index 912b7138c..c6e3dafa2 100644
--- a/getting_started/17.markdown
+++ b/getting_started/17.markdown
@@ -55,7 +55,7 @@ iex> try do
 RuntimeError[message: "oops"]
 ```
 
-The example above rescues the runtime error and returns the error itself which is then printed in the `iex` session. In practice Elixir developers rarely use the `try/rescue` construct though. For example, many languages would force you to rescue an error when a file cannot open succcessfully. Elixir instead provides a `File.read/1` function which returns a tuple containing information if the file was opened with success or not:
+The example above rescues the runtime error and returns the error itself which is then printed in the `iex` session. In practice Elixir developers rarely use the `try/rescue` construct though. For example, many languages would force you to rescue an error when a file cannot open successfully. Elixir instead provides a `File.read/1` function which returns a tuple containing information if the file was opened with success or not:
 
 ```iex
 iex> File.read "hello"
diff --git a/getting_started/19.markdown b/getting_started/19.markdown
index 7e88415fd..648a8cc36 100644
--- a/getting_started/19.markdown
+++ b/getting_started/19.markdown
@@ -109,7 +109,7 @@ The following escape codes can be used in strings and char lists:
 * `\r` – carriage return
 * `\s` – space
 * `\t` – tab
-* `\v` – vertial tab
+* `\v` – vertical tab
 * `\DDD`, `\DD`, `\D` - character with octal representation DDD, DD or D (example: `\377`)
 * `\xDD`	- character with hexadecimal representation DD (example: `\x13`)
 * `\x{D...}` -	character with hexadecimal representation with one or more hexadecimal digits (example: `\x{abc13}`)
diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index b33c8a058..7555cd99f 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -81,7 +81,7 @@ false
 
 Elixir provides a bunch of predicate functions to check for a value type. For example, the `is_boolean/1` function can be used to check if a value is a boolean or not:
 
-> Note: Functions in Elixir are indentified by name and by number of arguments (i.e. arity). Therefore, `is_boolean/1` identifies a function named `is_boolean` that takes 1 argument. `is_boolean/2` identifies a different (nonexistent) function with the same name but different arity.
+> Note: Functions in Elixir are identified by name and by number of arguments (i.e. arity). Therefore, `is_boolean/1` identifies a function named `is_boolean` that takes 1 argument. `is_boolean/2` identifies a different (nonexistent) function with the same name but different arity.
 
 ```iex
 iex> is_boolean(true)
diff --git a/getting_started/meta/3.markdown b/getting_started/meta/3.markdown
index 8fe81ae00..28463573e 100644
--- a/getting_started/meta/3.markdown
+++ b/getting_started/meta/3.markdown
@@ -69,7 +69,7 @@ defmodule TestCase do
 end
 ```
 
-Asuming we defined `TestCase` in a file named `tests.exs`, we can open it up `iex tests.exs` and define our first tests:
+Assuming we defined `TestCase` in a file named `tests.exs`, we can open it up `iex tests.exs` and define our first tests:
 
 ```iex
 iex> defmodule MyTest do
diff --git a/getting_started/mix/1.markdown b/getting_started/mix/1.markdown
index 0422efc59..1d6a13930 100644
--- a/getting_started/mix/1.markdown
+++ b/getting_started/mix/1.markdown
@@ -157,7 +157,7 @@ end
 
 **Note:** Although not required, it is common to split dependencies into their own function.
 
-The dependency is represented by an atom, followed by a requirement and some options. By default, Mix uses [hex.pm](https://hex.pm) to fetch dependencies but it can also fetch them from a git repository or directly from the filesystem.
+The dependency is represented by an atom, followed by a requirement and some options. By default, Mix uses [hex.pm](https://hex.pm) to fetch dependencies but it can also fetch them from a git repository or directly from the file system.
 
 When using Hex, you must use requirements to specify which versions of a given dependency you accept. It supports common operators like `>=`, `<=`, `>`, `==` as follows:
 
@@ -187,7 +187,7 @@ It will lead to a dependency that will never be satisfied, because the tag being
 Mix is designed in a way it can support multiple SCM tools, Hex packages being the default, while `:git` and `:path` are supported as options. The most common options are:
 
 * `:git` - the dependency is a git repository that is retrieved and updated by Mix;
-* `:path` - the dependency is simply a path in the filesystem;
+* `:path` - the dependency is simply a path in the file system;
 * `:compile` - how to compile the dependency;
 * `:app` - the path of the application expected to be defined by the dependency;
 * `:env` - the environment to use from the dependency (more info below), defaults to `:prod`;
diff --git a/getting_started/mix/2.markdown b/getting_started/mix/2.markdown
index 32924e27e..1a76b905f 100644
--- a/getting_started/mix/2.markdown
+++ b/getting_started/mix/2.markdown
@@ -22,7 +22,7 @@ Our application is going to be a simple stack that allow us push and pop items a
 
 Our application is going to have one stack which may be accessed by many processes at the same time. To achieve that, we will create a server that is responsible to manage the stack. Clients will send messages to the server whenever they want to push or pop something from the stack.
 
-Since creating such servers is a common pattern when building Erlang and Elixir applications, we have a behavior in OTP that encapsulates common server functionalities called **GenServer**. Let's create a file named `lib/stacker/server.ex` with our first server:
+Since creating such servers is a common pattern when building Erlang and Elixir applications, we have a behavior in OTP that encapsulates common server functionality called **GenServer**. Let's create a file named `lib/stacker/server.ex` with our first server:
 
 ```elixir
 defmodule Stacker.Server do
@@ -208,7 +208,7 @@ iex> :gen_server.call(:stacker, :pop)
 
 It crashes exactly as before but it is restarted right away by the supervisor with the default stack, allowing us to retrieve `:hello` again. Excellent!
 
-By default the supervisor allows a worker to restart at maximum 5 times in a 5 seconds timespan. If the worker crashes more frequently than that, the supervisor gives up on the worker and no longer restarts it. Let's check it by sending 5 unknown messages one right after the other (be fast!):
+By default the supervisor allows a worker to restart at maximum 5 times in a 5 seconds time span. If the worker crashes more frequently than that, the supervisor gives up on the worker and no longer restarts it. Let's check it by sending 5 unknown messages one right after the other (be fast!):
 
 ```iex
 iex> :gen_server.call(:stacker, :unknown)
@@ -223,7 +223,7 @@ The sixth message no longer generates an error report, since our server was no l
 
 ## 2.3 Who supervises the supervisor?
 
-We have built our supervisor but a pertinent question is: who supervises the supervisor? To answer this question, OTP contains the concept of applications. Applications can be started and stopped as an unit and, when doing so, they are often linked to a supervisor.
+We have built our supervisor but a pertinent question is: who supervises the supervisor? To answer this question, OTP contains the concept of applications. Applications can be started and stopped as a unit and, when doing so, they are often linked to a supervisor.
 
 In the previous chapter, we have learned how Mix automatically generates an `.app` file every time we compile our project based on the information contained on the `application` function in our `mix.exs` file.
 
@@ -324,4 +324,4 @@ iex> :application.get_env(:stacker, :foo)
 
 For example, IEx and ExUnit are two applications that ship with Elixir that relies on such configuration values, as seen in their `mix.exs` files: [IEx](https://github.com/elixir-lang/elixir/blob/master/lib/iex/mix.exs) and [ExUnit](https://github.com/elixir-lang/elixir/blob/master/lib/ex_unit/mix.exs). Such applications then provide [wrappers for reading and setting such values](https://github.com/elixir-lang/elixir/blob/d2bfd10299dc0e2df573589f1d33565177d63a7d/lib/ex_unit/lib/ex_unit.ex#L125-L155).
 
-With this note, we finalize this chapter. We have learned how to create servers, supervise them, hook them into our application lifecycle and provide simple configuration options. In the next chapter, we will learn how to create custom tasks in Mix.
+With this note, we finalize this chapter. We have learned how to create servers, supervise them, hook them into our application life cycle and provide simple configuration options. In the next chapter, we will learn how to create custom tasks in Mix.

From 67e663d9be40fefd1aee8cd97a6445c8f316e981 Mon Sep 17 00:00:00 2001
From: Alexei Sholik <alcosholik@gmail.com>
Date: Wed, 21 May 2014 04:21:15 +0300
Subject: [PATCH 153/160] =?UTF-8?q?=E2=80=9Ccodepoint=E2=80=9D=20->=20?=
 =?UTF-8?q?=E2=80=9Ccode=20point=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

http://en.wikipedia.org/wiki/Code_point
---
 getting_started/12.markdown |  2 +-
 getting_started/6.markdown  | 18 +++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index bf4f632b8..bb0454d7a 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -153,7 +153,7 @@ The group leader can be configured per process and is used in different situatio
 
 ## 12.5 `iodata` and `chardata`
 
-In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with codepoints.
+In all examples above, we have used binaries/strings when writing to files. In the chapter "Binaries, strings and char lists", we mentioned how strings are simply bytes while char lists are lists with code points.
 
 The functions in `IO` and `File` also allow lists to given as arguments. Not only that, they also allow a mixed list of lists, integers and binaries to be given:
 
diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index 178bc48c5..9fa4c5e2f 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -21,13 +21,13 @@ In this chapter, we will understand what binaries are, how they associate with s
 
 ## 6.1 UTF-8 and Unicode
 
-A string is a UTF-8 encoded binary. In order to understand exactly what we mean by that, we need to understand the difference between bytes and codepoints.
+A string is a UTF-8 encoded binary. In order to understand exactly what we mean by that, we need to understand the difference between bytes and code points.
 
-The Unicode standard assigns codepoints to many of the characters we know. For example, the letter `a` has codepoint `97` while the letter `ł` has codepoint `322`. When writing the string `"hełło"` to disk, we need to convert this codepoint to bytes. If we adopted a rule that said one byte represents one codepoint, we wouldn't be able to write `"hełło"`, because it uses the codepoint `322` for `ł`, and one byte can only represent a number from `0` to `255`. But of course, given you can actually read `"hełło"` on your screen, it must be represented *somehow*. That's where encodings come in.
+The Unicode standard assigns code points to many of the characters we know. For example, the letter `a` has code point `97` while the letter `ł` has code point `322`. When writing the string `"hełło"` to disk, we need to convert this code point to bytes. If we adopted a rule that said one byte represents one code point, we wouldn't be able to write `"hełło"`, because it uses the code point `322` for `ł`, and one byte can only represent a number from `0` to `255`. But of course, given you can actually read `"hełło"` on your screen, it must be represented *somehow*. That's where encodings come in.
 
-When representing codepoints in bytes, we need to encode them somehow. Elixir chose the UTF-8 encoding as its main and default encoding. When we say a string is a UTF-8 encoded binary, we mean a string is a bunch of bytes organized in a way to represent certain codepoints, as specified by the UTF-8 encoding.
+When representing code points in bytes, we need to encode them somehow. Elixir chose the UTF-8 encoding as its main and default encoding. When we say a string is a UTF-8 encoded binary, we mean a string is a bunch of bytes organized in a way to represent certain code points, as specified by the UTF-8 encoding.
 
-Since we have codepoints like `ł` assigned with the number `322`, we actually need more than one byte to represent it. That's why we see a difference when we calculate the `byte_size/1` of a string compared to its `String.length/1`:
+Since we have code points like `ł` assigned with the number `322`, we actually need more than one byte to represent it. That's why we see a difference when we calculate the `byte_size/1` of a string compared to its `String.length/1`:
 
 ```iex
 iex> string = "hełło"
@@ -38,7 +38,7 @@ iex> String.length string
 5
 ```
 
-UTF-8 requires one byte to represent the codepoints `h`, `e` and `o`, but two bytes to represent `ł`. In Elixir, you can get a codepoint's value by using `?`:
+UTF-8 requires one byte to represent the code points `h`, `e` and `o`, but two bytes to represent `ł`. In Elixir, you can get a code point's value by using `?`:
 
 ```iex
 iex> ?a
@@ -47,7 +47,7 @@ iex> ?ł
 322
 ```
 
-You can also use the functions in [the `String` module](/docs/stable/String.html) to split a string in its codepoints:
+You can also use the functions in [the `String` module](/docs/stable/String.html) to split a string in its code points:
 
 ```iex
 iex> String.codepoints("hełło")
@@ -90,7 +90,7 @@ iex> "hełło" <> <<0>>
 <<104, 101, 197, 130, 197, 130, 111, 0>>
 ```
 
-Each number given to a binary is meant to represent a byte and therefore must go up to 255. Binaries allow modifiers to be given to store numbers bigger than 255 or to convert a codepoint to its utf8 representation:
+Each number given to a binary is meant to represent a byte and therefore must go up to 255. Binaries allow modifiers to be given to store numbers bigger than 255 or to convert a code point to its utf8 representation:
 
 ```iex
 iex> <<255>>
@@ -99,7 +99,7 @@ iex> <<256>> # truncated
 <<0>>
 iex> <<256 :: size(16)>> # use 16 bits (2 bytes) to store the number
 <<1, 0>>
-iex> <<256 :: utf8>> # the number is a codepoint
+iex> <<256 :: utf8>> # the number is a code point
 "Ā"
 iex> <<256 :: utf8, 0>>
 <<196, 128, 0>>
@@ -166,7 +166,7 @@ iex> 'hello'
 'hello'
 ```
 
-You can see that, instead of containing bytes, a char list contains the codepoints of the characters in between single-quotes (note that iex will only output codepoints if any of the chars is outside the ASCII range). So while double-quotes represent a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
+You can see that, instead of containing bytes, a char list contains the code points of the characters in between single-quotes (note that iex will only output code points if any of the chars is outside the ASCII range). So while double-quotes represent a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
 
 In practice, char lists are used mostly when interfacing with Erlang, in particular old libraries that do not accept binaries as arguments. You can convert a char list to a string and back by using the `to_string/1` and `to_char_list/1` functions:
 

From d0a98247637c453938aff3aed8e557f99987c766 Mon Sep 17 00:00:00 2001
From: Evan Smith <evans@n2uitive.com>
Date: Wed, 21 May 2014 14:42:06 -0700
Subject: [PATCH 154/160] Clarified Lightweight Concurrency section with some
 commas and word reordering.

---
 index.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/index.html b/index.html
index e9343d85c..892c7a175 100644
--- a/index.html
+++ b/index.html
@@ -166,7 +166,7 @@ <h4>Lightweight concurrency</h4>
 end
 {% endhighlight %}
 
-      <p>Since processes are lightweight and isolated, Elixir it is not uncommon to have dozens of thousands of processes running simultaneously. Proceses are provide the means for building distributed and fault-tolerant applications.</p>
+      <p>Since processes are lightweight and isolated, it is not uncommon to have dozens of thousands of processes running simultaneously with Elixir. Processes provide the means for building distributed and fault-tolerant applications.</p>
     </div>
   </div>
 
@@ -174,7 +174,7 @@ <h4>Lightweight concurrency</h4>
     <h4>Interactive (and remote) shells</h4>
 
     <div class="entry-summary">
-      <p>Elixir also ships with an Interactive Shell, called IEx, which provides a great set of helpers for writing code, like easy access to documentation, code reloading, debugging and so on. It is also a great companion for production, as it allows for example connecting to remote nodes. Here is a quick example you can try locally. In one terminal, do:</p>
+      <p>Elixir also ships with an Interactive Shell, called IEx, which provides a great set of helpers for writing code, like easy access to documentation, code reloading, debugging and so on. It is also a great companion for production, as it allows, for example, connecting to remote nodes. Here is a quick example you can try locally. In one terminal, do:</p>
 
 {% highlight text %}
 $ iex --name hello

From 3f5344a7f1f4cff83db161f6363f8aa3ee5dc294 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sun, 25 May 2014 12:36:38 +0200
Subject: [PATCH 155/160] Update docs links

---
 ...2013-04-29-elixir-v0-8-2-released.markdown |  2 +-
 ...013-07-13-elixir-v0-10-0-released.markdown |  8 +++----
 .../2013-08-08-elixir-design-goals.markdown   |  4 ++--
 ...013-11-05-elixir-v0-11-0-released.markdown |  6 +++---
 ...014-04-21-elixir-v0-13-0-released.markdown | 12 +++++------
 docs.html                                     | 21 ++++++++++++++++---
 getting_started/ex_unit/1.markdown            |  6 +++---
 getting_started/meta/2.markdown               |  4 ++--
 getting_started/mix/2.markdown                |  6 +++---
 getting_started/mix/3.markdown                |  4 ++--
 10 files changed, 44 insertions(+), 29 deletions(-)

diff --git a/_posts/2013-04-29-elixir-v0-8-2-released.markdown b/_posts/2013-04-29-elixir-v0-8-2-released.markdown
index b49e341b1..762f7004a 100644
--- a/_posts/2013-04-29-elixir-v0-8-2-released.markdown
+++ b/_posts/2013-04-29-elixir-v0-8-2-released.markdown
@@ -44,6 +44,6 @@ defmodule MathTest do
 end
 ```
 
-You can learn more about [doctests on our documentation page](http://elixir-lang.org/docs/stable/ExUnit.DocTest.html) and get more information about our latest release [on the CHANGELOG](https://github.com/elixir-lang/elixir/blob/ed27611f48ba150404c95fe15f1d6058a4287330/CHANGELOG.md).
+You can learn more about [doctests on our documentation page](http://elixir-lang.org/docs/stable/ex_unit/ExUnit.DocTest.html) and get more information about our latest release [on the CHANGELOG](https://github.com/elixir-lang/elixir/blob/ed27611f48ba150404c95fe15f1d6058a4287330/CHANGELOG.md).
 
 If you are new to Elixir, [it's easy to get started with](/getting_started/1.html)!
diff --git a/_posts/2013-07-13-elixir-v0-10-0-released.markdown b/_posts/2013-07-13-elixir-v0-10-0-released.markdown
index 5271e640f..14716c4a1 100644
--- a/_posts/2013-07-13-elixir-v0-10-0-released.markdown
+++ b/_posts/2013-07-13-elixir-v0-10-0-released.markdown
@@ -54,11 +54,11 @@ Stream.repeatedly(fn -> :random.uniform end) |> Enum.take(3)
 #=> [0.4435846174457203, 0.7230402056221108, 0.94581636451987]
 ```
 
-`Stream.repeatedly/1` returns an infinite stream but that's ok we just need its first three elements. You can learn more about [stream and related functions in `Stream` module documentation](http://elixir-lang.org/docs/stable/Stream.html).
+`Stream.repeatedly/1` returns an infinite stream but that's ok we just need its first three elements. You can learn more about [stream and related functions in `Stream` module documentation](http://elixir-lang.org/docs/stable/elixir/Stream.html).
 
 ## Sets
 
-This release also adds [the Sets API](http://elixir-lang.org/docs/stable/Set.html) to Elixir and a HashSet implementation. The HashSet implementation follows [the same design goals as the HashDict implementation](http://elixir-lang.org/blog/2013/01/27/elixir-v0-8-0-released/) released at the beginning of this year, starting with a compact representation and expanding and contracting as needed.
+This release also adds [the Sets API](http://elixir-lang.org/docs/stable/elixir/Set.html) to Elixir and a HashSet implementation. The HashSet implementation follows [the same design goals as the HashDict implementation](http://elixir-lang.org/blog/2013/01/27/elixir-v0-8-0-released/) released at the beginning of this year, starting with a compact representation and expanding and contracting as needed.
 
 This feature was a contribution from [Joseph Wilk](https://github.com/josephwilk) and he talks about its implementation and provides some benchmarks [on his blog](http://blog.josephwilk.net/elixir/sets-in-elixir.html).
 
@@ -66,7 +66,7 @@ This feature was a contribution from [Joseph Wilk](https://github.com/josephwilk
 
 Another addition to this release is pretty printing. The pretty printing started as an implementation of the [Wadler paper](http://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf) by [Jonns Mostovoys](https://github.com/manpages) which was then improved by [Gustavo Brunoro](https://github.com/brunoro) under his Google Summer of Code project as described in [Lindig's _Strictly Prettier_ paper](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.2200).
 
-As soon as you upgrade to Elixir v0.10.0 and start IEx, you will get pretty printing for all data structures provided by Elixir. We have also added documentation to the `Inspect` module about [adding pretty printing to your own structures](http://elixir-lang.org/docs/stable/Inspect.html) as well as [using the document algebra for any other kind of formatting](http://elixir-lang.org/docs/stable/Inspect.Algebra.html).
+As soon as you upgrade to Elixir v0.10.0 and start IEx, you will get pretty printing for all data structures provided by Elixir. We have also added documentation to the `Inspect` module about [adding pretty printing to your own structures](http://elixir-lang.org/docs/stable/elixir/Inspect.html) as well as [using the document algebra for any other kind of formatting](http://elixir-lang.org/docs/stable/elixir/Inspect.Algebra.html).
 
 ## Other improvements
 
@@ -78,7 +78,7 @@ Other notable improvements are:
 
 * We are also working hard on Windows support, improving its command-line tools and working towards a green test suite, thanks to [Tom Jansens](https://github.com/tojans);
 
-* Meta-programming in Elixir was also improved by the addition of the `binding/0` and `binding/1` macros plus the additions of `Macro.expand_once/2` and `Macro.expand_all/2` to the [`Macro` module](http://elixir-lang.org/docs/stable/Macro.html);
+* Meta-programming in Elixir was also improved by the addition of the `binding/0` and `binding/1` macros plus the additions of `Macro.expand_once/2` and `Macro.expand_all/2` to the [`Macro` module](http://elixir-lang.org/docs/stable/elixir/Macro.html);
 
 There are also improvements to typespecs, error messages, many bug fixes and some backwards incompatible changes. We have posted a detailed [upgrade instructions on the mailing list](https://groups.google.com/forum/?fromgroups#!topic/elixir-lang-talk/ksrefrgK1eY). For a general overview, [check out the CHANGELOG](https://github.com/elixir-lang/elixir/blob/v0.10.0/CHANGELOG.md).
 
diff --git a/_posts/2013-08-08-elixir-design-goals.markdown b/_posts/2013-08-08-elixir-design-goals.markdown
index f62442ac8..55e86d5e9 100644
--- a/_posts/2013-08-08-elixir-design-goals.markdown
+++ b/_posts/2013-08-08-elixir-design-goals.markdown
@@ -202,9 +202,9 @@ Enum.map set, fn(x) -> x * 2 end
 #=> [2,4,6]
 ```
 
-Not only that, any developer can **extend** the `Enum` module to work with any data type as long as the data type implements [the `Enumerable` protocol](http://elixir-lang.org/docs/stable/Enumerable.html) (protocols in Elixir are based on Clojure's protocol). This is extremely convenient because the developer needs to know only the `Enum` API for enumeration, instead of memorizing specific APIs for sets, lists, dicts, etc.
+Not only that, any developer can **extend** the `Enum` module to work with any data type as long as the data type implements [the `Enumerable` protocol](http://elixir-lang.org/docs/stable/elixir/Enumerable.html) (protocols in Elixir are based on Clojure's protocol). This is extremely convenient because the developer needs to know only the `Enum` API for enumeration, instead of memorizing specific APIs for sets, lists, dicts, etc.
 
-There are many other protocols exposed by the language, like [the `Inspect` protocol](http://elixir-lang.org/docs/stable/Inspect.html) for pretty printing data structures and [the `Access` protocol](http://elixir-lang.org/docs/stable/Access.html) for accessing key-value data by key. By being extensible, Elixir ensures developers can work **with** the language, instead of **against** the language.
+There are many other protocols exposed by the language, like [the `Inspect` protocol](http://elixir-lang.org/docs/stable/elixir/Inspect.html) for pretty printing data structures and [the `Access` protocol](http://elixir-lang.org/docs/stable/elixir/Access.html) for accessing key-value data by key. By being extensible, Elixir ensures developers can work **with** the language, instead of **against** the language.
 
 ## Summing up
 
diff --git a/_posts/2013-11-05-elixir-v0-11-0-released.markdown b/_posts/2013-11-05-elixir-v0-11-0-released.markdown
index 93b787ee9..f162e8f6d 100644
--- a/_posts/2013-11-05-elixir-v0-11-0-released.markdown
+++ b/_posts/2013-11-05-elixir-v0-11-0-released.markdown
@@ -22,7 +22,7 @@ In this new release, IEx also supports a very simple debugging mechanism called
 
 ![IEx pry example](/images/contents/iex-pry.png)
 
-In Elixir, your code runs in many processes that talk to each other and the Elixir shell is no different. `IEx.pry` allows another process to take over the shell, allowing the developer to inspect the binding and halt the execution of the process being "pried" (i.e. the one that invoked `IEx.pry`). We called this feature `pry` as a gentle reminder that you can only inspect existing information, you cannot change the binding over a pried process. For more information, check the docs for [`IEx.pry/1`](http://elixir-lang.org/docs/stable/IEx.html#pry/1).
+In Elixir, your code runs in many processes that talk to each other and the Elixir shell is no different. `IEx.pry` allows another process to take over the shell, allowing the developer to inspect the binding and halt the execution of the process being "pried" (i.e. the one that invoked `IEx.pry`). We called this feature `pry` as a gentle reminder that you can only inspect existing information, you cannot change the binding over a pried process. For more information, check the docs for [`IEx.pry/1`](http://elixir-lang.org/docs/stable/iex/IEx.html#pry/1).
 
 ## ExUnit
 
@@ -59,9 +59,9 @@ fun.(1..3)
 #=> true
 ```
 
-You can learn more about the [new capture operator in our docs](http://elixir-lang.org/docs/stable/Kernel.SpecialForms.html#&/1).
+You can learn more about the [new capture operator in our docs](http://elixir-lang.org/docs/stable/elixir/Kernel.SpecialForms.html#&/1).
 
-We have also pushed improvements to [the String module](http://elixir-lang.org/docs/stable/String.html), including new APIs. In particular, in order to know that `String.length("josé")` has length 4 (even though it takes 5 bytes to be represented in UTF-8), we need to use some algorithms defined by the Unicode Standard. These have been implemented as specified in the [extended grapheme cluster algorithm, defined in the version 6.3.0 of the Unicode Standard](http://www.unicode.org/reports/tr29/).
+We have also pushed improvements to [the String module](http://elixir-lang.org/docs/stable/elixir/String.html), including new APIs. In particular, in order to know that `String.length("josé")` has length 4 (even though it takes 5 bytes to be represented in UTF-8), we need to use some algorithms defined by the Unicode Standard. These have been implemented as specified in the [extended grapheme cluster algorithm, defined in the version 6.3.0 of the Unicode Standard](http://www.unicode.org/reports/tr29/).
 
 In the optimization front, we have pushed the first iteration of a [feature called Protocol consolidation](https://groups.google.com/forum/#!topic/elixir-lang-core/RoXAUtoyjk4), which speeds up the polymorphic dispatch done by protocols, sometimes reducing the dispatching time to 10% of the original time. We will continue working in upcoming releases to integrate protocol consolidation as a regular part of the developer workflow.
 
diff --git a/_posts/2014-04-21-elixir-v0-13-0-released.markdown b/_posts/2014-04-21-elixir-v0-13-0-released.markdown
index bf6e179a2..625ce2343 100644
--- a/_posts/2014-04-21-elixir-v0-13-0-released.markdown
+++ b/_posts/2014-04-21-elixir-v0-13-0-released.markdown
@@ -30,11 +30,11 @@ In a nutshell, here is what new:
 
 * The [Getting Started guide](http://elixir-lang.org/getting_started/1.html) was rewritten from scratch. The previous guide was comprised of 7 chapters and was about to become 2 years old. The new guide features 20 chapters, it explores the new maps and structs (which are part of this release), and it goes deeper into topics like IO and File handling. It also includes an extra guide, still in development, about [Meta-Programming in Elixir](http://elixir-lang.org/getting_started/meta/1.html);
 
-* Elixir v0.13 provides a new comprehension syntax that not only works with lists, but with any [`Enumerable`](/docs/stable/Enumerable.html). The output of a comprehension is also extensible via the [`Collectable`](/docs/stable/Collectable.html) protocol;
+* Elixir v0.13 provides a new comprehension syntax that not only works with lists, but with any [`Enumerable`](/docs/stable/elixir/Enumerable.html). The output of a comprehension is also extensible via the [`Collectable`](/docs/stable/elixir/Collectable.html) protocol;
 
 * Mix, Elixir's build tool, has been improved in order to provide better workflows when compiling projects and working with dependencies;
 
-* There are many other changes, like the addition of [StringIO](/docs/stable/StringIO.html), support for [tags and filters in ExUnit](/docs/stable/ExUnit.Case.html) and more. Please check the [CHANGELOG](https://github.com/elixir-lang/elixir/blob/v0.13.0/CHANGELOG.md) for the complete list.
+* There are many other changes, like the addition of [StringIO](/docs/stable/elixir/StringIO.html), support for [tags and filters in ExUnit](/docs/stable/ex_unit/ExUnit.Case.html) and more. Please check the [CHANGELOG](https://github.com/elixir-lang/elixir/blob/v0.13.0/CHANGELOG.md) for the complete list.
 
 Even with all those improvements, Elixir v0.13.0 is backwards compatible with Elixir v0.12.5 and upgrading should be a clean process. 
 
@@ -68,7 +68,7 @@ iex> %{"other" => value} = map
 
 A map pattern will match any map that has all the keys specified in the pattern. The values for the matching keys must also match. For example, `%{"hello" => world}` will match any map that has the key `"hello"` and assign the value to `world`, while `%{"hello" => "world"}` will match any map that has the key `"hello"` with value equals to `"world"`. An empty map pattern (`%{}`) will match all maps.
 
-Developers can use the functions in the [`Map` module](/docs/stable/Map.html) to work with maps. For more information on maps and how they compare to other associative data structures in the language, please check the [Maps chapter in our new Getting Started guide](/getting_started/7.html). Elixir Sips has also released two episodes that cover maps ([part 1](http://elixirsips.com/episodes/054_maps_part_1.html) and [part 2](http://elixirsips.com/episodes/055_maps_part_2.html)).
+Developers can use the functions in the [`Map` module](/docs/stable/elixir/Map.html) to work with maps. For more information on maps and how they compare to other associative data structures in the language, please check the [Maps chapter in our new Getting Started guide](/getting_started/7.html). Elixir Sips has also released two episodes that cover maps ([part 1](http://elixirsips.com/episodes/054_maps_part_1.html) and [part 2](http://elixirsips.com/episodes/055_maps_part_2.html)).
 
 Maps also provide special syntax for creating, accessing and updating maps with atom keys:
 
@@ -185,7 +185,7 @@ For more information on structs, check out the [Structs chapter in the getting s
 
 With the introduction of maps and structs, some deprecations will arrive on upcoming releases. First of all, the `ListDict` data structure is being deprecated and phased out. Records are also being deprecated from the language, although it is going to be a longer process, as many projects and Elixir itself still use records in diverse occasions.
 
-Note though only Elixir records are being deprecated. Erlang records, which are basically syntax sugar around tuples, will remain in the language for the rare cases Elixir developers need to interact with Erlang libraries that provide records. In particular, the [Record](/docs/stable/Record.html) has been updated to provide the new Record API (while keeping the old one for backwards compatibility).
+Note though only Elixir records are being deprecated. Erlang records, which are basically syntax sugar around tuples, will remain in the language for the rare cases Elixir developers need to interact with Erlang libraries that provide records. In particular, the [Record](/docs/stable/elixir/Record.html) has been updated to provide the new Record API (while keeping the old one for backwards compatibility).
 
 Finally, structs are still in active development and new features, like `@derive`, should land in upcoming Elixir releases. For those interested, the [original maps and structs proposal is still availble](https://gist.github.com/josevalim/b30c881df36801611d13).
 
@@ -222,7 +222,7 @@ iex> for <<c <- " hello world ">>, c != ?\s, into: "", do: <<c>>
 "helloworld"
 ```
 
-Sets, maps and other dictionaries can also be given with the `:into` option. In general, the `:into` accepts any structure as long as it implements the [`Collectable` protocol](/docs/stable/Collectable.html).
+Sets, maps and other dictionaries can also be given with the `:into` option. In general, the `:into` accepts any structure as long as it implements the [`Collectable` protocol](/docs/stable/elixir/Collectable.html).
 
 For example, the `IO` module provides streams, that are both `Enumerable` and `Collectable`. You can implement an echo terminal that returns whatever is typed into the shell, but in upcase, using comprehensions:
 
@@ -275,7 +275,7 @@ That said, in the next months we plan to:
 
 * Integrate applications configuration (provided by OTP) right into Mix;
 * Provide an Elixir logger that knows how to print and format Elixir exceptions and stacktraces;
-* Properly expose the functionality provided by Applications, Supervisors, GenServers and GenEvents and study how they can integrate with Elixir. For example, how to consume events from GenEvent as a [stream of data](/docs/stable/Stream.html)?
+* Properly expose the functionality provided by Applications, Supervisors, GenServers and GenEvents and study how they can integrate with Elixir. For example, how to consume events from GenEvent as a [stream of data](/docs/stable/elixir/Stream.html)?
 * Study how patterns like tasks and agents can be integrated into the language, often picking up the lessons learned by libraries like [e2](http://e2project.org/erlang.html) and [functionality exposed by OTP itself](http://erlang.org/doc/man/rpc.html);
 * Rewrite the Mix and ExUnit guides to focus on applications and OTP as a whole, rebranding it to "Building Apps with Mix and OTP";
 
diff --git a/docs.html b/docs.html
index 73716c250..94b09fcde 100644
--- a/docs.html
+++ b/docs.html
@@ -11,11 +11,26 @@ <h2 class="entry-title">Documentation</h2>
     </div>
 
     <div class="entry-summary">
-      <p>Choose which version do you want documentation for:</p>
+      <p>Choose which version do you want documentation for.</p>
+
+      <h4>Latest stable release</h4>
       <ul>
-        <li><a href="/docs/stable/">Latest stable release</a></li>
-        <li><a href="/docs/master/">Master</a></li>
+        <li><a href="/docs/stable/elixir">Elixir</a></li>
+        <li><a href="/docs/stable/eex">EEx</a></li>
+        <li><a href="/docs/stable/ex_unit">ExUnit</a></li>
+        <li><a href="/docs/stable/iex">IEx</a></li>
+        <li><a href="/docs/stable/mix">Mix</a></li>
       </ul>
+
+      <h4>Master</h4>
+      <ul>
+        <li><a href="/docs/master/elixir">Elixir</a></li>
+        <li><a href="/docs/master/eex">EEx</a></li>
+        <li><a href="/docs/master/ex_unit">ExUnit</a></li>
+        <li><a href="/docs/master/iex">IEx</a></li>
+        <li><a href="/docs/master/mix">Mix</a></li>
+      </ul>
+
     </div>
   </div>
 </div>
diff --git a/getting_started/ex_unit/1.markdown b/getting_started/ex_unit/1.markdown
index e887c19ef..32c2459a4 100644
--- a/getting_started/ex_unit/1.markdown
+++ b/getting_started/ex_unit/1.markdown
@@ -37,7 +37,7 @@ In this chapter, we will discuss the most common features available in ExUnit an
 
 ## 1.1 Starting ExUnit
 
-ExUnit is usually started via `ExUnit.start`. This function accepts a couple options, so [check its documentation](/docs/stable/ExUnit.html) for more details. For now, we will just detail the most common ones:
+ExUnit is usually started via `ExUnit.start`. This function accepts a couple options, so [check its documentation](/docs/stable/ex_unit/ExUnit.html) for more details. For now, we will just detail the most common ones:
 
 * `:formatter` - When you run tests with ExUnit, all the IO is done by [the formatter](https://github.com/elixir-lang/elixir/blob/master/lib/ex_unit/lib/ex_unit/formatter.ex). Developers can define their own formatters and this is the configuration that tells ExUnit to use a custom formatter;
 
@@ -75,7 +75,7 @@ This construct is considered more readable. The `test` macro accepts either a bi
 
 ### 1.2.2 Assertions
 
-Another convenience provided by `ExUnit.Case` is to automatically import a set of assertion macros and functions, available in [`ExUnit.Assertions`](/docs/stable/ExUnit.Assertions.html).
+Another convenience provided by `ExUnit.Case` is to automatically import a set of assertion macros and functions, available in [`ExUnit.Assertions`](/docs/stable/ex_unit/ExUnit.Assertions.html).
 
 In the majority of tests, the only assertion macros you will need to use are `assert` and `refute`:
 
@@ -102,7 +102,7 @@ assert_raise ArithmeticError, "bad argument in arithmetic expression", fn ->
 end
 ```
 
-So don't forget to check [`ExUnit.Assertions`' documentation](/docs/stable/ExUnit.Assertions.html) for more examples.
+So don't forget to check [`ExUnit.Assertions`' documentation](/docs/stable/ex_unit/ExUnit.Assertions.html) for more examples.
 
 ### 1.2.3 Callbacks
 
diff --git a/getting_started/meta/2.markdown b/getting_started/meta/2.markdown
index 9dc21e70d..95a55591a 100644
--- a/getting_started/meta/2.markdown
+++ b/getting_started/meta/2.markdown
@@ -95,7 +95,7 @@ end
 
 Not only `unless/2`, `defmacro/2`, `def/2`, `defprotocol/2` and many constructs used throughout this getting started guide are implemented in pure Elixir, often as a macros. This means that the constructs being used to build the language, can be used by developers to extend the language to the domains they are working on.
 
-We can define any function and macro we want, including ones that override the built-in definitions provided by Elixir. The only exceptions are Elixir special forms which are not implemented in Elixir and therefore cannot be overridden, [the full list of special forms is available in `Kernel.SpecialForms`](/docs/stable/Kernel.SpecialForms.html).
+We can define any function and macro we want, including ones that override the built-in definitions provided by Elixir. The only exceptions are Elixir special forms which are not implemented in Elixir and therefore cannot be overridden, [the full list of special forms is available in `Kernel.SpecialForms`](/docs/stable/elixir/Kernel.SpecialForms.html).
 
 ## 2.2 Macros hygiene
 
@@ -184,7 +184,7 @@ iex> __ENV__.requires
 [IEx.Helpers, Integer, Kernel, Kernel.Typespec]
 ```
 
-Many of the functions in the `Macro` module expect an environment. You can read more about them in [the docs for the `Macro` module](/docs/stable/Macro.html) and learn more about the compilation environment with [`Macro.Env`](/docs/stable/Macro.Env.html).
+Many of the functions in the `Macro` module expect an environment. You can read more about them in [the docs for the `Macro` module](/docs/stable/elixir/Macro.html) and learn more about the compilation environment with [`Macro.Env`](/docs/stable/elixir/Macro.Env.html).
 
 ## 2.4 Private macros
 
diff --git a/getting_started/mix/2.markdown b/getting_started/mix/2.markdown
index 1a76b905f..2f889b37e 100644
--- a/getting_started/mix/2.markdown
+++ b/getting_started/mix/2.markdown
@@ -123,7 +123,7 @@ iex> :gen_server.call(pid, :pop)
 
 You can see there are two error reports. The first one is generated by server, due to the crash. Since the server is linked to our process, it also sent an exit message which was printed by `IEx` as `** (exit) ...`.
 
-Since our servers may eventually crash, it is common to supervise them, and that's what we are going to next. There is a bit more to `GenServer` than what we have seen here. For more information, check [`GenServer.Behaviour`'s documentation](/docs/stable/GenServer.Behaviour.html).
+Since our servers may eventually crash, it is common to supervise them, and that's what we are going to next. There is a bit more to `GenServer` than what we have seen here. For more information, check [`GenServer.Behaviour`'s documentation](/docs/stable/elixir/GenServer.html).
 
 ## 2.2 Supervising our servers
 
@@ -219,7 +219,7 @@ iex> :gen_server.call(:stacker, :unknown)
     gen_server.erl:180: :gen_server.call/2
 ```
 
-The sixth message no longer generates an error report, since our server was no longer started automatically. Elixir returns `:noproc` (which stands for no process), meaning there isn't a process named `:stacker`. The number of restarts allowed and its time interval can be customized by passing options to the `supervise` function. Different restart strategies, besides the `:one_for_one` used above, can be chosen for the supervisor as well. For more information on the supported options, [check the documentation for `Supervisor.Behaviour`](/docs/stable/Supervisor.Behaviour.html).
+The sixth message no longer generates an error report, since our server was no longer started automatically. Elixir returns `:noproc` (which stands for no process), meaning there isn't a process named `:stacker`. The number of restarts allowed and its time interval can be customized by passing options to the `supervise` function. Different restart strategies, besides the `:one_for_one` used above, can be chosen for the supervisor as well. For more information on the supported options, [check the documentation for `Supervisor.Behaviour`](/docs/stable/elixir/Supervisor.html).
 
 ## 2.3 Who supervises the supervisor?
 
@@ -261,7 +261,7 @@ iex> :gen_server.call(:stacker, :pop)
 :hello
 ```
 
-Amazing, it works! As you may have noticed, the application `start/2` callback receives a type argument, which we have ignored. The type controls how the VM should behave when the supervisor, and consequently our application, crashes. You can learn more about it by [reading the documentation for `Application.Behaviour`](/docs/stable/Application.Behaviour.html).
+Amazing, it works! As you may have noticed, the application `start/2` callback receives a type argument, which we have ignored. The type controls how the VM should behave when the supervisor, and consequently our application, crashes. You can learn more about it by [reading the documentation for `Application.Behaviour`](/docs/stable/elixir/Application.html).
 
 Finally, notice that `mix new` supports a `--sup` option, which tells Mix to generate a supervisor with an application module callback, automating some of the work we have done here. Try it!
 
diff --git a/getting_started/mix/3.markdown b/getting_started/mix/3.markdown
index bc1e51e17..2496862d4 100644
--- a/getting_started/mix/3.markdown
+++ b/getting_started/mix/3.markdown
@@ -54,7 +54,7 @@ When writing tasks, there are some common mix functionality we would like to acc
 
 * `Mix.Task.run(task, args)` - This is how you invoke a task from another task in Mix; Notice that if the task was already invoked, it works as no-op;
 
-There is more to the Mix API, so feel free to [check the documentation](/docs/stable/Mix.html), with special attention to [`Mix.Task`](/docs/stable/Mix.Task.html) and [`Mix.Project`](/docs/stable/Mix.Project.html).
+There is more to the Mix API, so feel free to [check the documentation](/docs/stable/mix/Mix.html), with special attention to [`Mix.Task`](/docs/stable/mix/Mix.Task.html) and [`Mix.Project`](/docs/stable/mix/Mix.Project.html).
 
 ## 3.2 Namespaced Tasks
 
@@ -95,7 +95,7 @@ OptionParser.parse(["--source", "lib", "test/enum_test.exs", "--verbose"])
 #=> { [source: "lib", verbose: true], ["test/enum_test.exs"] }
 ```
 
-Check [`OptionParser`](/docs/stable/OptionParser.html) documentation for more information.
+Check [`OptionParser`](/docs/stable/elixir/OptionParser.html) documentation for more information.
 
 ## 3.4 Sharing tasks
 

From 6cd652d3c342f926da486ec3e8588d8c9eb271c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sun, 25 May 2014 12:40:55 +0200
Subject: [PATCH 156/160] Update more links

---
 getting_started/10.markdown     | 10 +++++-----
 getting_started/11.markdown     |  2 +-
 getting_started/12.markdown     | 10 +++++-----
 getting_started/14.markdown     |  4 ++--
 getting_started/19.markdown     |  2 +-
 getting_started/2.markdown      |  2 +-
 getting_started/5.markdown      |  2 +-
 getting_started/6.markdown      |  2 +-
 getting_started/7.markdown      |  8 ++++----
 getting_started/8.markdown      |  4 ++--
 getting_started/9.markdown      |  2 +-
 getting_started/meta/1.markdown |  2 +-
 getting_started/meta/3.markdown |  2 +-
 13 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/getting_started/10.markdown b/getting_started/10.markdown
index 6f05eb4cc..805d3a44b 100644
--- a/getting_started/10.markdown
+++ b/getting_started/10.markdown
@@ -11,7 +11,7 @@ guide: 10
 
 ## 10.1 Enumerables
 
-Elixir provides the concept of enumerables and [the `Enum` module](/docs/stable/Enum.html) to work with them. We have already learned two enumerables: lists and maps.
+Elixir provides the concept of enumerables and [the `Enum` module](/docs/stable/elixir/Enum.html) to work with them. We have already learned two enumerables: lists and maps.
 
 ```iex
 iex> Enum.map([1, 2, 3], fn x -> x * 2 end)
@@ -31,9 +31,9 @@ iex> Enum.reduce(1..3, 0, &+/2)
 6
 ```
 
-Since the Enum module was designed to work across different data types, its API is limited to functions that are useful across many data types. For specific operations, you may need to reach to modules specific to the data types. For example, if you want to insert an element at a given position in a list, you should use the `List.insert_at/3` function from [the `List` module](/docs/stable/List.html), as it would make little sense to insert a value into, for example, a range.
+Since the Enum module was designed to work across different data types, its API is limited to functions that are useful across many data types. For specific operations, you may need to reach to modules specific to the data types. For example, if you want to insert an element at a given position in a list, you should use the `List.insert_at/3` function from [the `List` module](/docs/stable/elixir/List.html), as it would make little sense to insert a value into, for example, a range.
 
-We say the functions in the `Enum` module are polymorphic because they can work with diverse data types. In particular, the functions in the `Enum` module can work with any data type that implements [the `Enumerable` protocol](/docs/stable/Enumerable.html). We are going to discuss Protocols in a later chapter, for now we are going to move on to a specific kind of enumerable called streams.
+We say the functions in the `Enum` module are polymorphic because they can work with diverse data types. In particular, the functions in the `Enum` module can work with any data type that implements [the `Enumerable` protocol](/docs/stable/elixir/Enumerable.html). We are going to discuss Protocols in a later chapter, for now we are going to move on to a specific kind of enumerable called streams.
 
 ## 10.2 Eager vs Lazy
 
@@ -55,7 +55,7 @@ iex> 1..100_000 |> Enum.map(&(&1 * 3)) |> Enum.filter(odd?) |> Enum.sum
 
 The example above has a pipeline of operations. We start with a range and then multiply each element in the range by 3. This first operation will now create and return a list with `100_000` items. Then we keep all odd elements from the list, generating a new list, now with `50_000` items, and then we sum all entries.
 
-As an alternative, Elixir provides [the `Stream` module](/docs/stable/Stream.html) which supports lazy operations:
+As an alternative, Elixir provides [the `Stream` module](/docs/stable/elixir/Stream.html) which supports lazy operations:
 
 ```iex
 iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(odd?) |> Enum.sum
@@ -110,6 +110,6 @@ iex> Enum.take(stream, 10)
 
 The example above will fetch the first 10 lines of the file you have selected. This means streams can be very useful for handling large files or even slow resources like network resources.
 
-The amount of functions and functionality in [`Enum`](/docs/stable/Enum.html) and [`Stream`](/docs/stable/Stream.html) modules can be daunting at first but you will get familiar with them case by case. In particular, focus on the `Enum` module first and only move to `Stream` for the particular scenarios where laziness is required to either deal with slow resources or large, possibly infinite, collections.
+The amount of functions and functionality in [`Enum`](/docs/stable/elixir/Enum.html) and [`Stream`](/docs/stable/elixir/Stream.html) modules can be daunting at first but you will get familiar with them case by case. In particular, focus on the `Enum` module first and only move to `Stream` for the particular scenarios where laziness is required to either deal with slow resources or large, possibly infinite, collections.
 
 Next we'll look at a feature central to Elixir, Processes, which allows us to write concurrent, parallel and distributed programs in an easy and understandable way.
diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index 6cffd73e1..36d5f3bdb 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -129,7 +129,7 @@ receive do
 end
 ```
 
-This time the process failed and brought the parent process down as they are linked. Linking can also be done manually by calling `Process.link/2`. We recommend you to take a look at [the `Process` module](/docs/stable/Process.html) for other functionality provided by processes.
+This time the process failed and brought the parent process down as they are linked. Linking can also be done manually by calling `Process.link/2`. We recommend you to take a look at [the `Process` module](/docs/stable/elixir/Process.html) for other functionality provided by processes.
 
 Process and links play an important role when building fault-tolerant systems. In Elixir applications we often link our processes to supervisors which will detect when a process die and start a new process in its place. This is only possible because processes don't share anything by default so there is no way the crash of a process can corrupt the state of another process!
 
diff --git a/getting_started/12.markdown b/getting_started/12.markdown
index 97313caf1..cd18fdd28 100644
--- a/getting_started/12.markdown
+++ b/getting_started/12.markdown
@@ -8,7 +8,7 @@ guide: 12
 
   <div class="toc"></div>
 
-This chapter is a quick introduction to input/output mechanisms in Elixir and related modules, like [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html) and [`Path`](/docs/stable/Path.html).
+This chapter is a quick introduction to input/output mechanisms in Elixir and related modules, like [`IO`](/docs/stable/elixir/IO.html), [`File`](/docs/stable/elixir/File.html) and [`Path`](/docs/stable/elixir/Path.html).
 
 We had originally sketched this chapter to come much earlier in the getting started guide. However, we noticed the IO system provides a great opportunity to shed some light on some philosophies and curiosities of Elixir and the VM.
 
@@ -35,7 +35,7 @@ iex> IO.puts :stderr, "hello world"
 
 ## 12.2 The File module
 
-The [`File`](/docs/stable/File.html) module contains functions that allows us to open files as IO devices. By default, files are opened in binary mode, which requires developers to use the specific `IO.binread/2` and `IO.binwrite/2` functions from the `IO` module:
+The [`File`](/docs/stable/elixir/File.html) module contains functions that allows us to open files as IO devices. By default, files are opened in binary mode, which requires developers to use the specific `IO.binread/2` and `IO.binwrite/2` functions from the `IO` module:
 
 ```iex
 iex> {:ok, file} = File.open "hello", [:write]
@@ -93,7 +93,7 @@ File.read!(file)
 
 ## 12.3 The Path module
 
-The majority of the functions in the File module expects paths as arguments. Most commonly, those paths will be binaries and they can be manipulated with the [`Path`](/docs/stable/Path.html) module:
+The majority of the functions in the File module expects paths as arguments. Most commonly, those paths will be binaries and they can be manipulated with the [`Path`](/docs/stable/elixir/Path.html) module:
 
 ```iex
 iex> Path.join("foo", "bar")
@@ -127,7 +127,7 @@ iex> IO.write(pid, "hello")
 
 After `IO.write/2`, we can see the request sent by the IO module printed, which then fails since the IO module expected some kind of result, which we did not supply.
 
-The [`StringIO`](/docs/stable/StringIO.html) module provides an implementation of the IO device messages on top of a string:
+The [`StringIO`](/docs/stable/elixir/StringIO.html) module provides an implementation of the IO device messages on top of a string:
 
 ```iex
 iex> {:ok, pid} = StringIO.open("hello")
@@ -172,4 +172,4 @@ On the other hand, `:stdio` and files opened with `:utf8` encoding work with the
 
 Although this is a subtle difference, you only need to worry about those details if you intend to pass lists to those functions. Binaries are already represented by the underlying bytes and as such their representation is always raw.
 
-This finishes our tour on IO devices and IO related functionality. We have learned about four Elixir modules, [`IO`](/docs/stable/IO.html), [`File`](/docs/stable/File.html), [`Path`](/docs/stable/Path.html) and [`StringIO`](/docs/stable/StringIO.html), as well as how the VM uses processes for the underlying IO mechanisms and how to use (char and io) data for IO operations.
+This finishes our tour on IO devices and IO related functionality. We have learned about four Elixir modules, [`IO`](/docs/stable/elixir/IO.html), [`File`](/docs/stable/elixir/File.html), [`Path`](/docs/stable/elixir/Path.html) and [`StringIO`](/docs/stable/elixir/StringIO.html), as well as how the VM uses processes for the underlying IO mechanisms and how to use (char and io) data for IO operations.
diff --git a/getting_started/14.markdown b/getting_started/14.markdown
index ff9658982..7095682a7 100644
--- a/getting_started/14.markdown
+++ b/getting_started/14.markdown
@@ -78,7 +78,7 @@ end
 
 We also provide a tool called [ExDoc](https://github.com/elixir-lang/ex_doc) which is used to generate HTML pages from the documentation.
 
-You can take a look at the docs for [Module](/docs/stable/Module.html) for a complete list of supported attributes. Elixir also uses attributes to define [typespecs](/docs/stable/Kernel.Typespec.html), via:
+You can take a look at the docs for [Module](/docs/stable/elixir/Module.html) for a complete list of supported attributes. Elixir also uses attributes to define [typespecs](/docs/stable/elixir/Kernel.Typespec.html), via:
 
 * `@spec` - provides a specification for a function.
 * `@callback` - provides a specification for the behavior callback.
@@ -99,7 +99,7 @@ defmodule MyServer do
 end
 ```
 
-> Note: Unlike Erlang, user defined attributes are not stored in the module by default. The value exists only during compilation time. A developer can configure an attribute to behave closer to Erlang by calling [`Module.register_attribute/3`](/docs/stable/Module.html#register_attribute/3).
+> Note: Unlike Erlang, user defined attributes are not stored in the module by default. The value exists only during compilation time. A developer can configure an attribute to behave closer to Erlang by calling [`Module.register_attribute/3`](/docs/stable/elixir/Module.html#register_attribute/3).
 
 Trying to access an attribute that was not defined will print a warning:
 
diff --git a/getting_started/19.markdown b/getting_started/19.markdown
index 648a8cc36..49a18c261 100644
--- a/getting_started/19.markdown
+++ b/getting_started/19.markdown
@@ -37,7 +37,7 @@ iex> "HELLO" =~ ~r/hello/i
 true
 ```
 
-Check out the [`Regex` module](/docs/stable/Regex.html) for more information on other modifiers and the supported operations with regular expressions.
+Check out the [`Regex` module](/docs/stable/elixir/Regex.html) for more information on other modifiers and the supported operations with regular expressions.
 
 So far, all examples have used `/` to delimit a regular expression. However sigils support 8 different separators:
 
diff --git a/getting_started/2.markdown b/getting_started/2.markdown
index f45529f3a..a3bb846e3 100644
--- a/getting_started/2.markdown
+++ b/getting_started/2.markdown
@@ -172,7 +172,7 @@ iex> String.length("hellö")
 5
 ```
 
-The [String module](/docs/stable/String.html) contains a bunch of functions that operate on strings as defined in the Unicode standard:
+The [String module](/docs/stable/elixir/String.html) contains a bunch of functions that operate on strings as defined in the Unicode standard:
 
 ```iex
 iex> String.upcase("hellö")
diff --git a/getting_started/5.markdown b/getting_started/5.markdown
index 72224bbfb..21ee02ae4 100644
--- a/getting_started/5.markdown
+++ b/getting_started/5.markdown
@@ -199,7 +199,7 @@ iex> if nil do
 "This will"
 ```
 
-> Note: An interesting note regarding `if/2` and `unless/2` is that they are implemented as macros in the language; they are special language constructs as they would be in many languages. You can check the documentation and the source of `if/2` in [the `Kernel` module docs](/docs/stable/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
+> Note: An interesting note regarding `if/2` and `unless/2` is that they are implemented as macros in the language; they are special language constructs as they would be in many languages. You can check the documentation and the source of `if/2` in [the `Kernel` module docs](/docs/stable/elixir/Kernel.html). The `Kernel` module is also where operators like `+/2` and functions like `is_function/2` are defined, all automatically imported and available in your code by default.
 
 ## 5.4 `do` blocks
 
diff --git a/getting_started/6.markdown b/getting_started/6.markdown
index 9fa4c5e2f..f7470d717 100644
--- a/getting_started/6.markdown
+++ b/getting_started/6.markdown
@@ -47,7 +47,7 @@ iex> ?ł
 322
 ```
 
-You can also use the functions in [the `String` module](/docs/stable/String.html) to split a string in its code points:
+You can also use the functions in [the `String` module](/docs/stable/elixir/String.html) to split a string in its code points:
 
 ```iex
 iex> String.codepoints("hełło")
diff --git a/getting_started/7.markdown b/getting_started/7.markdown
index 871916e34..c8c2fddf4 100644
--- a/getting_started/7.markdown
+++ b/getting_started/7.markdown
@@ -75,7 +75,7 @@ iex> if(false, [do: :this, else: :that])
 
 In general, when the keyword list is the last argument of a function, the square brackets are optional.
 
-In order to manipulate keyword lists, Elixir provides [the `Keyword` module](/docs/stable/Keyword.html). Remember though keyword lists are simply lists, and as such they provide the same linear performance characteristics as lists. The longer the list, the longer it will take to find a key, to count the number of items, and so on. For this reason, keyword lists are used in Elixir mainly as options. If you need to store many items or guarantee one-key associates with at maximum one-value, you should use maps instead.
+In order to manipulate keyword lists, Elixir provides [the `Keyword` module](/docs/stable/elixir/Keyword.html). Remember though keyword lists are simply lists, and as such they provide the same linear performance characteristics as lists. The longer the list, the longer it will take to find a key, to count the number of items, and so on. For this reason, keyword lists are used in Elixir mainly as options. If you need to store many items or guarantee one-key associates with at maximum one-value, you should use maps instead.
 
 Note we can also pattern match on keyword lists:
 
@@ -156,15 +156,15 @@ Both access and update syntaxes above require the given keys to exist. For examp
 
 In future chapters, we will also learn about structs, which provide compile-time guarantees and the foundation for polymorphism in Elixir. Structs are built on top of maps where the update guarantees above are proven to be quite useful.
 
-Manipulating maps is done via [the `Map` module](/docs/stable/Map.html), it provides a very similar API to the `Keyword` module. This is because both modules implement the `Dict` behaviour.
+Manipulating maps is done via [the `Map` module](/docs/stable/elixir/Map.html), it provides a very similar API to the `Keyword` module. This is because both modules implement the `Dict` behaviour.
 
-> Note: Maps were recently introduced into the Erlang VM with [EEP 43](http://www.erlang.org/eeps/eep-0043.html). Erlang 17 provides a partial implementation of the EEP, where only "small maps" are supported. This means maps have good performance characteristics only when storing at maximum a couple of dozens keys. To fill in this gap, Elixir also provides [the `HashDict` module](/docs/stable/HashDict.html) which uses a hashing algorithm to provide a dictionary that supports hundreds of thousands keys with good performance.
+> Note: Maps were recently introduced into the Erlang VM with [EEP 43](http://www.erlang.org/eeps/eep-0043.html). Erlang 17 provides a partial implementation of the EEP, where only "small maps" are supported. This means maps have good performance characteristics only when storing at maximum a couple of dozens keys. To fill in this gap, Elixir also provides [the `HashDict` module](/docs/stable/elixir/HashDict.html) which uses a hashing algorithm to provide a dictionary that supports hundreds of thousands keys with good performance.
 
 ## 7.3 Dicts
 
 In Elixir, both keyword lists and maps are called dictionaries. In other words, a dictionary is like an interface (we call them behaviours in Elixir) and both keyword lists and maps modules implement this interface.
 
-This interface is defined in the [the `Dict` module](/docs/stable/Dict.html) module which also provides an API that delegates to the underlying implementations:
+This interface is defined in the [the `Dict` module](/docs/stable/elixir/Dict.html) module which also provides an API that delegates to the underlying implementations:
 
 ```iex
 iex> keyword = []
diff --git a/getting_started/8.markdown b/getting_started/8.markdown
index 2989a6416..f81437eec 100644
--- a/getting_started/8.markdown
+++ b/getting_started/8.markdown
@@ -8,7 +8,7 @@ guide: 8
 
   <div class="toc"></div>
 
-In Elixir we group several functions into modules. We've already used many different modules in the previous chapters like [the `String` module](/docs/stable/String.html):
+In Elixir we group several functions into modules. We've already used many different modules in the previous chapters like [the `String` module](/docs/stable/elixir/String.html):
 
 ```iex
 iex> String.length "hello"
@@ -157,7 +157,7 @@ iex> fun.(1)
 2
 ```
 
-The `&1` represents the first argument passed into the function. `&(&1+1)` above is exactly the same as `fn x -> x + 1 end`. The syntax above is useful for short function definitions. You can read more about the capture operator `&` in [the `Kernel.SpecialForms` documentation](/docs/stable/Kernel.SpecialForms.html).
+The `&1` represents the first argument passed into the function. `&(&1+1)` above is exactly the same as `fn x -> x + 1 end`. The syntax above is useful for short function definitions. You can read more about the capture operator `&` in [the `Kernel.SpecialForms` documentation](/docs/stable/elixir/Kernel.SpecialForms.html).
 
 ## 8.5 Default arguments
 
diff --git a/getting_started/9.markdown b/getting_started/9.markdown
index cbf7c8d84..08e23ad97 100644
--- a/getting_started/9.markdown
+++ b/getting_started/9.markdown
@@ -99,7 +99,7 @@ Here we have used recursion to traverse a list doubling each element and returni
 
 Recursion and tail call optimization are an important part of Elixir and are commonly used to create loops. However, when programming Elixir you will rarely use recursion as above to manipulate lists.
 
-The [`Enum` module](/docs/stable/Enum.html), which we are going to study in the next chapter, already provides many conveniences for working with lists. For instance, the examples above could be written as:
+The [`Enum` module](/docs/stable/elixir/Enum.html), which we are going to study in the next chapter, already provides many conveniences for working with lists. For instance, the examples above could be written as:
 
 ```iex
 iex> Enum.reduce([1, 2, 3], 0, fn(x, acc) -> x + acc end)
diff --git a/getting_started/meta/1.markdown b/getting_started/meta/1.markdown
index 0e8064f54..f3d07379b 100644
--- a/getting_started/meta/1.markdown
+++ b/getting_started/meta/1.markdown
@@ -143,6 +143,6 @@ In other words, it is important to make a distinction in between a regular Elixi
 
 Macros receive quoted expressions and must return quoted expressions. However, sometimes during the function of a macro, you may need to work with values and making a distinction in between them may be required.
 
-You can read more about `quote` and `unquote` in the [`Kernel.SpecialForms` module](/docs/stable/Kernel.SpecialForms.html). Documentation for `Macro.escape/1` and other quoted expressions related functions can be found in the [`Macro` module](/docs/stable/Macro.html).
+You can read more about `quote` and `unquote` in the [`Kernel.SpecialForms` module](/docs/stable/elixir/Kernel.SpecialForms.html). Documentation for `Macro.escape/1` and other quoted expressions related functions can be found in the [`Macro` module](/docs/stable/elixir/Macro.html).
 
 With this introduction we have laid the ground to finally write out first macro, so let's move to the next chapter.
diff --git a/getting_started/meta/3.markdown b/getting_started/meta/3.markdown
index 28463573e..440784b19 100644
--- a/getting_started/meta/3.markdown
+++ b/getting_started/meta/3.markdown
@@ -165,4 +165,4 @@ Running test hello
 
 Although we have glanced over some details, the bulk of how we can create domain specific modules in Elixir is here. Macros allows us to return quoted expressions that are executed in the caller, which in turn we use to transform code and to store relevant information in the target module via module attributes. Finally, with callbacks such as `@before_compile`, we have the perfect opportunity to inject code into the module when its definition is complete.
 
-Besides `@before_compile`, there are other useful module attributes, like `@on_definition` and `@after_compile` and you can more about read them in [the docs for the `Module` module](/docs/stable/Module.html). You can also find useful documentation about macros in the [`Macro` module](/docs/stable/Macro.html) and about the compilation environment in [`Macro.Env`](/docs/stable/Macro.Env.html).
+Besides `@before_compile`, there are other useful module attributes, like `@on_definition` and `@after_compile` and you can more about read them in [the docs for the `Module` module](/docs/stable/elixir/Module.html). You can also find useful documentation about macros in the [`Macro` module](/docs/stable/elixir/Macro.html) and about the compilation environment in [`Macro.Env`](/docs/stable/elixir/Macro.Env.html).

From c807b541e467844e366869706538fadb0cf3f544 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Sun, 25 May 2014 12:44:03 +0200
Subject: [PATCH 157/160] Remove target=_blank

---
 _includes/bottom.html             |  2 +-
 _includes/important-links.html    | 22 +++++++++++-----------
 _includes/learning-resources.html |  6 +++---
 _includes/sponsors.html           |  2 +-
 _includes/top.html                |  4 ++--
 5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/_includes/bottom.html b/_includes/bottom.html
index 260664e72..da7ab3085 100644
--- a/_includes/bottom.html
+++ b/_includes/bottom.html
@@ -4,7 +4,7 @@
       </div>
 
       <div id="copyright">
-        © 2012-2014 <a href="http://plataformatec.com.br/" target="_blank">Plataformatec</a>. All rights reserved.
+        © 2012-2014 <a href="http://plataformatec.com.br/">Plataformatec</a>. All rights reserved.
       </p>
     </div><!-- .wrap -->
   </div><!-- #container -->
diff --git a/_includes/important-links.html b/_includes/important-links.html
index 9b2411949..772bbab7f 100644
--- a/_includes/important-links.html
+++ b/_includes/important-links.html
@@ -2,18 +2,18 @@
   <h3 class="widget-title">Join the Community</h3>
   <ul>
     <li><a class="spec" href="irc://irc.freenode.net/elixir-lang">#elixir-lang on freenode IRC</a></li>
-    <li><a class="spec" href="http://groups.google.com/group/elixir-lang-talk" target="_blank">elixir-talk mailing list (questions)</a></li>
-    <li><a class="spec" href="http://groups.google.com/group/elixir-lang-core" target="_blank">elixir-core mailing list (development)</a></li>
-    <li><a class="spec" href="https://github.com/elixir-lang/elixir/issues" target="_blank">Issues tracker</a></li>
-    <li><a class="spec" href="http://twitter.com/elixirlang" target="_blank">@elixirlang on Twitter</a></li>
+    <li><a class="spec" href="http://groups.google.com/group/elixir-lang-talk">elixir-talk mailing list (questions)</a></li>
+    <li><a class="spec" href="http://groups.google.com/group/elixir-lang-core">elixir-core mailing list (development)</a></li>
+    <li><a class="spec" href="https://github.com/elixir-lang/elixir/issues">Issues tracker</a></li>
+    <li><a class="spec" href="http://twitter.com/elixirlang">@elixirlang on Twitter</a></li>
   </ul>
 </div>
 
 <div class="widget">
   <h3 class="widget-title">Important links</h3>
   <ul>
-    <li><a class="spec" href="https://github.com/elixir-lang/elixir/wiki" target="_blank">Wiki with articles, projects and talks done by the community</a></li>
-    <li><a class="spec" href="http://elixir-lang.org/crash-course.html" target="_blank">Crash course for Erlang developers</a></li>
+    <li><a class="spec" href="https://github.com/elixir-lang/elixir/wiki">Wiki with articles, projects and talks done by the community</a></li>
+    <li><a class="spec" href="http://elixir-lang.org/crash-course.html">Crash course for Erlang developers</a></li>
   </ul>
 </div>
 
@@ -22,11 +22,11 @@ <h3 class="widget-title">Important links</h3>
 <div class="widget">
   <h3 class="widget-title">Code editor support</h3>
   <ul>
-    <li><a class="spec" href="https://github.com/elixir-lang/emacs-elixir" target="_blank">Emacs Mode</a></li>
-    <li><a class="spec" href="https://github.com/elixir-lang/elixir-tmbundle" target="_blank">Textmate Bundle</a></li>
-    <li><a class="spec" href="https://github.com/elixir-lang/vim-elixir" target="_blank">Vim Elixir</a></li>
-    <li><a class="spec" href="https://github.com/SteffenBauer/elixir-gtksourceview" target="_blank">GtkSourceView (gedit)</a></li>
-    <li><a class="spec" href="https://github.com/lucasmazza/language-elixir" target="_blank">Atom Package</a></li>
+    <li><a class="spec" href="https://github.com/elixir-lang/emacs-elixir">Emacs Mode</a></li>
+    <li><a class="spec" href="https://github.com/elixir-lang/elixir-tmbundle">Textmate Bundle</a></li>
+    <li><a class="spec" href="https://github.com/elixir-lang/vim-elixir">Vim Elixir</a></li>
+    <li><a class="spec" href="https://github.com/SteffenBauer/elixir-gtksourceview">GtkSourceView (gedit)</a></li>
+    <li><a class="spec" href="https://github.com/lucasmazza/language-elixir">Atom Package</a></li>
   </ul>
 </div>
 
diff --git a/_includes/learning-resources.html b/_includes/learning-resources.html
index a30c82f1f..b05548558 100644
--- a/_includes/learning-resources.html
+++ b/_includes/learning-resources.html
@@ -1,8 +1,8 @@
 <div class="widget">
   <h3 class="widget-title">Learning resources</h3>
   <ul>
-    <li class="image"><a href="http://pragprog.com/titles/elixir" target="_blank" title="Programming Elixir cover"><img src="http://imagery.pragprog.com/products/361/elixir_xlargebeta.jpg?1368724397" /></a></li>
-    <li class="image"><a href="http://elixirsips.com" target="_blank" title="ElixirSips cover"><img src="http://elixirsips.com/images/ElixirLangAd2_190x160.png" width="190" height="160" /></a></li>
-    <li class="image"><a href="http://manning.com/juric/" target="_blank" title="Elixir in Action"><img src="http://manning.com/juric/juric_cover150.jpg" width="190" height="238" /></a></li>
+    <li class="image"><a href="http://pragprog.com/titles/elixir" title="Programming Elixir cover"><img src="http://imagery.pragprog.com/products/361/elixir_xlargebeta.jpg?1368724397" /></a></li>
+    <li class="image"><a href="http://elixirsips.com" title="ElixirSips cover"><img src="http://elixirsips.com/images/ElixirLangAd2_190x160.png" width="190" height="160" /></a></li>
+    <li class="image"><a href="http://manning.com/juric/" title="Elixir in Action"><img src="http://manning.com/juric/juric_cover150.jpg" width="190" height="238" /></a></li>
   </ul>
 </div>
diff --git a/_includes/sponsors.html b/_includes/sponsors.html
index ef43e3dfe..97d41ae9a 100644
--- a/_includes/sponsors.html
+++ b/_includes/sponsors.html
@@ -1,6 +1,6 @@
 <div class="widget">
   <h3 class="widget-title">Sponsors</h3>
   <ul>
-    <li class="image"><a href="http://plataformatec.com.br" target="_blank" title="Plataformatec"><img class="no-border" src="/images/logo/plataformatec.png" /></a></li>
+    <li class="image"><a href="http://plataformatec.com.br" title="Plataformatec"><img class="no-border" src="/images/logo/plataformatec.png" /></a></li>
   </ul>
 </div>
\ No newline at end of file
diff --git a/_includes/top.html b/_includes/top.html
index 26d5a7114..0e432f52a 100644
--- a/_includes/top.html
+++ b/_includes/top.html
@@ -31,8 +31,8 @@ <h1 id="site-title">
             <li class="menu-item getting_started"><a class="spec" href="/getting_started/1.html">Getting Started</a></li>
             <li class="menu-item docs"><a class="spec" href="/docs.html">Docs</a></li>
             <li class="menu-item blog"><a class="spec" href="/blog">Blog</a></li>
-            <li class="menu-item source"><a class="spec" href="https://github.com/elixir-lang/elixir" target="_blank">Source</a></li>
-            <li class="menu-item packages"><a class="spec" href="http://hex.pm/" target="_blank">Packages</a></li>
+            <li class="menu-item source"><a class="spec" href="https://github.com/elixir-lang/elixir">Source</a></li>
+            <li class="menu-item packages"><a class="spec" href="http://hex.pm/">Packages</a></li>
 
           </ul>
         </div>

From 2ce0da74254eadc4c89ef9be0bb6cfe6c988106a Mon Sep 17 00:00:00 2001
From: Benjamin Tan Wei Hao <benjamintanweihao@gmail.com>
Date: Mon, 26 May 2014 14:17:25 +0800
Subject: [PATCH 158/160] Added The Little Elixir & OTP Guidebook link

---
 _includes/learning-resources.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/_includes/learning-resources.html b/_includes/learning-resources.html
index b05548558..0d301728c 100644
--- a/_includes/learning-resources.html
+++ b/_includes/learning-resources.html
@@ -4,5 +4,6 @@ <h3 class="widget-title">Learning resources</h3>
     <li class="image"><a href="http://pragprog.com/titles/elixir" title="Programming Elixir cover"><img src="http://imagery.pragprog.com/products/361/elixir_xlargebeta.jpg?1368724397" /></a></li>
     <li class="image"><a href="http://elixirsips.com" title="ElixirSips cover"><img src="http://elixirsips.com/images/ElixirLangAd2_190x160.png" width="190" height="160" /></a></li>
     <li class="image"><a href="http://manning.com/juric/" title="Elixir in Action"><img src="http://manning.com/juric/juric_cover150.jpg" width="190" height="238" /></a></li>
+    <li class="image"><a href="http://www.exotpbook.com/" title="The Little Elixir and OTP Guidebook"><img src="https://softcover.s3.amazonaws.com/129/exotpbook/images/cover-web.png" width="190" height="274" /></a></li>
   </ul>
 </div>

From 49822cf368cdfcbeaca1d3c6a950651c28360a21 Mon Sep 17 00:00:00 2001
From: Benjamin Tan Wei Hao <benjamintanweihao@gmail.com>
Date: Mon, 26 May 2014 16:01:18 +0800
Subject: [PATCH 159/160] Use a smaller image for the book cover.

---
 _includes/learning-resources.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/_includes/learning-resources.html b/_includes/learning-resources.html
index 0d301728c..eb3ad9e38 100644
--- a/_includes/learning-resources.html
+++ b/_includes/learning-resources.html
@@ -4,6 +4,6 @@ <h3 class="widget-title">Learning resources</h3>
     <li class="image"><a href="http://pragprog.com/titles/elixir" title="Programming Elixir cover"><img src="http://imagery.pragprog.com/products/361/elixir_xlargebeta.jpg?1368724397" /></a></li>
     <li class="image"><a href="http://elixirsips.com" title="ElixirSips cover"><img src="http://elixirsips.com/images/ElixirLangAd2_190x160.png" width="190" height="160" /></a></li>
     <li class="image"><a href="http://manning.com/juric/" title="Elixir in Action"><img src="http://manning.com/juric/juric_cover150.jpg" width="190" height="238" /></a></li>
-    <li class="image"><a href="http://www.exotpbook.com/" title="The Little Elixir and OTP Guidebook"><img src="https://softcover.s3.amazonaws.com/129/exotpbook/images/cover-web.png" width="190" height="274" /></a></li>
+    <li class="image"><a href="http://www.exotpbook.com/" title="The Little Elixir and OTP Guidebook"><img src="http://i.imgur.com/G6icQmt.png" width="190" height="274" /></a></li>
   </ul>
 </div>

From 1fe9c00a5eb65d3339796ff6fe4ef94c0f29379b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@plataformatec.com.br>
Date: Tue, 3 Jun 2014 12:32:10 +0200
Subject: [PATCH 160/160] Let's talk about state

---
 getting_started/11.markdown | 86 ++++++++++++++++++++++++++++++++++---
 1 file changed, 81 insertions(+), 5 deletions(-)

diff --git a/getting_started/11.markdown b/getting_started/11.markdown
index 36d5f3bdb..27f5dc20d 100644
--- a/getting_started/11.markdown
+++ b/getting_started/11.markdown
@@ -99,8 +99,6 @@ iex> flush()
 :ok
 ```
 
-Before we finish this chapter, let's talk about process links.
-
 ## 11.3 Links
 
 The most common form of spawning in Elixir is actually via `spawn_link/1`. Before we show an example with `spawn_link/1`, let's try to see what happens when a process fails:
@@ -115,7 +113,9 @@ Well... nothing happened. That's because processes are isolated. If we want the
 ```iex
 iex> spawn_link fn -> raise "oops" end
 #PID<0.60.0>
-** (EXIT from #PID<0.60.0>) {RuntimeError[message: "oops"], [{:erlang, :apply, 2, []}]}
+** (EXIT from #PID<0.41.0>) an exception was raised:
+    ** (RuntimeError) oops
+        :erlang.apply/2
 ```
 
 When a failure happens in the shell, the shell automatically traps the failure and shows it nicely formatted. In order to understand what would really happen in our code, let's use `spawn_link/1` inside a file and run it:
@@ -131,8 +131,84 @@ end
 
 This time the process failed and brought the parent process down as they are linked. Linking can also be done manually by calling `Process.link/2`. We recommend you to take a look at [the `Process` module](/docs/stable/elixir/Process.html) for other functionality provided by processes.
 
-Process and links play an important role when building fault-tolerant systems. In Elixir applications we often link our processes to supervisors which will detect when a process die and start a new process in its place. This is only possible because processes don't share anything by default so there is no way the crash of a process can corrupt the state of another process!
+Process and links play an important role when building fault-tolerant systems. In Elixir applications, we often link our processes to supervisors which will detect when a process die and start a new process in its place. This is only possible because processes are isolated and don't share anything by default. And if processes are isolated, there is no way a failure in a process will crash or corrupt the state of another.
 
 While other languages would require us to catch/handle exceptions, in Elixir we are actually fine with letting process fail because we expect supervisors to properly restart our systems. "Failing fast" is a common philosophy when writing Elixir software!
 
-Next we'll explore the world of IO.
+Before moving to the next chapter, let's see one of the most common use case for creating processes in Elixir.
+
+## 11.4 State
+
+We haven't talked about state so far in this guide. If you are building an application that requires state, for example, to keep your application configuration, or you need to parse a file and keep it in memory, where would you store it?
+
+Processes are the most common answer to this question. We can write processes that loops infinitely, keeping a state, and sending and receiving messages. As an example, let's write a module that starts new processes that work as a key-value store in a file named `kv.exs`:
+
+```elixir
+defmodule KV do
+  def start do
+    {:ok, spawn_link(fn -> loop(%{}) end)}
+  end
+
+  defp loop(map) do
+    receive do
+      {:get, key, caller} ->
+        send caller, Map.get(map, key)
+        loop(map)
+      {:put, key, value} ->
+        loop(Map.put(map, key, value))
+    end
+  end
+end
+```
+
+Note that the `start` function basically spawns a new process that runs the `loop/1` function, starting with an empty map. The `loop/1` function then waits for messages and perform the appropriate action for each message. In case of a `:get` message, it sends a message back to the caller and calls `loop/1` again, to wait for a new message. While the `:put` message actually makes `loop/1` be invoked with a new version of the map, with the given `key` and `value` stored.
+
+Let's give it a try by running `iex kv.exs`:
+
+```iex
+iex> {:ok, pid} = KV.start
+#PID<0.62.0>
+iex> send pid, {:get, :hello, self()}
+{:get, :hello, #PID<0.41.0>}
+iex> flush
+nil
+```
+
+At first, the process map has no keys, so sending a `:get` message and then flushing the current process inbox returns `nil`. Let's send a `:put` message and try it again:
+
+```iex
+iex> send pid, {:put, :hello, :world}
+#PID<0.62.0>
+iex> send pid, {:get, :hello, self()}
+{:get, :hello, #PID<0.41.0>}
+iex> flush
+:world
+```
+
+Notice how the process is keeping a state and we can get and update this state by sending the process messages. In fact, any process that knows the `pid` above will be able to send it messages and manipulate the state.
+
+It is also possible to register the pid, giving it a name, and allowing everyone that knows the name to send it messages:
+
+```iex
+iex> Process.register(pid, :kv)
+true
+iex> send :kv, {:get, :hello, self()}
+{:get, :hello, #PID<0.41.0>}
+iex> flush
+:world
+```
+
+Using process around state and name registering are very common patterns in Elixir applications. However, most of the time, we won't implement those patterns manualy as above, but using one of the many of the abstractions that ships with Elixir. For example, Elixir provides [agents](/docs/stable/elixir/Agent.html) which are simple abstractions around state:
+
+```iex
+iex> {:ok, pid} = Agent.start_link(fn -> %{} end)
+{:ok, #PID<0.72.0>}
+iex> Agent.update(pid, fn map -> Map.put(map, :hello, :world) end)
+:ok
+iex> Agent.get(pid, fn map -> Map.get(map, :hello) end)
+:world
+```
+
+A `:name` option could also be given to `Agent.start/2` and it would be automatically registered. Besides agents, Elixir provides an API for building generic servers (called GenServer), generic event managers and event handlers (called GenEvent), tasks and more, all powered by processes underneath. Those, along with supervision trees, will be explored with more detail in the Mix and OTP guide which will build a complete Elixir application from start to finish.
+
+For now, let's move on and explore the world of I/O in Elixir.
