Skip to content
Browse files

updated test scripts

placeholder to force classes directory
udpated jar dependencies
  • Loading branch information...
1 parent 1678b9b commit c3525ed135a9cce0de50106f2f7b6a66a18a884c @stuarthalloway stuarthalloway committed Feb 14, 2009
View
2 .gitignore
@@ -5,4 +5,4 @@
/snippet-db.properties
/snippet-db.script
/tmp.clj
-classes
+
View
12 README
@@ -5,7 +5,7 @@ Copyright 2008 Stuart Halloway.
All rights reserved.
-------------------------------------------------------------------------------
-API CHANGES SINCE BETA 5 OF THE BOOK:
+API CHANGES FROM BETA 5 TO BETA 6 OF THE BOOK:
clojure.contrib.sql:
* with-query is now with-query-results, query passed as vector
@@ -15,13 +15,13 @@ DEPENDENCIES
This version of the sample code has been tested with:
-Clojure SVN revision 1232
-svn co -r 1232 http://clojure.googlecode.com/svn/trunk/ clojure
+Clojure SVN revision 1279
+svn co -r 1279 http://clojure.googlecode.com/svn/trunk/ clojure
-Clojure-Contrib SVN revision 411:
-svn co -r 411 http://clojure-contrib.googlecode.com/svn/trunk/ clojure-contrib
+Clojure-Contrib SVN revision 459:
+svn co -r 459 http://clojure-contrib.googlecode.com/svn/trunk/ clojure-contrib
-Compojure GIT commit 13f5eb0
+Compojure GIT commit 0c8eff9
-------------------------------------------------------------------------------
You can run the completed Compojure example with
View
1 bin/runtests.bat
@@ -0,0 +1 @@
+java -Xmx1G -cp lib/clojure.jar;lib/clojure-contrib.jar;lib/hsqldb.jar;lib/ant.jar;lib/ant-launcher.jar;. clojure.lang.Script examples/test.clj
View
0 runtests.sh → bin/runtests.sh
File renamed without changes.
View
1 classes/.gitignore
@@ -0,0 +1 @@
+**/*.class
View
5 examples/functional.clj
@@ -139,10 +139,7 @@
; START: curry
; almost a curry
-(defn curry [f]
- (fn [& front]
- (fn [& back]
- (apply f (concat front back)))))
+(defn faux-curry [& args] (apply partial partial args))
; END: curry
; --------------------------------------------------------------------------------------
View
3 examples/interop.clj
@@ -1,6 +1,7 @@
(ns examples.interop)
; START:sum-to
+; performance demo only, don't write code like this
(defn sum-to [n]
(loop [i 1 sum 0]
(if (<= i n)
@@ -28,7 +29,7 @@
(defn better-sum-to [n]
(reduce + (range 1 (inc n))))
-
+
(defn best-sum-to [n]
(/ (* n (inc n)) 2))
; TODO: a better timer?
View
5 examples/test/functional.clj
@@ -25,6 +25,11 @@
(deftest test-head-fibo
(is (= ten-fibs (take 10 head-fibo))))
+(deftest test-faux-curry
+ (is (fn? (faux-curry + 1)))
+ (is (fn? ((faux-curry + 1) 1)))
+ (is (= 2 (((faux-curry + 1) 1)))))
+
(deftest test-count-heads-pairs
(doseq [count-fn [count-heads-loop count-heads-by-pairs count-heads-by-runs]]
(are (= _1 _2)
View
BIN lib/clojure-contrib.jar
Binary file not shown.
View
BIN lib/clojure.jar
Binary file not shown.
View
BIN lib/compojure.jar
Binary file not shown.

0 comments on commit c3525ed

Please sign in to comment.
Something went wrong with that request. Please try again.