luke.bace (66) [Avatar] Offline
#1
Please post all errata here.
rmhorton (2) [Avatar] Offline
#2
Re: Errors and Corrections
p.12: This formatting of map entries is inconsistent both with use of quotes (possibly intentional) and colon placement:

(def a-map {
:first-key "first-value"
:second-key "second-value"
"third-key" :third-value
"fourth-key" 4
})

Personally, I hope you mean it is this way (oh please, oh please let it be like JSON so I can remember it!):
(def a-map {
first-key : "first-value"
second-key : "second-value"
"third-key" : third-value
"fourth-key": 4
})

p.21: "After all, lesser code leaves lesser scope for programming error. "
less code leaves less scope
('lesser' means 'lower in rank or importance', rather than 'reduced quantity'.)

p. 31: "Less code means less bugs."
Should be "Less code means fewer bugs." ('Code' is a mass noun, while 'bugs' is a count noun. That's why don't need to say 'codes' when talking about a lot of code.)
antorun (5) [Avatar] Offline
#3
Re: Errors and Corrections
p.66
quote:
...
(defn total-cost [item-cost number-of-items]
“return line-item total of the item and quantity provided”
(multiply item-cost number-of-items))
...

description:
doc string must be before parameter list :
(defn function-name doc-string? attr-map? [parameter-list]
(expressions))
kurinosuke (156) [Avatar] Offline
#4
Re: Errors and Corrections
(I didn't find this reported in the forum)

"2.3.4 Functional iteration", page 33, in the "reduce" explanation : "The result of multiplying 1 and 2 (which is 2) is multiplied with 3 (resulting in 6). That is then multiplied with 4 (resulting in 20), which is finally multiplied by 5, resulting in 120."

6*4 = 24, not 20.

---
edited: changed page number to latest meap version
kurinosuke (156) [Avatar] Offline
#5
Re: Errors and Corrections
3.1.1 Defining functions, very minor typo at the top of page 44 "paramter-list-2" should be spelled "parameter-list-2" ("parameter-list-1" is well spelled)

---
edited: changed page number to latest meap version
kurinosuke (156) [Avatar] Offline
#6
Re: Errors and Corrections
3.2.1 Vars and binding, another minor typo page 51:

In the second paragraph, MAX-CONNECTION should be MAX-CONNECTIONS.

---
edited: changed page number to latest meap version
loizeaux (1) [Avatar] Offline
#7
Re: Errors and Corrections
Page 6:
>In section 1.4, we talked about why the syntax looks like it does and how it
>relates to being able to generate code on the fly.

Two problems:
1. This was found in section 1.3. I think you meant "section 1.2" since section 1.4 is entitled "beyond object orientation."
2. You really didn't touch on how the syntax relates to being able to generate code on the fly beyond a passing reference to macros (which you state you'll cover later). If that's your explanation of how it relates, it is somewhat thin.
kurinosuke (156) [Avatar] Offline
#8
Re: Errors and Corrections
3.5 Metadata, page 61 : "extenal IO source" should be "external IO source".
kurinosuke (156) [Avatar] Offline
#9
Re: Errors and Corrections
4.3.1 Without multimethods, page 68 : "lets decide we’ll pay our affiliates" should be "let's decide we’ll pay our affiliates"

Listing 4.1 implementin the redis protocol using multimethods, page 73 : "implementin" should be "implementing"

5.1.4 bean, Number of parentheses : "It'ss true" should be "It's true"

6.2.3 Immutability and concurrency, page 91: "due to the sets being immutability" should be "due to the sets being immutable"

6.4 Refs, page 93 : "we’ve initialized the ref with an empty ma:" should be "we’ve initialized the ref with an empty map:"

6.8 State and it’s unified access model, page 104 : "it's" should be "its"

7.1.1 Textual substitution, page 106 : "However, now
that we know what macros do:" should be "However, now
we know what macros do:"
j0ni (1) [Avatar] Offline
#10
Re: Errors and Corrections
Page 169, Rabbit-MQ section - Ericsson is misspelled.
kurinosuke (156) [Avatar] Offline
#11
Re: Errors and Corrections
Section "5.3 Calling Clojure from Java" needs more details.

First, Java imports are missing :
import clojure.lang.RT;
import clojure.lang.Var;

Then, although it's obvious to Java programmers, the command line for both the compilation and the program launch should be mentioned. (e.g. the clojure.jar has to be in the classpath)
cretzel (3) [Avatar] Offline
#12
Re: Errors and Corrections
.p36
"Now let's use for to write"
"for" should be monospaced

p.42
"(user @users)"
a little bit early for "@". should use users-map as a function parameter as the example before

p.50
"calling it via with a call"
"via" xor "with"

"Here's what Clojure prints to the console:"
"Here's what Clojure prints to the console after running it the second time:"

p.51
"as a parameter to sort-by"
"sort-by" should be monospaced

p.54
"MAX-CONNECTIONS var is available other parts"
"MAX-CONNECTIONS var is available to other parts"

"For now, let's use test this"
"use" xor "test"
cretzel (3) [Avatar] Offline
#13
Re: Errors and Corrections
struct-maps are not explained in the book


p.54
"MAX-CONNECTIONS var is available other parts"
"MAX-CONNECTIONS var is available to other parts"

"The value of a var is determined by what is called it’s binding"
"The value of a var is determined by what is called its binding"

p.57
"Next, we will now take another look the let form ..."
"Next, we will now take another look at the let form ..."
"Next, we will take another look at the let form ..."

"visibility and extent (the time during which they exist.)"
"visibility and extent (the time during which they exist)."

p.58
"Let’s begin by understanding a lexical closure is by understanding what a free variable is."
"Let’s begin understanding what a lexical closure is by understanding what a free variable is."

"We’ll see some of these in action in this section, and the some in chapter 5 that covers about Java interop."
"We’ll see some of these in action in this section, and then some in chapter 5 that covers about Java interop."

p.63
"security thread"
"security threat"

p.64
"if were to check what"
"if we were to check what"
kurinosuke (156) [Avatar] Offline
#14
Re: Errors and Corrections
9.3.2 Accessing from Clojure programs, p147, "which is a written in idiomatic Clojure that makes it easy and fun to use." : should be "which is a library" or "which is written"
kurinosuke (156) [Avatar] Offline
#15
Re: Errors and Corrections
12.1.3 Parsing logs, page 196 : the blank line after the header and the blank lines between each request are missing. At least in the PDF.

page 197 : the next-log-record is using the interesting take-while function, but it is not introduced anywhere. Same for "re-seq" a bit later.
kurinosuke (156) [Avatar] Offline
#16
Re: Errors and Corrections
13.1.3 The expression problem, page 217 : "work with an entirely new data-type that has it’s own set of operations" : "it's" should be "its"

13.2.3 Tracking modi operandi, page 221 : "What we’ve done so far, is to allowed declarations" : "allowed" should be "allow"

15.1 Macros, page 255 : "we’ll write a simple macro to rview" : "rview" should be "review"
kurinosuke (156) [Avatar] Offline
#17
Re: Errors and Corrections
15.1.4 Shifting computation to compile time, page 259 : "we’re going to see another a use of macros" : "another a use" should be "another use".

Very picky, but it appears that the "z" in the second row of "Table 15.1 The alphabet rotated by 13 place" is capitalized.

15.1.5 Macro-generating macros, IMPLEMENTING MAKE-SYNONYM, page 263 : the name of the empty macro should be "make-synonym", not "synonym".
Spura (1) [Avatar] Offline
#18
Re: Errors and Corrections
p43

Multiple Arity
The arity of a function is the number of operand it accepts

operands not operand.
cretzel (3) [Avatar] Offline
#19
Re: Errors and Corrections
p.74
"even though they aren’t types in the class-based sense of the word, behave as types"
"even though they aren’t types in the class-based sense of the word, they behave as types"

p.82
"memfn also works with member functions that accepts more than one arguments."
"memfn also works with member functions that accept more than one arguments."

"regular manner. It'ss true that the"
"regular manner. It's true that the"

p.96
"Table 6.2 shows gives an overview of"
"Table 6.2 shows an overview of"

"initialized the ref with an empty ma:–"
"initialized the ref with an empty map:"

p.101
"If you try to derefernce an agent"
"If you try to dereference an agent"

p.106
"hasn’t completed yet, the threading asking for the value will"
"hasn’t completed yet, the thread asking for the value will"

p.109
"no ref, just a symbols r and v."
"no ref, just symbols r and v."

p.115
"Clojure has only about a dozen or special forms"
"Clojure has only about a dozen special forms"?

p.117
"We then use nth to pick out"
There is no "nth" used here, yet

p.130
"It then returns the return-value it was created it"
"It then returns the return-value it was created with"

p.142
"Our first function is a simply utility function"
"Our first function is a simple utility function"

p.152
let-over-lambda approach is never really explained, is it?

p.158
"We’ll also see how one might use in the open-source"
"We’ll also see how one might use the open-source"

p.175
"Similarly, a message-consumer cab accept messages"
"Similarly, a message-consumer can accept messages"

p.176
"We looked briefly looked at lazy sequences"
"We briefly looked at lazy sequences"

p.176
"We’ll it message-seq, and it might be"
"We’ll call it message-seq, and it might be"

p.177
"In this section, we’re seen how to"
"In this section, we’ve seen how to"

p.178
"This proxy object should be have the ability"
"This proxy object should have the ability"

p.178
"The job on-swarm"
"The job of on-swarm"

p.179
"is that it later on, it will"
"is that later on, it will"
luddeo (1) [Avatar] Offline
#20
Re: Errors and Corrections
I found two "error" that do not appear to have been mentioned:

In “2.2.2 The let form” there is the code

(defn average-pets []
(/ (apply + (map :number-pets (vals users))) (count users)))

here I think that it should be something like average-pets [users]
This applies to all the average-pets in this subsection.



On page 37 under the heading LISTS we have

user=> (conj (list 1 2 3 4 5) 6)
[1 2 3 4 5 6]

should this not be (6 1 2 3 4 5) or the above should be (conj [1 2 3 4 5] 6) but that would be kind of bad since it is talking about lists.
achoo (3) [Avatar] Offline
#21
Re: Errors and Corrections
P. 11 "we'll walk illustrate" (delete "walk")
achoo (3) [Avatar] Offline
#22
Re: Errors and Corrections
p. 48: "The two functions username and balance are used in other places, then defining them the way we did is OK."
achoo (3) [Avatar] Offline
#23
Re: Errors and Corrections
end of 5.1.5: By the end of the next section, you'll have a mostly complete Java interop toolkit under our belts.

probably should be "your belt"
fredfred (1) [Avatar] Offline
#24
Re: Errors and Corrections
pg: 52 - Confusing vector and list

The conj function can be used to add values to a list:
user=> (conj (list 1 2 3 4 5) 6)
[1 2 3 4 5 6]
frederikdb (3) [Avatar] Offline
#25
Re: Errors and Corrections
p.12 The example AST and code are not in sync.

The example shows the nodes "+", "3" and "4".

But the description says: "This shows a tree structure representation of code that might be written as 1 + 2; in a language such as Java or Ruby."
frederikdb (3) [Avatar] Offline
#26
Re: Errors and Corrections
[:p169 :p170]

Example in chapter 8.1.1 refers to test-simple-data-parsing, should be test-simple-date-parsing ("date" instead of "data")

Error message on p.170 also mentions "test-simple-data-parsing":

FAIL in (test-simple-data-parsing) (NO_SOURCE_FILE:1)
banzaiman (2) [Avatar] Offline
#27
Re: Errors and Corrections
§2.3.2 (p.47)

The dotimes example is wrong. If 'factorial' is defined identically to 'fact-loop' on the previous page, dotimes will try to compute (factorial 0), resulting in an infinite loop.

And if 'factorial' is meant to be defined as the 'reduce' example on the following page (p.4smilie, then this should be so noted.

Message was edited by:
banzaiman
p_so (1) [Avatar] Offline
#28
Re: Errors and Corrections
page 156, line one, 2nd to last word should be "exprs" instead of "then".
jjcomer (1) [Avatar] Offline
#29
Re: Errors and Corrections
Pg 149:
"This chapter discusses macros are and how to use them."
should be
"This chapter discusses what macros are, and how to use them.
trademark (1) [Avatar] Offline
#30
Re: Errors and Corrections
Page 41 (2.2.5)

"The reader macro (' is equivalent to using the quote form"
should be
"The reader macro '( is equivalent to using the quote form"

Page 50 (2.3.3)

The variable "principle" is mis-spelled: it should be principal (e.g. see http://en.wikipedia.org/wiki/Principal_sum)
jromine (2) [Avatar] Offline
#31
Re: Errors and Corrections
You're probably already aware of this but 1.3 requires the the ^:dynamic meta-data take for vars whose bindings are changed dynamically. Listing 3.4, for instance, doesn't work as is. Reference:

https://groups.google.com/forum/?fromgroups#!msg/clojure/vOL8MSOhp1M/wv5iSpK4FxsJ
jromine (2) [Avatar] Offline
#32
Re: Errors and Corrections
Sorry if this is a repeat.

Listing 3.7 doesn't work due to incompatibilities between org.danlarkin/clojure-json and Clojure 1.3. See:

https://groups.google.com/forum/#!topic/clojure/lz-uFmukEh0

Solution seems to be to use [org.clojure/data.json "0.1.1"]
ngroot (1) [Avatar] Offline
#33
Re: Errors and Corrections
p.211

redis-clojure is no longer maintained by ragnard. It's been picked up by tavisrudd; the new URL is https://github.com/tavisrudd/redis-clojure .

Also, the core namespace for redis-clojure is now redis.core, not redis.
essin@ieee.org (3) [Avatar] Offline
#34
Re: Errors and Corrections
in 2.1.3

(def users {"kyle" {:password "secretk" :number-pets 2}
"siva" {:password "secrets" :number-pets 4}
"rob" {:password "secretr" :number-pets 6}
"george" {:password "secretg" :number-pets 8}})
Now we can write a function that will decide if credentials are correct. It will accept a username and a password and then check to see if the associated user is valid:

(defn check-login [username password]
(let [actual-password ((users username) :password)]
(= actual-password password)))
The function is called check-login, and it takes two arguments, username and password. It does a simple check against our database of user information. You can ignore the let form for now; it’s used to introduce the local name actual-password; we’ll visit it again in the next section on program structure. We’ll also show how to use maps and symbols toward the latter part of this chapter. Let’s try check-login at the REPL:

user=> (check-login "siva" "secrets"smilie
true

user=> (check-login "amit" "blah"smilie
false

--> last command does not eval to false. There is no amit entry in the data.
you get:
user=> (check-login "amit" "blah"smilie
NullPointerException user/check-login (NO_SOURCE_FILE:2)

Message was edited by:
essin@ieee.org
Gonzih (1) [Avatar] Offline
#35
Re: Errors and Corrections
p. 119
Table 5.1

:implements - A vector of classes (should be interfaces) that the class implements.
mpettis (4) [Avatar] Offline
#36
Re: Errors and Corrections
I think that on p51 on thread-first, this:

(* (Math/pow (+ 1 (/ rate 100)) time-periods) principle)

should be this:

(* (Math/pow (+ (/ rate 100) 1) time-periods) principle)

same result, but you are explaining how threading substitutes arguments into the second positon, and I believe the second sexp here conforms with the rules and the first one you have above does not. Not sure, but I think I am right...

Message was edited by:
mpettis
pbwest (3) [Avatar] Offline
#37
Re: Errors and Corrections
Page 10
The combination of these three notations—parentheses, square brackets, and braces— makes Clojure easy to read when compared to other Common Lisp or Scheme.

...either Common Lisp or Scheme.
dmelikov (2) [Avatar] Offline
#38
Re: Errors and Corrections
p.76: running code from listing 3.4 produces following output:

Warning: *eval-me* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *eval-me* or change the name. (clojureprojectcore.clj:21)
A: 10
IllegalStateException Can't dynamically bind non-dynamic var: clojureproject.core/*eval-me* clojure.lang.Var.pushThreadBindings (Var.java:353)

Add ^:dynamic to the declaration to fix the problem:

(def ^:dynamic *eval-me* 10)
dmelikov (2) [Avatar] Offline
#39
Re: Errors and Corrections
Same problem with listing 3.5 on p.76:

This is the fix: (defn ^:dynamic twice [x] ...
catalan42 (31) [Avatar] Offline
#40
Re: Errors and Corrections
page 47, first code block uses both run-report and run-reports (should be same)
catalan42 (31) [Avatar] Offline
#41
Re: Errors and Corrections
Chapter 2, page 51, 2nd code block: the expansion of the + function should be (+ (/ rate 100) 1) since it is thread-first.
catalan42 (31) [Avatar] Offline
#42
Re: Errors and Corrections
Chapter 3, page 63, line 2: "hash" should be "map" (or at least "hashmap")
catalan42 (31) [Avatar] Offline
#43
Re: Errors and Corrections
Chapter 3, page 75, paragraph 2: "let's use test this" -> "let's test this"
catalan42 (31) [Avatar] Offline
#44
Re: Errors and Corrections
Chapter 6, page 145, last paragraph: "the threading asking for" -> "the thread asking for"