Permalink
Browse files

Fix typo

  • Loading branch information...
1 parent 0059c6d commit 01df9e97a2e3787e4ac80902c2bcd8cfd3b61e03 @mikepack mikepack committed Nov 28, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 getting_started/3.markdown
View
2 getting_started/3.markdown
@@ -182,7 +182,7 @@ Then, we add the head of the list to the accumulator `h + acc` and call `sum_lis
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 grown until it reaches a limit. Erlang, however, does last 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`. 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. Erlang, however, does last call optimization in which the stack does not grow when a function exits by calling another function.
Recursion and last call optimization are an important part of Erlang 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:

0 comments on commit 01df9e9

Please sign in to comment.