We try to keep our books accurate, but sometimes mistakes creep
in. This page lists the errors submitted by our astute readers.
If you've found a new error, please
submit it.
The latest version of the book is P4.0,
released 2 months ago.
If you've bought a PDF of the book and would like to upgrade
it to this version (for free), visit your
home page.
| PDF |
Paper |
Description |
Found in |
Fixed in |
| ZPsWN |
HHlnh |
#41052: JavaScript slideshow with the rest of the Web. , --dcBnvhtcjaIIYk
|
B1.14
22-Oct-09
|
|
|
1 |
#33410: As a Xp programmer, I was very disappointed that unit-testing wasn't part of the book. It would be great, that in a future version of the book, you talk about unit-testing ; there are several frameworks around : eUnit (not very good in my opinion) and extremeForge.--Jean-Philippe Caruana #33410: As a Xp programmer, I was very disappointed that unit-testing wasn't part of the book. It would be great, that in a future version of the book ...more...
|
P2.0
31-Jul-08
|
|
| 21 |
|
#36889: Under Microsoft Windows XP (UK), when using the DOS command prompt (CMD.EXE) and typing erl (this calls erl.exe from C:\Program Files\erl5.6.5\bin), then control G does not work: it prints ^G instead of the User switch command
-->
Calling the erlang Windows app (werl.exe) works as described.
--Francois Genolini #36889: Under Microsoft Windows XP (UK), when using the DOS command prompt (CMD.EXE) and typing erl (this calls erl.exe from C:\Program Files\erl5.6.5 ...more...
|
P3.0
05-Jan-09
|
|
| 21 |
|
#36890: footnote 3 should read q(). and not q()
At this point in the narrative the reader does not know that all erlang command prompt "commands" must end with a dot--Francois Genolini #36890: footnote 3 should read q(). and not q()
At this point in the narrative the reader does not know that all erlang command prompt "commands" mus ...more...
|
P3.0
05-Jan-09
|
|
| 28 |
|
#36891: My version of erlang (5.6.5, R12B-5), reports:
X = 1234.
** exception error: no match of right hand side value 1234
I guess that each version of erlang will have a different error message; maybe the text should be a bit more general just saying that some sort of error message will show up.--Francois Genolini #36891: My version of erlang (5.6.5, R12B-5), reports:
X = 1234.
** exception error: no match of right hand side value 1234
I guess that each ver ...more...
|
P3.0
05-Jan-09
|
|
|
34 |
#36278: In section 3.1, the file geometry.erl introduces a new construct with "%END:area". There are two problem with this introduction:
1. The construct should be explained in this section on modules, or soon afterwards.
2. The text "%END:area" is in the downloadable file, but not the file listing in the book. The two should really match, at least until the book says they will not be included.--Matthew Rawlings #36278: In section 3.1, the file geometry.erl introduces a new construct with "%END:area". There are two problem with this introduction:
1. The con ...more...
|
P1.0
04-Dec-08
|
|
|
37 |
#38338: On p37, the example of using ".erlang" file in [erlang installation directory]/bin/ to change directory automatically for Windows -- this doesn't work on my computer, Vista Home Premium with Erlang V5.6.5. #38338: On p37, the example of using ".erlang" file in [erlang installation directory]/bin/ to change directory automatically for Windows -- this does ...more...
|
P3.0
13-Mar-09
|
|
| 44 |
|
#37128: After line 7 the variable bindings in the shell are
** should read **
After line 6 the variable bindings in the shell are
--Adam Klunick
|
P3.0
18-Jan-09
|
|
|
47 |
#39231: (This erratum is for P4.0 but that option is unavailable in the drop down menu)
On page 47, module lib_misc is used as follows
1> lib_misc:for(1,10,fun(I) -> I end).
but since this is actually the first time lib_misc.erl is used in an example (it's referenced on p.42 but never explicitly imported), the example should probably be the following:
1> c(lib_misc).
2> lib_misc:for...
in order to avoid an exception on account of the .beam file not previously having been generated.
On the next page, p.48, a comment in the example notifies the reader that it will be the last time c(module) will be explicitly included in the examples.
--Jonas Nockert #39231: (This erratum is for P4.0 but that option is unavailable in the drop down menu)
On page 47, module lib_misc is used as follows
1> lib_mi ...more...
|
P3.0
22-May-09
|
|
| 47 |
|
#36930: For Erlang version 5.6.5 (R12B-5) on Windows, the .erlang file needs to be created in the usr folder inside C:\erl5.6.5 (or wherever you installed Erlang).--Francois Genolini #36930: For Erlang version 5.6.5 (R12B-5) on Windows, the .erlang file needs to be created in the usr folder inside C:\erl5.6.5 (or wherever you insta ...more...
|
P3.0
07-Jan-09
|
|
| 47 |
|
#35553: This section describes how to change the working directory of the Erlang system in Windows. However, it suggests editing the .erlang file. In my Windows installation (5.6.4) running under Windows Vista, there is no such file. There is however a file called erl.ini, which seems to include similar information. Unfortunately, adding the lines suggested in the book causes the erlang system to crash on startup. The content of the erl.ini file is very simple:
[erlang]
Bindir=C:\\Program Files\\erl5.6.4\\erts-5.6.4\\bin
Progname=erl
Rootdir=C:\\Program Files\\erl5.6.4
I tried changing the Rootdir to my working directory, however that does not work either.--Niklas Rudemo #35553: This section describes how to change the working directory of the Erlang system in Windows. However, it suggests editing the .erlang file. In ...more...
|
P3.0
30-Oct-08
|
|
| 49 |
|
#36929: Error message in Erlang 5.6.5 (R12B-5) is more useful for the beginner than the older cryptic error message in the book:
shop:cost(socks).
** exception error: no function clause matching shop:cost(socks)
--Francois Genolini #36929: Error message in Erlang 5.6.5 (R12B-5) is more useful for the beginner than the older cryptic error message in the book:
shop:cost(socks).
* ...more...
|
P3.0
07-Jan-09
|
|
| 51 |
|
#38723: It seems that this statement is invalid. I double checked; "Buy" is not referenced in the "shop1.erl" listing on page 50.
11> shop1:total(Buy).
** 2: variable 'Buy' is unbound **--Matt Darby #38723: It seems that this statement is invalid. I double checked; "Buy" is not referenced in the "shop1.erl" listing on page 50.
11> shop1:total(B ...more...
|
P3.0
04-Apr-09
|
|
| 53 |
|
#36931: Error message in Erlang 5.6.5 (R12B-5) is more useful for the beginner than the older cryptic error message in the book (and would remove the need for the entire following paragraph that decyphers the obsolete error message):
Hypot(3).
** exception error: interpreted function with arity 2 called with one argument
--Francois Genolini #36931: Error message in Erlang 5.6.5 (R12B-5) is more useful for the beginner than the older cryptic error message in the book (and would remove the ...more...
|
P3.0
07-Jan-09
|
|
| 56 |
|
#36217: When entering the function definition in the erl shell:
1> for(Max, Max, F) -> [F(Max)];
1> for(I, Max, F) -> [F(I)|for(I+1, Max, F)].
* 1: syntax error before: '->'
1>
Running Erlang 5.6.3 under Mac OS 10.5.5. Erlang was built from source.
--Chip Coons #36217: When entering the function definition in the erl shell:
1> for(Max, Max, F) -> [F(Max)];
1> for(I, Max, F) -> [F(I)|for(I+1, Max, F)].
* ...more...
|
P3.0
01-Dec-08
|
|
| 56 |
|
#36218: When entering the function definition in the erl shell:
1> for(Max, Max, F) -> [F(Max)];
1> for(I, Max, F) -> [F(I)|for(I+1, Max, F)].
* 1: syntax error before: '->'
1>
Running Erlang 5.6.3 under Mac OS 10.5.5. Erlang was built from source.
Name conflict error (the suspected cause for this issue) is not addressed until page 58.--Chip Coons #36218: When entering the function definition in the erl shell:
1> for(Max, Max, F) -> [F(Max)];
1> for(I, Max, F) -> [F(I)|for(I+1, Max, F)].
* ...more...
|
P3.0
01-Dec-08
|
|
| 62 |
|
#29719: Footnote 10 (about using ++) should refer to section 3.11 (Building Lists in Natural Order) for more information.--Richard Carlsson
|
P2.0
30-Sep-07
|
|
| 62 |
|
#34598: The new expression for total(L) using comprehensions is given as:
total(L) ->
lists:sum([shop:cost(A) * B || {A, B} <- L]).
Could it be made clearer that this should replace the expression in the file shop2.erl followed by a recompile?
It has been a few pages since that file was dealt with, so it may not be at the fingertips of some users. Or it could be a shop2a.erl file?
The code is by itself, and not following a shell prompt, but I thought the relation to the compiled file could be made clearer.
Thank you.--Sean Lynch #34598: The new expression for total(L) using comprehensions is given as:
total(L) ->
lists:sum([shop:cost(A) * B || {A, B} <- L]).
Could it ...more...
|
P3.0
22-Sep-08
|
|
| 65 |
|
#29942: Figure 3.1 describes bsl as "Arithmetic bitshift left.." and bsr as "Bitshift right..".
In fact it is Bitshift right which needs the qualifier "Arithmetic". (Bitshift left is always arithmetic, whereas bitshift right is arithmetic if and only if -1 bsr 1 =:= -1.)
--Oliver Goodman #29942: Figure 3.1 describes bsl as "Arithmetic bitshift left.." and bsr as "Bitshift right..".
In fact it is Bitshift right which needs the qualifi ...more...
|
P2.0
02-Dec-07
|
|
|
75 |
#38410: In section 4.8, the second program fragment uses the syntax try foo(...) _of_. That _of_ should not be there. The last sentence in section 4.8 ends with "write try ... _of_ ...." That _of_ should be catch.--Steve Nicolai #38410: In section 4.8, the second program fragment uses the syntax try foo(...) _of_. That _of_ should not be there. The last sentence in section 4 ...more...
|
P2.0
19-Mar-09
|
|
|
88 |
#35437: I think the <<Characteristics:32>> expression in the "Unpacking COFF Data" section will byteswap the original DWORD, but this isn't mentioned in the text. ?DWORD is defined as a little endian integer, but the default order for binaries is big endian, right? Perhaps this should be <<Characteristics:?DWORD>>? Or maybe the LHS of the match assumes byteswapping... I don't know COFF. :)--Josh Taylor #35437: I think the <<Characteristics:32>> expression in the "Unpacking COFF Data" section will byteswap the original DWORD, but this isn't mentioned ...more...
|
P1.0
24-Oct-08
|
|
| 88 |
|
#38380: It would be nice to mention bit strings and the /bits TypeSpecifier--James Morris
|
P3.0
17-Mar-09
|
|
| 142 |
|
#34226: Second to last paragraph the text "If none of the patterns matches," should probably read "If none of the patterns match,"--Geoffrey Garside
|
P2.0
24-Aug-08
|
|
| 158 |
|
#39007: The first exercise in the book isn't until pg 158. It would be helpful for there to be exercises much sooner.--Redvers Davies
|
P3.0
26-Apr-09
|
|
| 163 |
|
#39036: jaerlang-p3_0.pdf (Pg#163)
There is an error in the table describing exit signal processing. In case of trap_exit=:= true and Exit Signal = kill (see the test results on Pg. 169, confirmed with my testing as well) the correct *Action =:= Add {’EXIT’, Pid, X} to the mailbox *. Correct table entries are:
trap_exit Exit Signal Action
true X Add {’EXIT’, Pid, X} to the mailbox.
false normal Continue: Do-nothing signal
vanishes.
false kill Die: Broadcast the exit signal
killed to the link set.
false X Die: Broadcast the exit signal X to
the link set.
--Michael #39036: jaerlang-p3_0.pdf (Pg#163)
There is an error in the table describing exit signal processing. In case of trap_exit=:= true and Exit Signal = ...more...
|
P3.0
30-Apr-09
|
|
| 163 |
|
#39109: jaerlang-p3_0.pdf (Pg#163) - clarification
Untrappable exit signal is not clearly defined on Pg.163.
To make the definition clear and accurate, it should state that it is UNTRAPPABLE ONLY if the signal is received by the system process Pid if generated as exit(Pid,kill).
The exit(kill) does NOT generate untrappable exit signal.
--Michael #39109: jaerlang-p3_0.pdf (Pg#163) - clarification
Untrappable exit signal is not clearly defined on Pg.163.
To make the definition clear and accur ...more...
|
P3.0
05-May-09
|
|
| 169 |
|
#34177: in the second example, at the very top of the page, process B receives {'EXIT',<0.73.0>,kill}. Should that not be {'EXIT',<0.73.0>,killed}?
--gorenje
|
P2.0
22-Aug-08
|
|
|
171 |
#40150: This is in the example "Client on one node, server on second node but same host".
When I started the erlang nodes as specified in the book, with "erl -sname gandalf" and "erl -sname bilbo", bilbo was unable to reach gandalf:
Starting gandalf:
jeff@asterix erl $ erl -sname gandalf
Erlang R13B (erts-5.7.1) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.7.1 (abort with ^G)
(gandalf@asterix)1> kvs:start().
jeff@asterix erl $ erl -sname bilbo
Erlang R13B (erts-5.7.1) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.7.1 (abort with ^G)
(bilbo@asterix)1> rpc:call(gandalf@localhost,kvs,store,[weather,fine]).
=ERROR REPORT==== 22-Jul-2009::20:26:09 ===
Error in process <0.42.0> on node 'bilbo@asterix' with exit value: {badarg,[{erlang,list_to_existing_atom,["gandalf@asterix"]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]}
{badrpc,nodedown}
Following the advice here (http cammacrae.com/blog/2007/06/27/erlang-example-error/> it seems I need to start the erlang nodes as "erl -sname bilbo@localhost" and "erl -sname gandalf@localhost". Then it works.--Jeff Kaufman <jeff@alum.swarthmore.edu> #40150: This is in the example "Client on one node, server on second node but same host".
When I started the erlang nodes as specified in the book, ...more...
|
P2.0
22-Jul-09
|
|
| 183 |
|
#29362: in BIFs for writing distributed programs.
disconnect_node(N). must get the prefix erlang:, it is not visible from the shell.
--Falko
|
P1.0
25-Jul-07
|
|
| 209 |
|
#32325: I see that in io_widget.erl the top cell of the packer frame is being created with a PackOption of {stretch,10,120,100}. According to page 24 of this seemingly authoritative manual www.erlang.org/doc/pdf/gs.pdf , the format for PackOption is {stretch, Weight, MinPixelSize, MaxPixelSize}. So it appears that the io_widget.erl code is specifying a min > max.--Adam Duston #32325: I see that in io_widget.erl the top cell of the packer frame is being created with a PackOption of {stretch,10,120,100}. According to page 24 ...more...
|
P2.0
08-Jun-08
|
|
| 210 |
|
#41064: Misspelled variable Satte instead of State in socket_dist/io_widget.erl listing, function loop/5, receive message {updateState, N, X}, in the format string for io:format.
--Kim #41064: Misspelled variable Satte instead of State in socket_dist/io_widget.erl listing, function loop/5, receive message {updateState, N, X}, in the ...more...
|
P3.0
23-Oct-09
|
|
| 229 |
|
#33505: Missing period on line 5 in the erl session for reading a file, one term at a time.--Kim Shrier
|
P2.0
03-Aug-08
|
|
| 233 |
|
#29730: In the example id3_v1.erl, the return value of the function read_id3_tag(File) for the second clause of case file:open.... should be atom error and not tuple {File, Error}, in order to exclude any file in error in L2 in then function dir(Dir).--Jean Antoine Goncalves #29730: In the example id3_v1.erl, the return value of the function read_id3_tag(File) for the second clause of case file:open.... should be atom erro ...more...
|
P2.0
01-Oct-07
|
|
| 233 |
|
#41519: The *CODE* etc. might need to be modified for obsolete functions since R13B, like regexp
% erl
Erlang R13B02 (erts-5.7.3) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]
Eshell V5.7.3 (abort with ^G)
1> c(lib_find).
./lib_find.erl:16: Warning: regexp:sh_to_awk/1: the regexp module is deprecated (will be removed in R15A); use the re module instead
./lib_find.erl:29: Warning: regexp:match/2: the regexp module is deprecated (will be removed in R15A); use the re module instead
{ok,lib_find}
2>
--Hendrik #41519: The *CODE* etc. might need to be modified for obsolete functions since R13B, like regexp
% erl
Erlang R13B02 (erts-5.7.3) ...more...
|
P1.1
18-Nov-09
|
|
|
233 |
#35263: The -record(file_info....
omits minor_device,inode,uid,gid and the closing }
--art gittleman
|
P2.0
15-Oct-08
|
|
|
234 |
#37716: ls function does not use the directory path.
function should look something like:
ls(Dir) ->
{ok, L} = file:list_dir(Dir),
map(fun(I) -> {I, file_size_and_type(lists:concat([Dir, "/",I]))} end, sort(L)).--Paul #37716: ls function does not use the directory path.
function should look something like:
ls(Dir) ->
{ok, L} = file:list_dir(Dir),
map(f ...more...
|
P2.0
13-Feb-09
|
|
|
234 |
#37719: Sorry, change should actually use:
map(fun(I) -> {I, file_size_and_type(filename:join([Dir, I]))} end, sort(L))--Paul
|
P2.0
13-Feb-09
|
|
| 239 |
|
#41071: (Actually P4.0?) The section "Writing to a Random-Access File" says "Next, we use file:pwrite(Position, Bin)", but file:pwrite is structured more like file:pwrite(IoDevice, Position, Bin).--aschmitz #41071: (Actually P4.0?) The section "Writing to a Random-Access File" says "Next, we use file:pwrite(Position, Bin)", but file:pwrite is structured m ...more...
|
P3.0
24-Oct-09
|
|
| 239 |
|
#33524: In the erl example for writing to a random-access file, all three lines are missing the ending period.--Kim Shrier
|
P2.0
04-Aug-08
|
|
| 239 |
|
#33525: It would be better if the file name in the example of writing to a random-access file were something other than "...".--Kim Shrier
|
P2.0
04-Aug-08
|
|
|
240 |
#37714: When sending a request to wwww.erlang.com, it will not work unless you send the host as well:
ok = gen_tcp:send(Socket, lists:concat(["GET / HTTP/1.0\r\nHost: ", Host, "\r\n\r\n"])), %% (2)--Paul #37714: When sending a request to wwww.erlang.com, it will not work unless you send the host as well:
ok = gen_tcp:send(Socket, lists:concat(["GET ...more...
|
P2.0
13-Feb-09
|
|
| 241 |
|
#41231: In paragraph 3, third sentence, there is a missing word "get". The sentence should read, "If we just want to get the size of a file, ...".--Kim Shrier
|
P3.0
07-Nov-09
|
|
| 241 |
|
#33527: When introducing the ls(dir) function in lib_misc.erl, you should also include an import statement for:
-import(lists, [map/2, sort/1]).--Kim Shrier
|
P2.0
04-Aug-08
|
|
| 242 |
|
#33528: In the description of the filename module, the end of the first sentence would read better if you used "from" instead of "for". So it would read, "... rebuilding filenames from the component parts."--Kim Shrier #33528: In the description of the filename module, the end of the first sentence would read better if you used "from" instead of "for". So it would r ...more...
|
P2.0
04-Aug-08
|
|
| 243 |
|
#41250: In the lib_find.erl example, you are using the regexp module, which is currently deprecated, instead of the re module. I have redone the source which I am including below. Since the re module does not have a sh_to_awk function or anything like it, I have added a fairly minimal sh_to_pcre function at the end of lib_find.erl. You would probably want to flesh it out more. I was just trying to handle this capability with minimal functionality.
re version of lib_find.erl
-module(lib_find).
-export([files/3, files/5]).
-import(lists, [reverse/1]).
-include_lib("kernel/include/file.hrl").
files(Dir, Re, Recursive) ->
Re1 = sh_to_pcre(Re),
case re:compile(Re1) of
{ok, MP} -> reverse(files(Dir, MP, Recursive, fun(File, Acc) -> [File | Acc] end, []));
_ -> error
end.
files(Dir, Re, Recursive, Fun, Acc) ->
case file:list_dir(Dir) of
{ok, Files} -> find_files(Files, Dir, Re, Recursive, Fun, Acc);
{error, _} -> Acc
end.
find_files([File | T], Dir, Re, Recursive, Fun, Acc0) ->
FullName = filename:join([Dir, File]),
case file_type(FullName) of
regular ->
case re:run(FullName, Re) of
{match, _} ->
Acc = Fun(FullName, Acc0),
find_files(T, Dir, Re, Recursive, Fun, Acc);
_ ->
find_files(T, Dir, Re, Recursive, Fun, Acc0)
end;
directory ->
case Recursive of
true ->
Acc = Fun(FullName, Acc0),
find_files(T, Dir, Re, Recursive, Fun, Acc);
false ->
find_files(T, Dir, Re, Recursive, Fun, Acc0)
end;
error ->
find_files(T, Dir, Re, Recursive, Fun, Acc0)
end;
find_files([], _, _, _, _, A) ->
A.
file_type(File) ->
case file:read_file_info(File) of
{ok, Facts} ->
case Facts#file_info.type of
regular -> regular;
directory -> directory;
_ -> error
end;
_ ->
error
end.
sh_to_pcre(Re) ->
Re1 = re:replace(Re, "\\.", "\\\\.", [global, {return, list}]),
Re2 = re:replace(Re1, "\\*", "\\.*", [global, {return, list}]),
Re3 = re:replace(Re2, "\\?", "\\.?", [global, {return, list}]),
"^(" ++ Re3 ++ ")$".
--Kim Shrier #41250: In the lib_find.erl example, you are using the regexp module, which is currently deprecated, instead of the re module. I have redone the sour ...more...
|
P3.0
08-Nov-09
|
|
|
247 |
#35376: The code at the bottom of the page should have
gen_tcp:close(Listen),
before loop(Socket).--art gittleman
|
P2.0
20-Oct-08
|
|
| 251 |
|
#33532: In the loop(Socket) function, you invoke lib_misc:string2value(Str) but you have not added this function to the lib_misc module. In searching the PDF, I see no other reference to this function so the user that is keying in the example code from the book has nothing to go on.--Kim Shrier #33532: In the loop(Socket) function, you invoke lib_misc:string2value(Str) but you have not added this function to the lib_misc module. In searching ...more...
|
P2.0
04-Aug-08
|
|
| 258 |
|
#33533: In the first sentence of section 14.3, you have, "Suppose we write a some kind of online server ...". You should remove the word "a".--Kim Shrier
|
P2.0
04-Aug-08
|
|
| 258 |
|
#33534: In the last sentence on the page, you say that both Ni and Ki are integers in the range of 0 to 255. For IPv6 addresses, the Ki should be in the range of 0 to 65535.--Kim Shrier #33534: In the last sentence on the page, you say that both Ni and Ki are integers in the range of 0 to 255. For IPv6 addresses, the Ki should be in ...more...
|
P2.0
04-Aug-08
|
|
| 266 |
|
#33537: In the second paragraph of item 3 in "How the SHOUTcast Server Works", you have, "... uses the code developed in sections Section 13.2, ...". The word "sections" is redundant.--Kim Shrier #33537: In the second paragraph of item 3 in "How the SHOUTcast Server Works", you have, "... uses the code developed in sections Section 13.2, ...". ...more...
|
P2.0
04-Aug-08
|
|
| 279 |
|
#33596: In the fourth paragraph, third sentence, you have, "... is based on a set of measurement of the relative performances ..." The word "measurement" should be plural.--Kim Shrier #33596: In the fourth paragraph, third sentence, you have, "... is based on a set of measurement of the relative performances ..." The word "measure ...more...
|
P2.0
05-Aug-08
|
|
| 279 |
|
#33597: In item #3 toward the bottom of the page, you should add the word "it" so that it reads, "Measure the time it takes...".--Kim Shrier
|
P2.0
05-Aug-08
|
|
| 303 |
|
#38429: You should mention that the ?SERVER needs to be defined as the name of the server in the start_link() function, as it is not defined by default.--James Morris
|
P3.0
20-Mar-09
|
|
| 314 |
|
#33606: I have noticed that as I get further into the book, that more and more details are being left out of the source code. For example, on this page, you only list the two -record lines for test_mnesia.erl. Then in the example of use, you have us execute test_mnesia:do_this_once(). If you are going to leave out the -module statement, you should probably warn the reader like you did earlier about leaving out compiling the source. If you don't want to put the source for everything you are demonstrating, you should probably tell the reader that the full source is on page xxx like you did in earlier chapters. I know that I can download the example source but it for some reason I did not have access to it (maybe I am reading the dead-tree version of this book at my mother-in-laws house and she doesn't have wifi) the book would make more sense with complete source examples.
Just a suggestion.--Kim Shrier #33606: I have noticed that as I get further into the book, that more and more details are being left out of the source code. For example, on this pa ...more...
|
P2.0
06-Aug-08
|
|
| 315 |
|
#41331: Version with error is Sep 20, 2009: P4.0. The web site does not give me the option of selecting this version.
The error is, in the second paragraph, last sentence, you refer to test_mnesia as mnesia_test.--Kim Shrier #41331: Version with error is Sep 20, 2009: P4.0. The web site does not give me the option of selecting this version.
The error is, in the second ...more...
|
P3.0
11-Nov-09
|
|
| 317 |
|
#41339: In the comments for the join example, you state that the equivalent SQL is SELECT shop.item, shop.quantity, cost.name, cost.price, FROM shop, cost ...,
but the mnesia query only returns the shop.item field. You should either change the comment to read SELECT shop.item FROM shop, cost ... or you should change the query to do(qlc:q([{X#shop.item, X#shop.quantity, Y#cost.name, Y#cost.price} || X <- mnesia:table(shop), ....--Kim Shrier #41339: In the comments for the join example, you state that the equivalent SQL is SELECT shop.item, shop.quantity, cost.name, cost.price, FROM shop, ...more...
|
P3.0
11-Nov-09
|
|
| 318 |
|
#41340: In the output for the remove_shop_item example, there is a second row for orange in the output for test_mnesia:demo(select_shop). that looks like a cut-and-paste error when keying in the output.--Kim Shrier #41340: In the output for the remove_shop_item example, there is a second row for orange in the output for test_mnesia:demo(select_shop). that looks l ...more...
|
P3.0
11-Nov-09
|
|
| 328 |
|
#33616: in the erl script at the bottom of the page, the syntax coloring does not have the input in line 1 colored burgundy like the other inputs. Also, the prompt in line 2 should contain the node name like is does on line 1.--Kim Shrier #33616: in the erl script at the bottom of the page, the syntax coloring does not have the input in line 1 colored burgundy like the other inputs. Al ...more...
|
P2.0
07-Aug-08
|
|
| 337 |
|
#41376: In the comment in the event_handler.erl code, you refer to the noOp function but in the code it is no_op. The same mistake is made in the last paragraph on the next page.--Kim Shrier #41376: In the comment in the event_handler.erl code, you refer to the noOp function but in the code it is no_op. The same mistake is made in the las ...more...
|
P3.0
12-Nov-09
|
|
|
344 |
#33108: The 1.0 version had the "correct" (i.e. intentional) error of misspelling "rectangle" as "rectonge". 2.0 "fixes" the problem, leading to confusion.
(The paragraph above the example says "it contains a deliberate error (can you find it?)" which refers to this error.)--Steven Grady #33108: The 1.0 version had the "correct" (i.e. intentional) error of misspelling "rectangle" as "rectonge". 2.0 "fixes" the problem, leading to conf ...more...
|
P2.0
22-Jul-08
|
|
|
344 |
#37325: the deliberate error seems to be that compute_area is only define for square and rectangle.
the erroneous call in #3 on on the bottom of page 348 actually succeeds with the code on page 344 and in the code available from the site.
calling area_server with a different shape than square or rectangle fails with the error shown in the book.--miau #37325: the deliberate error seems to be that compute_area is only define for square and rectangle.
the erroneous call in #3 on on the bottom of pa ...more...
|
P3.0
28-Jan-09
|
|
| 346 |
|
#33794: When I compile my_alarm_handler.erl, it warns me that code_change/3 is not defined and that behaviour gen_event wants it defined. Maybe this is a change from the version of Erlang you had when writing the book. I am running R12B3. The BEAM emulator version is 5.6.3.
To fix the problem, I appended the following to the end of my_alarm_handler.erl:
code_change(_OldVsn, N, _Extra) -> {ok, N}.
I also added code_change/3 to the export list.
--Kim Shrier #33794: When I compile my_alarm_handler.erl, it warns me that code_change/3 is not defined and that behaviour gen_event wants it defined. Maybe this ...more...
|
P2.0
08-Aug-08
|
|
| 354 |
|
#33795: In the paragraph describing the Type member of the data structure, second sentence, you left out the word "a". It should read, "We can construct a tree of ...".--Kim Shrier #33795: In the paragraph describing the Type member of the data structure, second sentence, you left out the word "a". It should read, "We can constr ...more...
|
P2.0
08-Aug-08
|
|
|
354 |
#37914: sellaprim_supervisor.erl and sellaprim_app.erl in the file/content table are missing their e's in sellaprime.--Paul
|
P2.0
24-Feb-09
|
|
| 358 |
|
#34134: sellaprime.app doesn't include lib_lin in the list of modules, which is one of the dependencies of the application.
(Not that it really matters unless you make a release, in which case you'll find lib_lin is omitted from the tarball)--Brian Candler #34134: sellaprime.app doesn't include lib_lin in the list of modules, which is one of the dependencies of the application.
(Not that it really mat ...more...
|
P2.0
20-Aug-08
|
|
| 360 |
|
#41423: In the list of files for the sellaprime application, you list elog4.config. However, all the example code in the chapter says to start erl with elog3.config. All the erl command lines are:
erl -boot start_sasl -config elog3
--Kim Shrier #41423: In the list of files for the sellaprime application, you list elog4.config. However, all the example code in the chapter says to start erl wi ...more...
|
P3.0
13-Nov-09
|
|
| 363 |
|
#33796: At the top of lib_primes, you should also include the lines:
-module(lib_primes).
-export([make_prime/1, is_prime/1, make_random_int/1]).
And as mentioned in another errata, you should include the listing for lib_lin.erl.
Just a suggestion.--Kim Shrier #33796: At the top of lib_primes, you should also include the lines:
-module(lib_primes).
-export([make_prime/1, is_prime/1, make_random_int/1]) ...more...
|
P2.0
08-Aug-08
|
|
| 364 |
|
#33797: The listing for lib_primes.erl does not include the make_random_int/1 and new_seed/0 functions.--Kim Shrier
|
P2.0
08-Aug-08
|
|
| 368 |
|
#33836: In the box, third paragraph, first sentence the word "at" after the word "producing' should be removed.--Kim Shrier
|
P2.0
08-Aug-08
|
|
| 377 |
|
#39628: Instead of:
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16\
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
...
one could simply write:
for i in `seq 32`
...
The 'seq' command is supported in all shells that I know; there should be no problem with the succinct solution.--Klaus Trainer #39628: Instead of:
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16\
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
...
one could si ...more...
|
P3.0
23-Jun-09
|
|
|
381 |
#42189: I have compiled and run the code for the full text search engine and it doesn't work properly. After doing indexer:cold_start(), then indexer:start(), and indexer:search("rover") the results return none. The index that is supposed to be constructed, which I have called c:/bigIndex, has an empty C:/bigIndex/index directory, though C:/bigIndex contains 1.check, 2.check, and filenames.dets. Coverage analysis reveals that handle_result and add_to_file in indexer.erl are never executed. I have added io:format statements to try to trace the bug and found that handle_result is being passed fine to indexer_misc:mapreduce as the variable F2 which is in turn passing F2 just fine to indexer_misc:reduce which passes F2 to dict:fold and then, for some reason, dict:fold appears not to be executing handle_result. Based on my io:format printouts the program seems to have no problem finding the input directories, which I have placed at C:/InputFiles, and arranged just as in the book's example to have cars.txt, dogs.txt, and animals/cats.txt. What is the most likely source of this error? I have done nothing to change the substance of the code, only added io:format statements to try to trace the bug. It have spent hours on something I thought would compile and run as is.
--Alex Haliasos #42189: I have compiled and run the code for the full text search engine and it doesn't work properly. After doing indexer:cold_start(), then indexer ...more...
|
B1.8
26-Jan-10
|
|
|
381 |
#42190: I have compiled and run the code for the full text search engine and it doesn't work properly. After doing indexer:cold_start(), then indexer:start(), and indexer:search("rover") the results return none. The index that is supposed to be constructed, which I have called c:/bigIndex, has an empty C:/bigIndex/index directory, though C:/bigIndex contains 1.check, 2.check, and filenames.dets. Coverage analysis reveals that handle_result and add_to_file in indexer.erl are never executed. I have added io:format statements to try to trace the bug and found that handle_result is being passed fine to indexer_misc:mapreduce as the variable F2 which is in turn passing F2 just fine to indexer_misc:reduce which passes F2 to dict:fold and then, for some reason, dict:fold appears not to be executing handle_result. Based on my io:format printouts the program seems to have no problem finding the input directories, which I have placed at C:/InputFiles, and arranged just as in the book's example to have cars.txt, dogs.txt, and animals/cats.txt. What is the most likely source of this error? I have done nothing to change the substance of the code, only added io:format statements to try to trace the bug. It have spent hours on something I thought would compile and run as is.
--Alex Haliasos #42190: I have compiled and run the code for the full text search engine and it doesn't work properly. After doing indexer:cold_start(), then indexer ...more...
|
B1.8
26-Jan-10
|
|
| 382 |
|
#33838: in the collect_replies function, the receive pattern {'EXIT', _, Why} causes a warning when compiled because the Why variable is not used anywhere. You should probably make the pattern be {'EXIT', _, _Why}.--Kim Shrier #33838: in the collect_replies function, the receive pattern {'EXIT', _, Why} causes a warning when compiled because the Why variable is not used anyw ...more...
|
P2.0
08-Aug-08
|
|
| 382 |
|
#33839: In the function generate_words, you refer to lib_misc:foreachWordInFile without defining it anywhere. You also don't define foreachWordInString, isWordChar, get_word, and collect_word. Fortunately they do exist in the download version of the file.--Kim Shrier #33839: In the function generate_words, you refer to lib_misc:foreachWordInFile without defining it anywhere. You also don't define foreachWordInStri ...more...
|
P2.0
08-Aug-08
|
|
| 383 |
|
#33840: The transition from the listing of test_mapreduce.erl to the erlang shell is not well delimited. Also, the line number starts at 5 unlike all your other examples which start at 1. It makes me think something is missing from the book.--Kim Shrier #33840: The transition from the listing of test_mapreduce.erl to the erlang shell is not well delimited. Also, the line number starts at 5 unlike all ...more...
|
P2.0
08-Aug-08
|
|
| 383 |
|
#41430: In the test_mapreduce.erl program, you use the function lib_misc:foreachWordInFile/2 function which is not defined anywhere in the book.--Kim Shrier
|
P3.0
14-Nov-09
|
|
| 406 |
|
#41020: In the second paragraph, first sentence, you have, "When the client sends to a message X ...". The word "to" after "sends" should be removed. Also, this error is in the 2009-09-20 version: P4.0 which is not a version I can select on the web page for submitting errata.--Kim Shrier #41020: In the second paragraph, first sentence, you have, "When the client sends to a message X ...". The word "to" after "sends" should be removed. ...more...
|
P3.0
19-Oct-09
|
|
|
408 |
#34173: pg.90 states: "Warning: The use of apply should be avoided if possible."
The Appendix D features lib_chan.erl which uses apply/3 on page 408, line 3.
Perhaps there should be an explanation as to why it is necessitated (within the scope of what the book teaches) in one of the descriptive areas.--Jack9 #34173: pg.90 states: "Warning: The use of apply should be avoided if possible."
The Appendix D features lib_chan.erl which uses apply/3 on page 40 ...more...
|
P2.0
21-Aug-08
|
|
| 414 |
|
#41022: In the wait_close function, in the after clause, the error message has too many r's in the word error.--Kim Shrier
|
P3.0
19-Oct-09
|
|
|
437 |
#38438: In section F.3 Module: beam_lib the description of md5(Beam) is a copy of the description for version(Beam).--Steve Nicolai
|
P2.0
21-Mar-09
|
|
|
467 |
#31519: In the description of filelib functions is_dir/1, is_file/1, is_regular/1, there is no space areoung the "Name".--Petr Sturc
|
P2.0
28-Mar-08
|
|
| 476 |
|
#29930: In the description for "enter_loop" there is no whitespace around the term "gen_fsm."--Steve Vinoski
|
P2.0
27-Nov-07
|
|
| 478 |
|
#29931: In the description for "enter_loop" there is no whitespace around the term "gen_server."--Steve Vinoski
|
P2.0
27-Nov-07
|
|
| PDF |
Paper |
Description |
Found in |
Fixed in |
| 0 |
|
#29186: This is not specific to any page, but I feel that more attention needs to be paid to Erlang's string handling performance and techniques. The book mentions that binaries should be used as much as possible, and shows an example of parsing URL's from a text file, but it does not go far enough.
Based on my reading on the Internet and my own explorations, Erlang string handling (lists of integers) is both very slow performance-wise and extremely inefficient memory-wise (at least 16 bytes per character on 64-bit systems). String handling is a big deal in these days of the Web, and I know of a Web server (Yaws) written in Erlang, so obviously some people think it is suited for these types of applications.
I looked at the source code for Yaws and it seems as though it is doing some clever things with string data to get good performance, but my lack of Erlang knowledge really hamstrings me and I'd like more guidance from the book.
I was hoping that Joe would add a section (or at least a few more paragraphs) to the book on string performance and how to maximize it. I hope the answer is not something like "don't use Erlang for applications that do heavy string manipulation"!--Edwin Fine #29186: This is not specific to any page, but I feel that more attention needs to be paid to Erlang's string handling performance and techniques. The ...more...
|
P1.0rc3
03-Jun-07
|
|
| 23 |
|
#29127: Because erlang is mainly for embedded developer interesting, mabe you could note some common size/memory footprints and in this context point out of a minimal erlang configuration (standalone "sae") --Marcello Presulli #29127: Because erlang is mainly for embedded developer interesting, mabe you could note some common size/memory footprints and in this context point ...more...
|
P1.0rc2
24-May-07
|
|
| 39 |
|
#29170: I'm new to this, but I note in the transition between the section on tuples and lists, no real explanation is given as to the difference between a tuple and a list. It seems from the examples on p.37 and p.38 that I could use a tuple to hold a sequence of atoms, or I could use a list. So when would I choose a tuple, and when would I choose a list. It might be worth a "sidebar" section on - "The difference between tuples and lists ...", or something.
Anyway just a suggestion from an erlang newbie.
--David Peterson #29170: I'm new to this, but I note in the transition between the section on tuples and lists, no real explanation is given as to the difference betwe ...more...
|
P1.0rc3
30-May-07
|
|
| 65 |
|
#29215: As someone with a Haskell background, I found the section about 'list comprehension' quite understandable. However I noted that my fellow colleagues (who also enjoy the book very much!) did not reallly understand it with the perms example alone. I explained it to them with a simpler example at first, which opened the door to understanding perms:
mychar([]) -> [[]];
mychars(L) -> [ X || X <- L ].
Thus, mychars("abc") results in ["a", "b", "c"]. A colleague did not understand this at first, thinking a 'list comprehension' [ X | Y ] always needs a form of recursion to 'generate' a list of elements...
Hope this helps,
I might have been a bit vague on the explanation, I can be reached at bkok@ebay.com--Bas Kok #29215: As someone with a Haskell background, I found the section about 'list comprehension' quite understandable. However I noted that my fellow coll ...more...
|
P1.0rc3
12-Jun-07
|
|
| 73 |
|
#29717: Last paragraph: "and computing some value" should be "and computes some value"--Richard Carlsson
|
P2.0
30-Sep-07
|
|
| 74 |
|
#29718: Paragraph 5 ("If you ever see code like this...") doesn't really explain the problem, and makes it look like "++" is inherently bad somehow.
Suggestion: "If you ever see code like this (List ++ [H]) where List is the ''accumulating part'', it should set alarm bells off in your brain. It means that every time around in the loop, the ++ (append) operation has to do more and more work.{Footnote: This causes the dreaded ''quadratic behaviour'' in programming, and can really sink your program.} This is because ++ has to go through the list on the left hand side and create a new list that simply uses the right hand side as its tail. It is much cheaper if you build the new list by adding to the left hand side, and reverse the result when you're done."--Richard Carlsson #29718: Paragraph 5 ("If you ever see code like this...") doesn't really explain the problem, and makes it look like "++" is inherently bad somehow.
...more...
|
P2.0
30-Sep-07
|
|
| 74 |
|
#30327: I think there should be a statement to clarify that the function odds_and_evens() use 'commas' in the body as it is made up of 'sequence of expressions'.
It took me some time to wonder why the function body use 'commas' instead of semicolons. The previous pages that introduce 'functions' in erlang did not touch on this point, and most of the examples of function body are only one-liners. #30327: I think there should be a statement to clarify that the function odds_and_evens() use 'commas' in the body as it is made up of 'sequence of e ...more...
|
P2.0
05-Jan-08
|
|
| 77 |
|
#28933: I'd like to see a list of short exercises for the reader to do at the end of each chapter or throughout the chapter (with possible solutions) so that the reader can really test their understanding of what was taught in that section.--Saimon Moore #28933: I'd like to see a list of short exercises for the reader to do at the end of each chapter or throughout the chapter (with possible solutions) ...more...
|
B1.15
07-May-07
|
|
| 77 |
|
#29631: The explanation of BIF is not until page 86, but is used on page 77 in the explanation of exceptions.--Matt Young
|
P2.0
07-Sep-07
|
|
| 85 |
|
#29255: 4.7 -> Catching Every Possible Exception:
you mention there 'tags', but from reading the book so far, I have no clue of what tags are... ( _:_ vs. _). If would be nice if there was a link to the section where tags are being discussed in the book, e.g. "we'll be discussing tags at page X...". #29255: 4.7 -> Catching Every Possible Exception:
you mention there 'tags', but from reading the book so far, I have no clue of what tags are... ( _: ...more...
|
P1.0rc3
22-Jun-07
|
|
| 93 |
|
#29723: Paragraphs 4 and 5 both start with the same sentence: "To find the sync point..." (only the last word differs). In any case, those two paragraphs are verbose, repetetive, and hard to follow.
--Richard Carlsson #29723: Paragraphs 4 and 5 both start with the same sentence: "To find the sync point..." (only the last word differs). In any case, those two paragra ...more...
|
P2.0
30-Sep-07
|
|
| 101 |
|
#29724: The attributes "-compile(...)" and "-vsn(...)" are described as "predefined module attributes" along with "-module(...)" etc., but in fact, they are technically just user-defined attributes. They can be viewed as pragmas that some tools may or may not care about. For example, the Erlang compiler looks for -compile() attributes, but this is not part of the language in itself - it's just a feature of that particular tool.
Furthermore, it might be worth mentioning that if you don't specify a value yourself for 'vsn', the compiler fills it in for you with the MD5 sum of the module.--Richard Carlsson #29724: The attributes "-compile(...)" and "-vsn(...)" are described as "predefined module attributes" along with "-module(...)" etc., but in fact, th ...more...
|
P2.0
30-Sep-07
|
|
| 103 |
|
#29725: The subsection on Boolean Expressions should have a reference to the subsection on Short-Circuit Boolean Expressions on page 115, and vice versa. The "Note:..." part in the Short-Circuit section would be better to have in the normal Boolean Expressions section (together with the crossreferences).--Richard Carlsson #29725: The subsection on Boolean Expressions should have a reference to the subsection on Short-Circuit Boolean Expressions on page 115, and vice ver ...more...
|
P2.0
30-Sep-07
|
|
| 109 |
|
#29727: Subsection "Control Flow in Macros": This talks consistently about control flow "within a macro", "inside a macro definition", etc. But in fact, you cannot write these things *within* a macro.
Suggestion: Break it out from the Macros section, change the heading to "Preprocessor Control Flow", and talk about "During preprocessing" etc. Also, use the term "processed" instead of "evaluated". Finally, it would be a good idea to note explicitly that one cannot write e.g. "-ifdef(x)." or "-endif." _within_ a function definition or any other declaration, but only before or after.--Richard Carlsson #29727: Subsection "Control Flow in Macros": This talks consistently about control flow "within a macro", "inside a macro definition", etc. But in fac ...more...
|
P2.0
30-Sep-07
|
|
| 114 |
|
#29358: "References are globally unique"
As far as i remember that means more than inside of one erlang machine.
Would be nice to give more details, e.g. Can i be sure that this ref will never be reproduced in any cluster whereever whenever of which name ever?--Falko #29358: "References are globally unique"
As far as i remember that means more than inside of one erlang machine.
Would be nice to give more details, ...more...
|
P1.0
25-Jul-07
|
|
| 124 |
|
#29199: Maybe you like to link the pages 124 and 47. Both care about the .erlang file.
Kind regards,
Nils--Nils Muellner
|
P1.0rc3
07-Jun-07
|
|
| 124 |
|
#31251: not equivalent example
"C:\Program Files\erl5.5.3\bin\erl.exe" -noshell -s hello start -s init stop
#!/bin/sh
erl -noshell -pa /home/joe/2006/book/JAERANG/Book/code\
-s hello start -s init stop --Alexey Kuznetsov #31251: not equivalent example
"C:\Program Files\erl5.5.3\bin\erl.exe" -noshell -s hello start -s init stop
#!/bin/sh
erl -noshell -pa /hom ...more...
|
P2.0
16-Mar-08
|
|
|
143 |
#31565: The concept of a mailbox is referred to and relied upon halfway down the page, but it is not introduced and described until p145, which is also the only place referred to by the index.--Kevlin Henney #31565: The concept of a mailbox is referred to and relied upon halfway down the page, but it is not introduced and described until p145, which is als ...more...
|
P2.0
03-Apr-08
|
|
| 152 |
|
#29644: The notion of mailboxes is not introduced until section 8.6, but are referred to in 8.5 (receive with a timeout of 0)--Matt Young
|
P2.0
10-Sep-07
|
|
| 154 |
|
#29002: I thought the section on Selective Recieve went a little fast.
Since message passing/recieving is such a large portion of the language perhaps another example program would have been good here.--Chris Holliday #29002: I thought the section on Selective Recieve went a little fast.
Since message passing/recieving is such a large portion of the language per ...more...
|
B1.15
11-May-07
|
|
| 157 |
|
#29803: Section 8.10, "Spawning with MFAs": It is a misconception that spawns using funs would somehow cause problem with dynamic code loading. It is not! The fun is just used as a launch point when the process is created, and the body of the fun typically just tail calls immediately to another function which is where the new process actually lives. Hence, the spawned process will not have any references from its stack or heap back to the fun, and dynamic code loading will not be a problem. But somehow, this general warning against funs in spawn has achieved myth status, and I really wish that it was not perpetuated like this.
(If you were nutty enough to write a self-recursive fun using a Y combinator, and call spawn on that, I agree that code reloading would not work.)--Richard Carlsson #29803: Section 8.10, "Spawning with MFAs": It is a misconception that spawns using funs would somehow cause problem with dynamic code loading. It is ...more...
|
P2.0
30-Oct-07
|
|
|
182 |
#29638: Couple of things about section 10.5:
$HOME/.erlang/lib_chan.conf as stated on p179 is $HOME/.erlang_config/lib_chan.conf on my system - this may be an Ubuntu-ism? Also might be useful to move where this file should be to where you actually write the config file - (page 180, not 179).
I also second the comment elsewhere that it should be clearer that lib_chan is not part of the distribution, and that if you are going to take the bare minimum you need lib_md5 as well as the lib_chan* files.
Some brief description of the sort of error messages early on in the book would be useful (maybe as part of chp 5/6?) - they are quite cryptic coming from a different programming background. I.e. it took me a while to spot the undef and figure out that I needed extra libraries because the function wasn't defined.--Roland #29638: Couple of things about section 10.5:
$HOME/.erlang/lib_chan.conf as stated on p179 is $HOME/.erlang_config/lib_chan.conf on my system - thi ...more...
|
P2.0
08-Sep-07
|
|
| 193 |
|
#29243: Ok, I found the lib_chan code. The way it was presented to the reader did not make it clear that lib_chan was code that came with the book and needed to be downloaded. Just stating that it is out of stream did not clarify the situation and the first 4+ pages of Appendix D did not clarify the situation.
Please add a note that the code is part of the code for the book and needs to be downloaded as well as the code in the chapter.--Joe Jones #29243: Ok, I found the lib_chan code. The way it was presented to the reader did not make it clear that lib_chan was code that came with the book and ...more...
|
P1.0rc3
18-Jun-07
|
|
| 222 |
|
#29238: The sample Makefile does not work as is on Mac OS X.
Here is my version for Mac OS X:
.SUFFIXES: .erl .beam .yrl
.erl.beam:
erlc -W $<
MODS = example1 example1_lid
all: ${MODS:%=%.beam} example1 example1_drv.so
example1: example1.c erl_comm.c example1_driver.c
cc -o $@ $^
example1_drv.so: example1_lid.c example1.c
cc -o $@ -I/usr/local/lib/erlang/usr/include -fno-common -bundle -flat_namespace -undefined suppress $^
clean:
rm example1 example1_drv.so *.beam--Kazuya Sakakihara #29238: The sample Makefile does not work as is on Mac OS X.
Here is my version for Mac OS X:
.SUFFIXES: .erl .beam .yrl
.erl.beam:
erlc -W $<
...more...
|
P1.0rc3
18-Jun-07
|
|
| 223 |
|
#30751: The shared library must be called example1_drv.dll on Windows systems in order for erl_ddll:load_driver to find it. Otherwise you get
** exception exit: {error,could_not_load_driver}
in function example1_lid:start/1
when you call example1_lid:start().
from the Erlang shell.--Bruce Gunderson #30751: The shared library must be called example1_drv.dll on Windows systems in order for erl_ddll:load_driver to find it. Otherwise you get
** exc ...more...
|
P2.0
14-Feb-08
|
|
| 226 |
|
#29239: In ports/example1_lid.c, you include erl_driver.h that comes with the sample code package.
But it may fail under some reader's configuration, due to version mismatch (driver_incorrect_version).
It would be better to write #include <erl_driver.h> so that the version installed to the reader's system is used.
--Kazuya Sakakihara #29239: In ports/example1_lid.c, you include erl_driver.h that comes with the sample code package.
But it may fail under some reader's configuration, ...more...
|
P1.0rc3
18-Jun-07
|
|
| 235 |
|
#31745: I spoke too soon (#31742): there is no platform-dependent conversion happening at all. Opening a file with file:open() uses binary mode for read/write, not text mode, also on Windows. If you want to handle CRLF, you have to do it yourself. Not even io:format("~n",[]) to the emulator standard output stream will produce a CRLF on Windows, only LF.--Richard Carlsson #31745: I spoke too soon (#31742): there is no platform-dependent conversion happening at all. Opening a file with file:open() uses binary mode for re ...more...
|
P2.0
26-Apr-08
|
|
| 235 |
|
#31742: Last paragraph: the ~n formatting command: the explanation that "~n is smart" is wrong! (Try it on Windows, or just look in the code for io_lib_format.erl.) It always produces a single newline character (ASCII 10), so it is equivalent to using the escape sequence "\n", except that the latter is expanded at compile time.
What really happens (I think) is that when the newline is printed to the output stream, if the stream is open in text mode - which is normally the case if you are writing to it with io:format() - the newline will be converted to the correct sequence for the platform. (This is probably just as a consequence of the Erlang runtime system being implemented in C.) So Erlang, just like C, works on a normalized text format internally, and converts the newlines at the I/O boundaries.--Richard Carlsson #31742: Last paragraph: the ~n formatting command: the explanation that "~n is smart" is wrong! (Try it on Windows, or just look in the code for io_li ...more...
|
P2.0
26-Apr-08
|
|
|
242 |
#29973: There's suggestion to use certain kinds of accumulation techniques for tcp fragments. Now the R12B-0 have brought efficient binary accumulation which should be preferred.
I.e. instead of doing
receive_data(Socket, SoFar) ->
receive
{tcp, Socket, Bin} ->
receive_data(Socket, [Bin|SoFar]);
{tcp_closed, Socket} ->
list_to_binary(reverse(SoFar))
end.
or
receive_data(Socket, SoFar) ->
receive
{tcp, Socket, Bin} ->
receive_data(Socket, list_to_binary([Bin,SoFar]));
{tcp_closed, Socket} ->
SoFar
end.
the R12-> preferred way (by Efficiency Guide chapter 4) would be
receive_data(Socket, SoFar) ->
receive
{tcp, Socket, Bin} ->
receive_data(Socket, <<SoFar/binary, Bin/binary>>);
{tcp_closed, Socket} ->
SoFar
end.
--Jani Launonen #29973: There's suggestion to use certain kinds of accumulation techniques for tcp fragments. Now the R12B-0 have brought efficient binary accumulatio ...more...
|
P1.1
10-Dec-07
|
|
| 243 |
|
#29218: The file_info record shown here is missing the minor_device, inode, uid, and gid fields.--Steve Vinoski
|
P1.0rc3
13-Jun-07
|
|
| 261 |
|
#31749: In the UDP client/server example code, the server is parameterized with respect to 'Port', but the client code (both on p. 261 and p. 262) is hard-coded to contact the server on port 4000. This is not very elegant, and furthermore, there is no text that mentions how the "4000" suddenly turned up in the client code.--Richard Carlsson #31749: In the UDP client/server example code, the server is parameterized with respect to 'Port', but the client code (both on p. 261 and p. 262) is ...more...
|
P2.0
26-Apr-08
|
|
| 261 |
255 |
#29591: In the udp_test.erl server source:
loop(Socket) ->
receive
{udp, Socket, Host, Port, Bin} = Msg ->
The only explanation of the '= Msg' syntax in the book is back on pdf-110, paper-101 in section 'Match Operator in Patterns' of Misc. Short Topics.
1. The first time through the book, I didn't register this, maybe partly because the context was function definitions, further it's time consuming to rediscover that explanation again. I feel it would be helpful in the udp server section to remind the reader of the meaning of this construct, maybe just with a reference or even footnote back to the Match Operator section.
2. It looks like '= Msg' is used in the udp server as a convenience to simplify the io:format log messages, and so may be worth pointing out explicitly as a handy debugging technique.--Garry Bulmer #29591: In the udp_test.erl server source:
loop(Socket) ->
receive
{udp, Socket, Host, Port, Bin} = Msg ->
The only explanation of ...more...
|
P2.0
28-Aug-07
|
|
| 295 |
|
#29181: In the code for server2.erl, the catch clause uses "_:Why". I didn't understand what that meant at first. The concept of tags is introduced very loosely on page 80 ("internal errors...always have the tag error"). The code example on page 84 shows a catch that catches "_:_" and explains that the tag "throw" is the default, but in my opinion that is not emphasized enough.
I'd like to suggest that the term "tag" be more formally and clearly defined, and also that you quickly re-explain the "_:_" syntax on p. 295 near the code for server2.erl.
--Jim Menard #29181: In the code for server2.erl, the catch clause uses "_:Why". I didn't understand what that meant at first. The concept of tags is introduced ve ...more...
|
P1.0rc3
01-Jun-07
|
|
| 316 |
|
#31777: You note that qlc:q(LC) only works if LC is a literal list comprehension, and not if LC is a variable, but you do not mention that it is necessary to add a declaration -include_lib("stdlib/include/qlc.hrl") to the file (or what a parse transform is and why the qlc-expressions work at all). Readers who expect normal expression evaluation semantics get confused by this.--Richard Carlsson #31777: You note that qlc:q(LC) only works if LC is a literal list comprehension, and not if LC is a variable, but you do not mention that it is neces ...more...
|
P2.0
27-Apr-08
|
|
| 317 |
|
#31781: Section 17.2 "Adding and removing data...":
It is frustrating to read about operations like mnesia:write(Row) when there has been no explanation at all how tables are created. Please insert forward references to 17.5 "Table types" and 17.6 "Creating the initial database".
Preferably also give a short explanation about how the Name used when creating the table is implicitly used by mnesia:write(Record), which takes the record tag as the Table name and the first record field as the primary key.--Richard Carlsson #31781: Section 17.2 "Adding and removing data...":
It is frustrating to read about operations like mnesia:write(Row) when there has been no explanat ...more...
|
P2.0
27-Apr-08
|
|
|
337 |
#31987: SInce it's explaining error logger config file it's abit confusing to have "false" to represent something that is "turned on". First I thought it was a typo.
Might need some explanation on why it only gives "error reports" and not "progress reports and so on". #31987: SInce it's explaining error logger config file it's abit confusing to have "false" to represent something that is "turned on". First I thought ...more...
|
P1.0
13-May-08
|
|
| 338 |
|
#29021: Could you please mention OTP behaviors not covered by the "OTP Introduction" and "Making a System With OTP" chapters, and where to go for further information? gen_fsm is very useful in certain systems.
--Brian Zhou #29021: Could you please mention OTP behaviors not covered by the "OTP Introduction" and "Making a System With OTP" chapters, and where to go for furt ...more...
|
B1.15
14-May-07
|
|
| 343 |
|
#31066: When sasl_error_logger is configured to write to a file, on Windows at least, the directory must exist before sasl is started. Sasl will not create it. When using Msys on Windows , as explained in Appendix B, the syntax of the filename given in the config file must be Windows syntax but using '/' instead of '\'
e.g. "C:/Documents and Settings/joe/error_logs/THELOG".--Bruce Gunderson #31066: When sasl_error_logger is configured to write to a file, on Windows at least, the directory must exist before sasl is started. Sasl will not c ...more...
|
P2.0
29-Feb-08
|
|
| 346 |
|
#29919: Compiling my_error_handler (with erlc) produced the following warning:
./my_alarm_handler.erl:9: Warning: undefined callback function code_change/3 (behaviour 'gen_event')
Adding a basic implementation (and export) seemed appropriate, considering that code_change is part of the behaviour.
code_change(_OldVsn, N, _Extra) -> {ok, N}.
#29919: Compiling my_error_handler (with erlc) produced the following warning:
./my_alarm_handler.erl:9: Warning: undefined callback function code_ch ...more...
|
P2.0
25-Nov-07
|
|
|
358 |
#31192: The is_prime function uses the Rabin-Miller primality test, but doesn't properly cite it and doesn't note that it is a probablistic test rather than one that gives certain results.
--Aaron D. Ball #31192: The is_prime function uses the Rabin-Miller primality test, but doesn't properly cite it and doesn't note that it is a probablistic test rathe ...more...
|
P2.0
10-Mar-08
|
|
| 363 |
|
#31992: Due to this line in make_prime/1:
N = make_random_int(K),
2 * N - 3 may have more than K digits, which causes this kind of behaviour:
----------------
Generating a 2 digit prime ..
101
----------------
Using the (K-1)th power of 10 should make it work.--Igor R. Sucupira #31992: Due to this line in make_prime/1:
N = make_random_int(K),
2 * N - 3 may have more than K digits, which causes this kind of behaviour:
--- ...more...
|
P1.1
13-May-08
|
|
| 393 |
|
#31793: 1st bullet point: "TypeVar: A type variable". This is just a special case of the 3rd bullet point: "Type: A type expression". You should remove this point and instead add a point to the definition of TypeExpression in the previous section: "* A type variable TypeVar is a type expression. This is like a variable in and Erlang expression, but represents some type, not some value."--Richard Carlsson #31793: 1st bullet point: "TypeVar: A type variable". This is just a special case of the 3rd bullet point: "Type: A type expression". You should remov ...more...
|
P2.0
28-Apr-08
|
|
| 393 |
|
#31794: 2nd bullet point: "TypeVar::Type: A type variable followed by a type. This means that TypeVar has type Type." This is a misunderstanding. The syntax means "Name::TypeVar: The argument name, followed by a type. Here, Name looks just like a variable, but is only for documentation purposes, to make it easy to talk about the different arguments." Also, the 1st bullet point should be removed, as remarked in #31793, and the 3rd point be moved to 1st place. You could change "Type: A type expression" to "Type: A type expression, possibly just a type variable." --Richard Carlsson #31794: 2nd bullet point: "TypeVar::Type: A type variable followed by a type. This means that TypeVar has type Type." This is a misunderstanding. The ...more...
|
P2.0
28-Apr-08
|
|
| 435 |
|
#29802: Chapter E.4: it is reloading, not recompilation in itself, which causes processes to call new code. Instead of saying "recompile", say "reload" or "recompile and reload" (and clarify that the shell function c(Module) does both). Calling the compiler directly, e.g. using compile:file(...), or running erlc from an operating system shell, does not cause reloading.--Richard Carlsson #29802: Chapter E.4: it is reloading, not recompilation in itself, which causes processes to call new code. Instead of saying "recompile", say "reload ...more...
|
P2.0
30-Oct-07
|
|
| 438 |
|
#29416: Dynamic code loading. a:loop() not mentioned.
The possibility to load a new version for module a from inside module a by using the full qualified function name (prefixing the module name) should be mentioned.--Falko #29416: Dynamic code loading. a:loop() not mentioned.
The possibility to load a new version for module a from inside module a by using the full qua ...more...
|
P1.0
16-Aug-07
|
|
| 440 |
|
#29971: It would be nice if the book included the proplists module among the modules it covers in Appendix F. That module is especially useful for handling JSON converted to Erlang structures.--Steve Vinoski #29971: It would be nice if the book included the proplists module among the modules it covers in Appendix F. That module is especially useful for han ...more...
|
P2.0
10-Dec-07
|
|