Susan Harkins (247) [Avatar] Offline
#1
Please post errors you find in Elixir in Action in this folder. We'll compile and publish a comprehensive list for everyone's convenience. Thank you!

Susan Harkins
Errata Editor
361888 (6) [Avatar] Offline
#2
Chapter 3, pag. 92 (pdf pag. 117)

It's not exactly an error, however at the end of the page, it says:
The lambda receives the current accumulator value and the element from the enumerable.

Actually, if you look at the snippet, the lambda receives the element from the enumerable and the current accumulator value, in that order.
fn(element, sum) -> sum + element end

Maybe if would be better to write the sentence as it appears in the code:
The lambda receives the element from the enumerable and the current accumulator value.

I guess technically is the right thing. Of course, not a big thing.

Chapter 4, pag. 115 (pdf pag. 140)

At the end of the page, Listing 4.12, mix of formatting and syntactic issue:
Adds the new entry (to)
the entries list

Indeed, if you copypaste the sentence, it seems the 'to' is there but it's bad formatted (so it looks invisible). Probably you need to open width the rectangle.

Hope this helps... & thanks for this amazing book! I'm loving it <3

Best Regards =^ ]
Susan Harkins (247) [Avatar] Offline
#3
Current errata list is available at http://manning.com/juric/errata.html.
364327 (1) [Avatar] Offline
#4
Page 43 (pdf page 68):
The following snippet demonstrates how to creates a map:

Should be:
The following snippet demonstrates how to create a map:
oylenshpeegul (1) [Avatar] Offline
#5
There seem to be a couple of mistakes on the errata page (meta-errata? smilie

First, the page 165 entry says

... but in this chapter we’ll focus on one of its most important part: ...

should be

... but in this chapter we’ll focus on one of its most important parts: ...


This appears to be "we'll" with a Windows-1252 apostrophe, not UTF-8

$ echo we’ll | iconv -f utf8 -t cp1252
we’ll


Second, the Page 188 entry has been corrected to

For this specific case, the to-do cache performs very simple operation:


This should probably be either

For this specific case, the to-do cache performs very simple operations:


or

For this specific case, the to-do cache performs a very simple operation:
RichMorin (11) [Avatar] Offline
#6
See enclosed file for a large set of errata.
raulmurciano (7) [Avatar] Offline
#7
I think this line of the example in Listing 4.6 (pbook's page 107):

MultiDict.add(todo_list, entry.date, entry)


should be:
MultiDict.add(todo_list, entry.date, entry.title)
sjuric (86) [Avatar] Offline
#8
raulmurciano wrote:I think this line of the example in Listing 4.6 (pbook's page 107):

MultiDict.add(todo_list, entry.date, entry)


should be:
MultiDict.add(todo_list, entry.date, entry.title)


Actually, the code in the pbook is fine. In this particular section (4.1.3) we're switching from storing plain names to storing maps, so we can keep additional data in to-do entries, such as date.

The usage example at the top of the page 108 relies on this implementation and passes a map to this function:

todo_list = TodoList.new |>
  TodoList.add_entry(%{date: {2013, 12, 19}, title: "Dentist"})


The full code of the module is available here.
raulmurciano (7) [Avatar] Offline
#9
Ah, I get it now smilie Thanks!
Susan Harkins (247) [Avatar] Offline
#10
entropiae (3) [Avatar] Offline
#11
Page 198 (223 of the pdf), item #3 of the list:

that is used via these functio start/1, get/1, and store/2.


Maybe it's better as...

that is used via start/1, get/1, and store/2 functions.


otherwise just replace functio -> functions

Page 199 (224 of the pdf)

when a client needs a response, you should use calls. But even when a response isn’t needed, calls can sometimes be a better fit.


Should be

when a client needs a response, you should use calls. But even when a response isn’t needed, casts can sometimes be a better fit.
sjuric (86) [Avatar] Offline
#12
entropiae wrote:
Page 199 (224 of the pdf)

when a client needs a response, you should use calls. But even when a response isn’t needed, calls can sometimes be a better fit.


Should be

when a client needs a response, you should use calls. But even when a response isn’t needed, casts can sometimes be a better fit.


In fact the word calls is correct here. The point of that sentence is that sometimes calls can be useful even if the client doesn't need the response. As explained, the reason is that with calls, client can know the outcome of the operation. Moreover, the client is blocked while waiting for the response, which can serve as a backpressure mechanism, preventing a client to generate too much load.
entropiae (3) [Avatar] Offline
#13
Uhm it looks like I miss the "even" and misunderstood the sentence :S
entropiae (3) [Avatar] Offline
#14
Page 228 (pdf page: 253), the code snippet at the end of the page; new_registry should be replaced by process_registry.

defmodule Todo.ProcessRegistry do
  ...
  def handle_info({:DOWN, _, :process, pid, _}, process_registry) do
    {:noreply, deregister_pid(new_registry, pid)}
end
... end


should be:

defmodule Todo.ProcessRegistry do
  ...
  def handle_info({:DOWN, _, :process, pid, _}, process_registry) do
    {:noreply, deregister_pid(process_registry, pid)}
end
... end


The code in the github repository is correct.

(Great book! I'm loving it smilie)
sjuric (86) [Avatar] Offline
#15
You are right, great catch!
Also, glad you like the book smilie

entropiae wrote:Page 228 (pdf page: 253), the code snippet at the end of the page; new_registry should be replaced by process_registry.

defmodule Todo.ProcessRegistry do
  ...
  def handle_info({:DOWN, _, :process, pid, _}, process_registry) do
    {:noreply, deregister_pid(new_registry, pid)}
end
... end


should be:

defmodule Todo.ProcessRegistry do
  ...
  def handle_info({:DOWN, _, :process, pid, _}, process_registry) do
    {:noreply, deregister_pid(process_registry, pid)}
end
... end


The code in the github repository is correct.

(Great book! I'm loving it smilie)
duanjingjing (6) [Avatar] Offline
#16
On page 145 (print book), the sentence in the first paragraph:

The caller sends a message in the format {:run_query, caller, number}.

should probably be:

The caller sends a message in the format {:run_query, caller, query_def}.

----
It's a wonderful book. Thanks for writing it!
sjuric (86) [Avatar] Offline
#17
Yes, good catch! Thank you for reporting, and I'm glad you like the book smilie


duanjingjing wrote:On page 145 (print book), the sentence in the first paragraph:

The caller sends a message in the format {:run_query, caller, number}.

should probably be:

The caller sends a message in the format {:run_query, caller, query_def}.

----
It's a wonderful book. Thanks for writing it!
Mike Stok (2) [Avatar] Offline
#18
2.3.6 Module Attributes / Type Specifications
In Section 2.3.6's final paragraph on page numbered 32 in the PDF there is a reference to http://elixir- lang.org/docs/stable/elixir/Kernel.Typespec.html. This page no longer exists, I think http://elixir-lang.org/docs/stable/elixir/typespecs.html is the (as of 2016-06-01) correct URL.

We won’t be using typespecs in this book, mostly to keep the code as short as possi- ble. But if you plan to build more complex systems, my advice is to seriously consider using typespecs. You can find a detailed reference in the official docs at http://elixir- lang.org/docs/stable/elixir/Kernel.Typespec.html.
Mike Stok (2) [Avatar] Offline
#19
Errata - PDF page 99
PDF page 99:

Using large_lines!/1 as a model, write the following function:

should be

Using large_lines!/1 as a model, write the following functions:
CMUboy (4) [Avatar] Offline
#20
Errata - Chapter 2, 2.4.4. Lists
iex(1)> prime_numbers = [1, 2, 3, 5, 7]


1 is not a prime number.
Susan Harkins (247) [Avatar] Offline
#21
A current errata list is available at https://manning-content.s3.amazonaws.com/download/2/bc9b4e2-d489-424f-afe5-6206861729ee/juric_exlixirinaction_err_7.html.

Thank you,
Susan Harkins
Errata Editor
Matt Baker (1) [Avatar] Offline
#22
I noticed in chapter 5, "Working with processes", page 139, second paragraph:

In addition, you can obtain the pid of the current process by calling the auto-imported self/1 function


I'm brand new to this, but I believe it should be self/0?

Loving the book!
sjuric (86) [Avatar] Offline
#23
Matt Baker wrote:I noticed in chapter 5, "Working with processes", page 139, second paragraph:

In addition, you can obtain the pid of the current process by calling the auto-imported self/1 function


I'm brand new to this, but I believe it should be self/0?

Loving the book!


Yes, self/0 is correct, good catch! Thanks for reporting!