Posts:
2
From:
Sandy, UT
Registered:
2/6/12
|
|
|
Posts:
2
From:
Sandy, UT
Registered:
2/6/12
|
|
|
Posts:
1
From:
New York, NY
Registered:
4/29/12
|
|
|
|
Re: Errors and Corrections
Posted:
Apr 29, 2012 4:02 PM
in response to:
luke.bace
|
|
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.
|
|
Posts:
2
Registered:
6/6/12
|
|
|
|
Re: Errors and Corrections
Posted:
Sep 22, 2012 4:06 PM
in response to:
luke.bace
|
|
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") true
user=> (check-login "amit" "blah") false
--> last command does not eval to false. There is no amit entry in the data. you get: user=> (check-login "amit" "blah") NullPointerException user/check-login (NO_SOURCE_FILE:2)
Message was edited by: essin@ieee.org
|
|
Posts:
1
Registered:
10/19/12
|
|
|
|
Re: Errors and Corrections
Posted:
Oct 19, 2012 2:55 AM
in response to:
luke.bace
|
|
p. 119 Table 5.1
:implements - A vector of classes (should be interfaces) that the class implements.
|
|
Posts:
4
From:
Minneapolis, MN
Registered:
1/10/12
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 12, 2013 11:11 PM
in response to:
luke.bace
|
|
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
|
|
Posts:
3
Registered:
1/20/13
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 20, 2013 1:32 AM
in response to:
luke.bace
|
|
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.
|
|
Posts:
2
Registered:
1/24/13
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 24, 2013 10:15 PM
in response to:
luke.bace
|
|
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. (clojureproject\core.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)
|
|
Posts:
2
Registered:
1/24/13
|
|
|
|
Re: Errors and Corrections
Posted:
Jan 25, 2013 2:29 PM
in response to:
dmelikov
|
|
Same problem with listing 3.5 on p.76:
This is the fix: (defn ^:dynamic twice [x] ...
|
|
Posts:
31
From:
San Diego, CA
Registered:
2/16/07
|
|
|
|
Re: Errors and Corrections
Posted:
Feb 6, 2013 10:05 PM
in response to:
dmelikov
|
|
page 47, first code block uses both run-report and run-reports (should be same)
|
|
Posts:
31
From:
San Diego, CA
Registered:
2/16/07
|
|
|
|
Re: Errors and Corrections
Posted:
Feb 6, 2013 10:20 PM
in response to:
catalan42
|
|
Chapter 2, page 51, 2nd code block: the expansion of the + function should be (+ (/ rate 100) 1) since it is thread-first.
|
|
Posts:
31
From:
San Diego, CA
Registered:
2/16/07
|
|
|
|
Re: Errors and Corrections
Posted:
Feb 6, 2013 10:43 PM
in response to:
catalan42
|
|
Chapter 3, page 63, line 2: "hash" should be "map" (or at least "hashmap")
|
|
Posts:
31
From:
San Diego, CA
Registered:
2/16/07
|
|
|
|
Re: Errors and Corrections
Posted:
Feb 6, 2013 11:14 PM
in response to:
catalan42
|
|
Chapter 3, page 75, paragraph 2: "let's use test this" -> "let's test this"
|
|
Posts:
31
From:
San Diego, CA
Registered:
2/16/07
|
|
|
|
Re: Errors and Corrections
Posted:
Feb 7, 2013 9:55 PM
in response to:
catalan42
|
|
Chapter 6, page 145, last paragraph: "the threading asking for" -> "the thread asking for"
|
|
|
Legend
|
|
Gold: 300
+
pts
|
|
Silver: 100
- 299
pts
|
|
Bronze: 25
- 99
pts
|
|
Manning Author
|
|
Manning Staff
|
|