Permalink
Browse files

Making sure everything compiles

  • Loading branch information...
fogus committed Mar 3, 2011
1 parent 35ea8fd commit 8342756e460dfa9ed2f918a39fec21fca6759672
Showing with 13 additions and 12 deletions.
  1. +5 −1 project.clj
  2. +2 −1 src/joy/locks.clj
  3. +2 −2 src/joy/macros.clj
  4. +0 −5 src/joy/misc.clj
  5. +2 −2 src/joy/slice.clj
  6. +2 −1 src/joy/types.clj
View
@@ -1,4 +1,8 @@
(defproject joyofclojure "1.0.0"
:description "The official source code for the book 'The Joy of Clojure'"
:dependencies [[org.clojure/clojure "1.2.0"]
- [org.clojure/clojure-contrib "1.2.0"]])
+ [org.clojure/clojure-contrib "1.2.0"]]
+ :dev-dependencies [[lein-clojars "0.5.0-SNAPSHOT"]
+ [jline "0.9.94"]
+ [swank-clojure "1.2.1"]
+ [marginalia "0.5.0"]])
View
@@ -1,6 +1,7 @@
(ns joy.locks
"Examples for locking from section 11.5"
- (:refer-clojure :exclude [aget aset count seq]))
+ (:refer-clojure :exclude [aget aset count seq])
+ (:use [joy.mutation :only (dothreads!)]))
(defprotocol SafeArray ;; #: SafeArray features a small set of functions
(aset [this i f])
View
@@ -52,9 +52,9 @@
(for [t things]
{:tag :thing,
:attrs (grok-attrs (take-while (comp not vector?) t))
- :content (if-let [c (grok-props (drop-while (comp not vector?) t))
+ :content (if-let [c (grok-props (drop-while (comp not vector?) t))]
[c]
- [])})))
+ [])}))
(defn grok-attrs [attrs]
(into {:name (str (first attrs))}
View
@@ -35,8 +35,6 @@
[(first s) (lz-rec-step (rest s))]
[])))
-(def tri-nums (map triangle (iterate inc 1)))
-
(def fifth (comp first rest rest rest rest))
;; chapter 7
@@ -90,9 +88,6 @@
`(try (-> ~@forms)
(catch NullPointerException _# nil)))
-(def slowly (fn [x] (Thread/sleep 3000) x))
-(def sometimes-slowly (manipulable-memoize slowly))
-
;; chapter 11
View
@@ -6,7 +6,7 @@
(^int sliceCount []))
(def dumb
- (reify user.ISliceable
+ (reify ISliceable
(slice [_ s e] [:empty])
(sliceCount [_] 42)))
@@ -15,7 +15,7 @@
(sliceCount [this]))
-(extend user.ISliceable
+(extend ISliceable
Sliceable
{:slice (fn [this s e] (.slice this s e))
:sliceCount (fn [this] (.sliceCount this))})
View
@@ -1,5 +1,6 @@
(ns joy.types
- "The example of using deftype from section 9.3.3")
+ "The example of using deftype from section 9.3.3"
+ (:use joy.fixo))
(deftype InfiniteConstant [i]
clojure.lang.ISeq

0 comments on commit 8342756

Please sign in to comment.