By Developers, For Developers
PDF Pg | Paper Pg | Type | Description | Fixed on | Comments |
---|---|---|---|---|---|
184 | 177 | TYPO | “To see get a feeling for how spec works” probably should be “To get a feeling for how spec works” | 2018-01-31 | |
187 | 180 | TYPO | “Note that there is something a bit odd going on with the keys function: we supplied namespace-qualified keys in the spec: it’s :inventory.core/:title not :title.” The namespaced keyword “:inventory.core/:title” has two colons. | 2018-01-31 | |
194 | 187 | TYPO | “You can other interesting specs in clojure.specs.alpha3, which contains the specs for Clojure itself.” perhaps should be “You can see other interesting specs in clojure.specs.alpha3, which contains the specs for Clojure itself.” | 2018-01-31 | |
9 | ERROR | If println puts spaces around arguments, how come the output isn’t shown as | 2018-01-31 | ||
25 | TYPO | “with the less-than-enlighting name” A typo in the word “enlightening”. | 2018-01-31 | ||
73 | TYPO | Staying out of trouble section… ’“A downside of immutable lists and vectors is that it tends to cause disquiet in the hearts new Clojure programmers” => “A downside of immutable lists and vectors is that it tends to cause disquiet in the hearts of new Clojure programmers” | 2018-01-31 | ||
xiii | TYPO | The bullet point on destructing seems to be missing a word. The text: “…a feature that you can use dig your data…” Maybe it was meant to read like so: “…a feature that you can use [to] dig your data…” | 2018-01-31 | ||
46 | 33 | TYPO | > (def db (def db {:dbtype “derby” :dbname “books”})) Double def. | 2018-01-31 | |
54 | 41 | ERROR | (if ‘{:full :list} (println “So is a full list!”)) should be (if ’(:full :list) (println “So is a full list!”)) | 2018-01-31 | |
89 | TYPO | page 89 of epub version… There is a change of function name between ‘shipping-charge’ and ‘shipping-cost’ I suspect it should all be the former? | 2018-01-31 | ||
184 | TYPO | > Since there is can be a significant performance | 2018-02-03 | ||
184 | SUGGEST | The fact that spec-based argument checking can introduce a performance penalty is introduced twice on the same page. Make this point only once, or have the second reference build on the first? “Since there is can be a significant performance penalty involved in checking arguments, by default the checking is disabled.” “Note that this spec-based argument checking can be a significant performance drag — consider that in our example, each book in the inventory is validated, even if the inventory is 20,000 books long — and so it should only be enabled during development and testing.” | 2018-02-03 | ||
196 | TYPO | This feels like a typo: > Clojure atomically imports java.lang into all namespaces | 2018-02-01 | ||
198 | TYPO | Missing capitalization of Java: > So in the same way we can call java methods on instances | 2018-02-01 | ||
111 | TYPO | “Well round the chapter out …” We’ll round the chapter out … | 2018-02-03 | ||
108 | TYPO | “[…] we will take a look a unifying idea in Clojure.” we will take a look at unifying idea in Clojure. | 2018-02-03 | ||
106 | TYPO | “You can call you namespace whatever you want […]” You can call your namespace whatever you want | 2018-02-03 | ||
37 | ERROR | “You can also add the optional second expression inside of your if, giving you the classic if/then/else expression, sans the else keyword:” I believe it is the optional third expression, counting the condition (which the initial description appears to do). | 2018-02-03 | ||
38 | TYPO | “The other half is being able [to] ask the questions that evaluate to a boolean.” | 2018-02-03 | ||
41 | TYPO | ( if ’{:full :list} (println “So is a full list!” )) All the if expressions above will produce some output. That’s not a list, but a map. | 2018-02-03 | ||
127 | TYPO | (def scary-animals [“Lions” “Tigers” “Bears”]) Interpose should be 2nd line not 4th | 2018-02-03 | ||
11 | TYPO | Acknowledgements, 1st paragraph, 2nd sentence: “… and everyone who as ever …” => “… and everyone who has ever …” | 2018-04-06 | ||
474 | ERROR | Actual: Expected: Explanation: by using it with s/valid? i’m expecting such result: (s/valid? n-gt-10-lt-100 99) -> true | 2018-04-06 | ||
492 | ERROR | Actual: (defn check-return [{:keys [args ret]}] Expected: (defn check-return [{:keys [args ret]}] ;; or (def not-empty-string? (s/and string? #(not (empty? %)))) (defn check-return [{:keys [args ret]}] Explanation: :fn function should return true or false value, | 2018-04-06 | ||
83 | TYPO | Reference to Incanter project is spelled “Incantor”: “For a truly imposing example of a let, we need to look no further than this, | 2018-04-06 | ||
70 | DEFER | It might be good to mention that nested function literals will give error message that confuse a novice (or a master, at first). A long function literal (like in a generator?) might tempt one to use another function literal inside. | It's a good point, but I think it will need to wait until the next edition. | ||
88 | SUGGEST | In the .epub version of the book as displayed on Google Books, the illustration in the section “Bindings Are Things Too” comes out as four almost featureless black boxes. I have no way to send a screenshot with this, but will DM one to the author. | 2018-04-06 | ||
173 | TYPO | This test may not seem impressive, but get it to run and you have demonstrated that: Well, I think that’s “inventory.core”, here and in the next item (which mentions “the inventory namespace”, too). | 2018-04-06 | ||
178 | DEFER | “Note also that while clojure.spec is well integrated with Clojure, it is It looks like the spec (alpha) jar files are automatically included without adding them as dependencies in project.clj, at least when using 1.9.0. I’ve pared down my profiles.clj and the libraries are still available and clojure.spec.alpha can be required without issue. | I think I'm going to leave this as is given that at least for a while people will be using various versions of Clojure. | ||
185 | TYPO | “All we need is another spec namespace, clojure.spec.test.alpha and the check function it contains:” better would be “All we need is clojure.spec.test.alpha again (the same namespace that contains the `instrument` function) and the `check` function it contains:” | 2018-04-06 | ||
205 | TYPO | Section: …And Great Responsibility The initial `def` is for `fav-boo`, later names are `fav-book` | 2018-04-06 | ||
155 | 144 | TYPO | para 1 line 2: painter and the value associated :writer to writer . | 2018-04-06 | |
165 | 155 | TYPO | after first paragraph: should be: | 2018-04-06 | |
176 | 167 | TYPO | Second sentence under Testing Namespace and Projects: | 2018-04-06 | |
177 | 168 | TYPO | first line: | 2018-04-06 | |
180 | 171 | TYPO | last paragraph before “Staying Out of Trouble” has an s in front of ‘with’: | 2018-04-06 | |
233 | 227 | TYPO | In the third documentation line of start-samples: the “re” of they’re is italicized | 2018-04-06 | |
253 | 249 | TYPO | Throughout the examples on this page: | 2018-04-06 | |
227 | TYPO | > " agent it there " | 2018-04-06 | ||
159 | TYPO | > “you may just find they maps and functions are enough.” | 2018-04-06 | ||
117 | ERROR | The text says that the “some” function returns the first item matching the predicate function or nil if no item found. By playing with the example, I verified that “some” does not return the first item: it returns either true or nil. | 2018-04-06 | Almost! some returns the value from the predicate or false. But good catch, thank you. | |
179 | ERROR | This function did not work for me: When I removed the argument n and changed the n to %, the function did work. Using Clojure 1.9.0 and spec-alpha that came bundled with it. | |||
22 | TYPO | In the “How Many Slots?” info box: “This enables the count function do its thing…” should probably be | |||
51 | TYPO | The print-any-args function is defined as (defn print-any-args [& args] (println “My arguments are:” args)) and the console output I see for invoking (print-any-args 7 true nil) is “My arguments are: (7 true nil)”. However, the text states the output as “My arguments are as follows: (7 true nil)”. Perhaps the words “as follows” were included in a beta version of print-any-args. | |||
89 | ERROR | The redefinition of compute-area as (defn compute-area [diameter] (* PI radius (/ diameter 2.0))) gives me a compiler error: “Unable to resolve symbol: radius in this context”. The following change works for me: (defn compute-area [diameter] (let [radius (/ diameter 2.0)] (* PI radius radius))) | |||
30 | ERROR | In the sidebar “Associative Vectors” it is stated that dissoc works on vectors. I do not think that this is correct. user=> (dissoc [0 1 2] 1) java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.IPersistentMap | |||
121 | TYPO | Overly nit-picky, but something I noticed immediately and got distracted enough to report it. The bottom of the page contains this code: ;; And we have a classic! There are two spaces between “re-matches” and “re” instead of one. | |||
155 | TYPO | The book includes the following code when discussing the instance? function: (instance? FictionalCharacter watson-1) ; True. I believe the comment “Nope” should be “True” because both expressions evaluate to true. The corresponding unit test in the sample code also appears to expect true for both expressions. | |||
153 | TYPO | The book states that: (def watson (->FictionalCharacter “John Watson” “Sign of the Four” “Doyle”)) “… gives you back a new record instance, which will print in the REPL like this:” #records.core.FictionalCharacter{:name “John Watson”, :appears-in “Sherlock Holmes”, :author “Doyle”} However, I get a different value for :appears-in when I evaluate “watson”: #brews.scratch2.FictionalCharacter{:name “John Watson”, :appears-in “Sign of the Four”, :author “Doyle”} | |||
153 | SUGGEST | The beginning of the page defines “watson” as: (def watson (->FictionalCharacter “John Watson” “Sign of the Four” “Doyle”)) Then, in the “Records Are Maps” section, the book demonstrates using assoc: (def specific-watson (assoc watson :appears-in “Sign of the Four”)) “specific-watson” doesn’t seem to be any more specific than regular ol’ “watson”. Perhaps regular ol’ “watson” was intended to be defined like this: (def watson (->FictionalCharacter “John Watson” “Sherlock Holmes” “Doyle”)) which would also address erratum #83171. | |||
157 | TYPO | The following straddles pages 156-7: “Each method needs to have at least one parameter, the record we’re operating on, which is conventionally called this. If you happen to have more than one this parameter—as we do in the greeting method in the preceding example—then this must be the first parameter.” Perhaps the phrase “more than one this parameter” should be “more than one parameter”. If not then I’m very puzzled by the concept of multiple “this” parameters. | |||
161 | TYPO | Near the bottom of the page: “Run the preceding code, and you will end up with value in test-component that should probably be “Run the preceding code, and you will end up with a value in test-component that | |||
168 | TYPO | In the third paragraph below the “Property-Based Testing” heading: “… along with a description of the of input data for which that property should hold.” should probably be: “… along with a description of the input data for which that property should hold.” | |||
170 | TYPO | At the top of the page, the book states: “For this we can use element (which will pluck a random element out of a collection) ….” However, the subsequent code sample uses “gen/elements”, not “element”. The code sample appears to agree with the documentation for clojure.test.check.generators. | |||
168 | TYPO | Near the top of the page, the provided output of running “lein test” is stated as: Ran 1 tests containing 1 assertions. The result indicates one failure but the summary map indicates no failures. | |||
211 | TYPO | The penultimate paragraph on the page begins with “The first thing to note is that all of this code, from our trivial book-store application down to the deep plumping of Compojure, ….” The notion of Compojure having a high quality skin care regimen is certainly intriguing, but I suspect “plumping” should instead be “plumbing”. | |||
215 | SUGGEST | The “State” chapter kicks off with the premise of counting the number of visitors to a web site and giving congratulations at designated count values. However, as the text progresses, the criteria changes from the 500th visitor, to every 100th visitor, and back to just the 500th visitor. If there’s a reason for changing the criteria along the way then I’m afraid I’m too dense to detect it. My humble suggestion is to commit to a single premise in order to avoid distracting the reader from the main point of the corresponding text: how atoms work. | |||
67 | TYPO | line 7 | |||
73 | TYPO | Wrong function name in text: | |||
180 | ERROR | Running “(s/explain n-gt-10 1)” does not produce the output given in the book (“val: 4 fails predicate: (> % 10)”). Either the output should be changed to “val: 1 fails predicate: (> % 10)” or the sample should be changed to “(s/explain n-gt-10 4)”. | |||
75 | TYPO | “In fact, take out the [printf]s that we’ve sprinkled here and there,” | |||
73 | SUGGEST | I’d like to suggest transposing the parameters of the ‘wrap-logging’ function from [msg handler] to [handler msg]. Specifying the handler as the first parameter appears to be the convention for Ring middleware wrapper functions. Also, the thread-first macro ‘->’ seems to be used often when applying wrappers but the ‘wrap-logging’ function in its current state wouldn’t be able to participate. Speaking of the threading macros, perhaps introducing them here instead of on page 123 would be worthwhile, that way the various ‘app’ functions on page 74 could be defined with less nesting, e.g., ;; apologies for indentation mangling ;; proposed version As someone coming from a servlet background, middleware and wrappers were completely new to me. Personally, I had a bit of trouble grasping the concept because I think I was spending extra brain cycles unpacking the ‘app’ definitions and getting a bit confused along the way. | |||
234 | TYPO | “…we’ll return :completely[ ]confused.” | |||
96 | ERROR | Thus every def and defn that we have evaluated so far—with the example of “with the EXAMPLE of our file-based project” should probably be “with the EXCEPTION of our file-based project”. | |||
116 | TYPO | They then do their thing using only first , rest , and cons , “the magic FOURSOME” should probably be “the magic THREESOME” | |||
133 | SUGGEST | The first element will be realized when calling my-repeat. Moving cons inside lazy-seq would solve this. (defn chatty-identity [x] (defn chatty-repeat [x] (defn lazy-chatty-repeat [x] (def oliver (chatty-repeat “Oliver Twist”)) ; Hi there! | |||
152 | ERROR | (defrecord FictionalCharacter[name appears-in author]) Missing space between name and fields. | |||
169 | TYPO | and all the other basic Clojure values with names like int , pos-int , Boolean , “Boolean” should be “boolean”. | |||
182 | TYPO | To turn the argument checking on we to need require yet another namespace: “we TO need” should be “we need TO”. | |||
203 | TYPO | As we saw in back in Chapter 8, Def, Symbols, and Vars “saw IN back in Chapter 8” should be “saw back in Chapter 8”. | |||
22 | ERROR | “On the other hand, adding a new item to the end of a vector can be quick if there happens to be room at the end of the block of memory.” is misleading because this alleged room at the end (also illustrated as “Extra Space” on the previous page) simply does not exist in the implementation of PersistentVectors. The text seems to describe a mixture of PersistentVector and TransientVector. | |||
28 | TYPO | The first “to” in “whether you want to your logger to include the :debug information” does not belong there. | |||
56 | TYPO | The first paragraph ends in “replacing the recursive call to sum-to-n with recur”, but the function’s name is actually sum-copies, not sum-to-n. | |||
32 | ERROR | In this context, the word remove means… | |||
9999 | ERROR | I entered a nonsensical page number because I am reading the book on Safari Books Online, and have no way to knowing either the PDF or the page number. In Chapter 8 at the end of the ‘Symbols Are Things’ section, the book says: “Being a value also means that a symbol can exist on its own,without being bound to another value.You can, in fact, make stand-alone symbols as fast as you can type,so that ’some-other-symbol and ’still-another-symbol are perfectly good expressions, even if neither symbol has ever appeared in a def.” However when I try typing a symbol into the REPL, I get this error: user=> ’some-other-symbol | |||
167 | 155 | ERROR | The code “(instance? SuperComputer watson-2)” should return true, instead of the “Nope.” in the text. The author probably meant “(instance? FictionalCharacter watson-2) ; Nope.”. |