Introducing Elixir

Errata for Introducing Elixir

Submit your own errata for this product.


The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update



Version Location Description Submitted By Date Submitted Date Corrected
PDF
Page ix
Études for Elixir

URL should be updated for "Études for Elixir" placeholder present for "url goes here". Unable to click . Found the same from http://chimera.labs.oreilly.com/books/1234000001642

Note from the Author or Editor:
Replaced with URL.

Sairam  Jul 20, 2013 
PDF
Page Higher Order Functions chapter and elsewhere
Throughout the section.

There is a new capture syntax so examples like: iex(5)> ampersand_function = 20 * &1 from page 78 will no longer work although: ampersand_function = &(20 * &1) ought to. I'm not sure when exactly this change was made, but you can see the change to the website documentation here: https://github.com/elixir-lang/elixir-lang.github.com/commit/4cc19ba22fb0aa264e1f6e2043957eb671deff90 Probably this section will need revision to reflect these changes rather than just updating the examples. Not sure if 'errata' like this are actually helpful since the book at this point specifically says it will work with 0.10.1 or 0.10.2 and doesn't mention anything higher. Then again, the book isn't even released yet and 0.11.x seems to be standard now so these things will likely need to be changed before publication. Hopefully this helps smooth that process!

Note from the Author or Editor:
I think we got this one everywhere in the update to 0.12.1. Thank you!

Nicholas  Dec 14, 2013 
PDF
Page 2
"Installing elixir"

It says "package manages" where I would expect "package managers".

Note from the Author or Editor:
This is correct, and fixed in the update.

Huib Verweij  Jun 24, 2013 
PDF
Page 7
last code snippet

iex(8)> and iex(9)> repeated twice. should be 10 and 11 respectively.

Note from the Author or Editor:
Fixed in update.

Sairam  Jul 20, 2013 
PDF
Page 9
1st paragraph

Should be "lines <19 and 20>, all the values were assigned."

Note from the Author or Editor:
Fixed - will be in next update!

BryanAsh  Oct 04, 2013 
PDF
Page 11
3rd paragraph

Consider quote marks around "yields" in "I like to read the -> as yields".

Note from the Author or Editor:
Added.

David Lorenzetti  Feb 15, 2014 
PDF
Page 11
3rd para under "Fun with fn"

Looking at "The return value in the shell, #Fun<erl_eval.6.111823515>, isn’t especially meaningful by itself..." Later in the text, fn returns values like "#Function<...>", rather than "#Fun<...>". My shell returns "#Function<6.80484245/1 in :erl_eval.expr/5>". It looks like the printed representation of the return value differs from one version of the shell to another (Function vs Fun, the numbers after erl_eval, and whether or not the arity of erl_eval.expr gets shown). So you might add a sentence saying that the exact format of the return message will vary depending on the version of Elixir. By the way, I would at least make the #Fun vs #Function consistent throughout the book.

Note from the Author or Editor:
Modified. Will check for consistency as Elixir settles.

David Lorenzetti  Feb 17, 2014 
PDF
Page 12
Last paragraph

Looking at this statement: "However, you can use this style of function, called anonymous functions because they don’t have names, in other code." I understand that the function itself doesn't have a name, and that a name like "fall_velocity" represents a variable that stores the anonymous function. However, I wonder whether the target audience will appreciate this distinction at this point. It might be better to make this explicit.

Note from the Author or Editor:
Rewrote as multiple sentences to clarify.

David Lorenzetti  Feb 15, 2014 
PDF
Page 13
Second para under "Defining Modules"

Looking at "...where name_of_module is the lower-case version name you specify inside of the module file." This seems to say that inside the module file, you specify a lower-case version name, and that the file name should match this lower-case version name. From the example, it looks like it actually means "the lower-case version of the name" (since the name of the file, "drop", is a lower-case version of the name in the module, "Drop").

Note from the Author or Editor:
Modified.

David Lorenzetti  Feb 15, 2014 
PDF
Page 13
1st para under "And the &"

Two periods at end of sentence "Elixir offers a shortcut style for defining anonymous functions using &, the capture operator. . "

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 15, 2014 
PDF
Page 14
first para

Looking at "...module - this time starting with a capital letter - and..." Hyphens should be em-dashes.

Note from the Author or Editor:
Em dashes will get fixed in production.

David Lorenzetti  Feb 15, 2014 
PDF
Page 15
last line

line starting with ((("exs files")))((("scripts"))) in code is not formatted properly, it got cut after "you will be distrib.."

Note from the Author or Editor:
Fixed in update.

Sairam  Jul 20, 2013 
PDF
Page 16
1st para under "From Module to Free-Floating Function"

Looking at "You can specify the function to retrieve with a single argument in the form Module_name.function_name/arity." Might be nice to define "arity".

Note from the Author or Editor:
Added definition!

David Lorenzetti  Feb 15, 2014 
PDF
Page 18
first full paragraph

The whole description of the pipe operator feels shoehorned in here to me, mainly because it doesn't really belong in a section called "Splitting Code Across Modules". At minimum, I would give it a section head. After all, the earlier section "From Module to Free-Floating Function" isn't any longer, or any more interesting/important, as far as I can tell. Going a bit further, I would advocate moving the "Pipe Operator" section a bit earlier in the text-- perhaps right before "From Module to Free-Floating Function".

Note from the Author or Editor:
Added subhead, but moving forward creates other complications.

David Lorenzetti  Feb 15, 2014 
PDF
Page 33
beginning of 'Adding Structure: Tuples' section

There are two problems in the first paragraph in this section: 1) The first word is "Elixirs's". I suspect it ought to be "Elixir's" 2) The second sentence ends with "as you need." I think this should probably be changed to something like "as needed" or "as you please" or something along those lines.

Note from the Author or Editor:
Fixed in update.

Nicholas  Dec 09, 2013 
PDF
Page 36
2:nd code example

The function elem/1 is used without a module. This is probably due to a global import done automatically, but I would like to know from what module this is done.

Note from the Author or Editor:
It's actually a Kernel macro, elem/2. Because it's in the Kernel, it doesn't need an import, but I've made its origin more explicit in the update.

ebengt  Jun 19, 2013 
PDF
Page 39
first full paragraph

Looking at "The now more readable formula math:sqrt(2 * Gravity * Distance). is the last line..." Neither Gravity nor Distance should be capitalized. There should not be a period after the closing parenthesis.

Note from the Author or Editor:
Fixed!

David Lorenzetti  Feb 16, 2014 
PDF
Page 40
1st para under "Adjusting to Conditions"

Looking at "This allows you to write a catch-all clause—a guard matching true at the end if you would like, and often makes it easier to express logic based on broader comparisons than simple matching." Not sure, but I believe this wants an em-dash, rather than a comma, right after "if you would like".

Note from the Author or Editor:
Broke the sentence into more coherent parts!

David Lorenzetti  Feb 16, 2014 
PDF
Page 41
Code snippet at the bottom of the page

In if ... else ... end block in the code snippet "else" is indented more than it should have been. if velocity > 20 do IO.puts("Look out below!") else # <------ Over here. IO.puts("Reasonable") end

Note from the Author or Editor:
Fixed in update!

Mistral Contrastin  Aug 27, 2013 
PDF
Page 47
The beware/scorpion box

Looking at "if your termination test relies on == or =:= for a more exact comparison rather than >= or <= for a rough comparison" This is really nitpicky, I know, but to me "exact" vs "rough" is not the best axis for comparing the tests. In particular, I don't think of ">=" as a "rough" comparison, since it has an exactly-defined starting point. Rather, to me, the distinction between these tests has to do with comparing to a single value vs a range.

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 16, 2014 
PDF
Page 47
warning/scorpion block

Looking at "...if your termination test relies on == or =:= for a..." I don't find "=:=" in the table of comparison operators on p.165 (currently Table A-4, though I believe it should be Table A-5). Nor does a search on "=:" in the PDF turn up any instance other than the one on p.47. I'm guessing this should be "===", but obviously I don't know for sure.

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 16, 2014 
PDF
Page 48
last paragraph

Variable "result" is lower-case "r", not upper-case "R". Occurs twice in this paragraph.

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 16, 2014 
PDF
Page 49
paragraph that starts "The reason this happens..."

Variable name is "result" not "Result".

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 16, 2014 
PDF
Page 50
Bottom

In a factorial example, I'm not sure that the output describing its process should have an exclamation point at the end. It might confuse the reader to see "3 yields 6!" They might think that 3 then yields 6*5*4*3*2*1 i'd suggest going without the "!" there.

Note from the Author or Editor:
Good idea. Fixed in update.

August De Blieck Jr  Sep 06, 2013 
PDF
Page 51
2nd para under "Strings"

Looking at the description of escape characters: "If you want to include a double-quote within the string, you can escape it with a backslash, like \". To include a backslash, you have to use \\, and Appendix A includes a complete list of escapes and other options. \n gives you a newline." The sentence about \n giving a newline, coming as it does after the statement about Appendix A, reads like it was tacked on as an afterthought. I would suggest moving it up so that the reference to Appendix A concludes the discussion of escaping. In fact, I would put the "\n" before the "\\", since seeing "\n" first reinforces that "\" is a special character that you will have to work in order to make literal. Hence something like: "If you want to include a double-quote within the string, you can escape it with a backslash, like \". The escape sequence \n gives you a newline. To include a backslash, you have to use \\. Appendix A includes a complete list of escapes and other options."

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 16, 2014 
PDF
Page 52
Second paragraph

"Elixir also has string interpolation, using {} as a wrapper around content to be added to the string. " Should that refer to "#{}" and not just "{}" ?

Note from the Author or Editor:
Yes - fixed in update.

Augie De Blieck Jr.  Sep 06, 2013 
PDF
Page 52
last para

In sentence "You can put anything that returns a value in the interpolation - a variable, a function call, or an operation on parts." The hyphen should be an em-dash.

Note from the Author or Editor:
Em dashes come from production later. Switched to colon.

David Lorenzetti  Feb 16, 2014 
PDF
Page 54
code

iex(3)> repeated twice. prompt sequence is not correct at lot of places.

Note from the Author or Editor:
Fixed in update.

Sairam  Jul 20, 2013 
PDF
Page 55
first para under "String sigils"

Looking at "String sigils let you tell the interpreter "this is going to be this kind of content, and you should support interpolation and escaping or not."" Since the string sigil primarily tells the interpreter "this is going to be this kind of content," I feel like the second half of the sentence (about interpolation and escaping) is unnecessary and confusing. Dropping it won't do any harm to the description of sigils, and, I think, will make the intent of sigils more clear. I would also avoid the doubled use of "this", since the word refers to two different things. Hence I would render the sentence more like, "String sigils let you tell the interpreter "this is going to be a certain kind of content."" Or, perhaps to make it more active, "String sigils tell the interpreter "treat the following string as this kind of content.""

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 16, 2014 
PDF
Page 55
heading "String sigils"

Other section heads tend to capitalize all important words. Hence, "String Sigils" not "String sigils". Similarly, on p.54, I expected "Multiline Strings" rather than "Multiline strings", but that one is less clear that the second word is "important" enough to capitalize.

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 16, 2014 
PDF
Page 62
first "tip" box

Looking at the "tip" starting "While it's possible..." I found this tip unnecessarily hard to parse. Some things I notice: (1) Beginning with the construction "While it's possible to use lists instead of tuples..." makes it sound like the point is going to be about why tuples are superior to lists, rather than about how to choose between them. I would make it clear from the start that this tip is about deciding which data structure to use. (2) I think saying lists and tuples are "ways to handle data structures" is wrong. I would say either that they are data structures, or that they are ways to handle data. (3) The contrast between a "known structure" and an "unknown quantity" doesn't exactly make sense, especially since the word "structure" is already used to talk about data structures. I would make the contrast explicitly about the number of itens represented. (4) I would try to reduce the length of that first sentence. (5) I would consider taking the last sentence out of parentheses, since it adds more information about how to use the two structures. Two possible alternates: While lists resemble tuples, your code will make more sense if you use tuples to represent mixed kinds of data in fixed quantities, and lists to handle less varied data in unknown quantities. Tuples are expected to come in a certain order and can also contain lists, so if you have a data structure that's mostly known except for an expanding part or two, including a list inside of a tuple can be a workable solution. While tuples resemble lists, tuples are expected to contain a fixed number of values in a certain order. Lists are better at handling unknown quantities of data, especially for relatively homogeneous data. Tuples can contain lists, so if your data structure is mostly known except for an expanding part or two, including a list inside of a tuple can be a workable solution.

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 17, 2014 
PDF
Page 63
3rd para under "Splitting Lists into Heads and Tails"

Looking at "The two variables separated by a vertical bar (|), or cons, for list constructor..." Consider putting "cons" in quotes, or italicizing it.

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 17, 2014 
PDF
Page 64,65, perhaps elsewhere
bottom of pg 64, top of page 65.

List.concat was deprecated some months ago apparently (see https://github.com/elixir-lang/elixir/pull/1660) and now seems to have been removed completely in favor of Enum.concat. The code samples calling List.concat will not run at all for me in Elixir 0.11.2.

Note from the Author or Editor:
Replaced in new update!

Nicholas  Dec 11, 2013 
Printed
Page 68
End of the first paragraph of 'Creating Lists With Heads and Tails'

"(“| list constructor operator”)))" doesn't seem like it belongs there.

Note from the Author or Editor:
Fixed in new update.

Nicholas  Dec 11, 2013 
PDF
Page 74
Beginning of 'Building a List of Lists' paragraph

"(((“lists”, “lists of ”))" is out of place. I'm guessing this is for generating the index? There may be other similar cases elsewhere.

Note from the Author or Editor:
Fixed in update.

Nicholas  Dec 12, 2013 
PDF
Page 77
line 11 of sample session

Looking at "iex(11)> Hof.tripler(6, my_function2)" Since the point of the example is to show that my_function2 "remembers" that x==20, exercising my_function2 through Hof.tripler adds an unnecessary layer of complexity. Consider simply: iex(11)> my_function2(6) 120

Note from the Author or Editor:
Modified.

David Lorenzetti  Feb 17, 2014 
PDF
Page 82
3rd para under "Folding Lists"

Looking at "This function divides its first argument—to be the value coming from the list—by second, the accumulator passed to it by the function doing folding." Should be "by the second" or "by its second argument".

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 17, 2014 
PDF
Page 85
1st para under "The Shell is a Process"

Looking at "You’ve been working within a single process throughout this book so far, the Erlang shell." In the past, you've described it as the "Elixir shell."

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 17, 2014 
PDF
Page 86
sample prompt iex(4)

Looking at "iex(4)> send)pid, :test2)" Need "send(" rather than "send)".

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 17, 2014 
PDF
Page 99
First mention of "voids"

Looking at "feed your process some bad data, an atom (zoids) instead of a number..." "zoids" needs a colon to be an atom-- ":zoids"

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 19, 2014 
PDF
Page 102
Last para before Example 8-9.

Looking at "When an Elixir process fails, it sends an explanation to other processes that are linked to it in the form of a tuple." Purely for ease of reading, suggest "When an Elixir process fails, it sends an explanation, in the form of a tuple, to other processes that are linked to it." Might also consider "...to any other processes..." or "...to any processes..."

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 20, 2014 
PDF
Page 103
Last full para

Looking at "That version, shown in Example 8-10, which you can find at ch08/ex10-resilient, is much tougher." Here, "tougher" means "hardier" or "more bullet-proof" or "more resilient". But it can be read like you're saying that version is harder to program, or harder to read the code, or something like that. Suggest replacing "tougher" with a word that doesn't have a second interpretation like that.

Note from the Author or Editor:
Changed to hardier.

David Lorenzetti  Feb 20, 2014 
PDF
Page 114
2nd para of "Writing Unit Tests"

Looking at "Save this is as file drop_bad.ex." "is as" --> "as"

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 22, 2014 
PDF
Page 120
second declaration of defrecord

earth is not defined. it should be :earth (an atom). line is defrecord Tower, location: "", height: 20, planemo: earth, name: ""

Note from the Author or Editor:
Fixed in update.

Sairam  Jul 20, 2013 
PDF
Page 120
last paragraph

'delcarations' - should be declarations

Note from the Author or Editor:
Fixed in update.

Sairam  Jul 20, 2013 
PDF
Page 121
code snippet on page

declarations of tower4, tower5 not visible completely. Similar code snippets were not completely visible in atleast 2-3 other places.

Note from the Author or Editor:
Fixed in update.

Sairam  Jul 20, 2013 
PDF
Page 122
Start of the 'Setting Up Records' section

"defrecord Planemo, name: :nil, gravity: 0, diameter: 0, distance_from_sun: 0 That defines a record type named Planemo, containing fields named name, gravity, and distance_from_sun with their default values." The description leaves out 'diameter'.

Note from the Author or Editor:
Fixed in update.

Nicholas  Dec 15, 2013 
PDF
Page 123
Near the bottom

"For example, to find out how which planemo tower5 is on, you could write:" has an extraneous 'how'. It shhould probably read: "For example, to find out which planemo tower5 is on, you could write:"

Note from the Author or Editor:
Fixed in update.

Nicholas  Dec 15, 2013 
PDF
Page 131
fall)velocity/2 definition in middle of code snippet

I think def fall_velocity(planemo, distance) when distance >= 0 do p = hd(:ets.lookup(:planemos, planemo)) :math.sqrt(2 * planemo.gravity * distance) end should read def fall_velocity(planemo, distance) when distance >= 0 do p = hd(:ets.lookup(:planemos, planemo)) :math.sqrt(2 * p.gravity * distance) end because the record is captured in the variable p not in the variable planmo.

Note from the Author or Editor:
Thank you - this will be fixed in the new revision.

Robie  Nov 14, 2013 
PDF
Page 132
2nd line

'the hd/1 function, which Example 5-2 showed for use with user inputs' The hd/1 function isn't used previously in the book (it might be in the code distributed separately, but not in the text) as far as I can tell with a quick text search. Could have missed something though.

Note from the Author or Editor:
Removed in update. Was left from Erlang version.

Nicholas  Dec 16, 2013 
PDF
Page 136
end of first paragraph

'/// (If you want to change where Mnesia stores data, you can start Elixir with some extra options: erl -mnesia dir " path " . The path will be the location Mnesia keeps any disk-based storage.) ///' Extraneous '///'s.

Note from the Author or Editor:
Removed in update.

Nicholas  Dec 16, 2013 
PDF
Page 141
Function handle_call

Looking at "def handle_call(_request, _from, state) do" Argument "_request" starts with an underscore. Back on p.33, the last tip of section "Underscoring That You Don't Care", makes clear that this isn't an error, because the variable does get bound. It simply suggests that, at one point in its lifetime, this function didn't use arg _request. Now that the function does use _request, it might look cleaner to remove the underscore.

Note from the Author or Editor:
Came from template and wanting to be consistent with that, but underscore removal sane. Changed.

David Lorenzetti  Feb 26, 2014 
PDF
Page 143
The "NOTE:" about 2/3 of the way down the page

Is there any particular reason this note is rendered with the all-caps "NOTE:", rather than using the bird "note" symbol like all the others?

Note from the Author or Editor:
Had to do with index entries. Fixed.

David Lorenzetti  Feb 27, 2014 
ePub
Page 145
3rd paragraph

spelling: remmeber -> remember

Note from the Author or Editor:
Will be fixed in next update.

Jim Tittsler  Jul 04, 2014 
PDF
Page 149
First note

There seems to be a word missing after "Process Manager or" below """ You can also open the Process Manager or and whack away at work&#8208; er processes through the Kill option on the Trace menu and watch them reappear. """

Note from the Author or Editor:
It was a stray 'or'. Deleted, fixed in update.

Robie  Nov 14, 2013 
PDF
Page 156
2nd para under "Creating New Logic"

Looking at "As in the previous example, the condition and options must remain +unquote+d, as they are already in internal form." The plus signs around "unquote" appear just like that in my PDF.

Note from the Author or Editor:
Formatting madness. Fixed.

David Lorenzetti  Mar 02, 2014 
PDF
Page 165
first table under "Operators"

Table caption says ".Logical (Boolean) Operators" The "." that starts this should go away. Furthermore, I think this is a table caption. Thus it should be in italics, and should read "Table A-4. Logical (Boolean) Operators" (and all subsequent tables should have their table number incremented).

Note from the Author or Editor:
Fixed.

David Lorenzetti  Feb 16, 2014