Upgrade to Clojure 1.3.0-alpha1.
This commit is contained in:
parent
8733398e27
commit
fe1f96b8c0
12
README.md
12
README.md
@ -6,12 +6,13 @@
|
|||||||
The only things you need to run the Clojure Koans are:
|
The only things you need to run the Clojure Koans are:
|
||||||
|
|
||||||
- JRE 1.5 or higher
|
- JRE 1.5 or higher
|
||||||
- clojure-1.2.0.jar
|
- clojure-1.3.0-alpha1.jar
|
||||||
|
|
||||||
clojure-1.2.0.jar needs to be placed in a directory `lib` under this project.
|
clojure-1.3.0-alpha1.jar needs to be placed in a directory `lib` under this
|
||||||
|
project.
|
||||||
|
|
||||||
You can use leiningen (http://github.com/technomancy/leiningen) to
|
You can use Leiningen (http://github.com/technomancy/leiningen) to
|
||||||
automatically install the clojure-1.2.0.jar in the right place.
|
automatically install the Clojure jar in the right place.
|
||||||
|
|
||||||
After you have leiningen installed, run
|
After you have leiningen installed, run
|
||||||
|
|
||||||
@ -24,8 +25,9 @@ which will download all dependencies you need to run the clojure koans.
|
|||||||
|
|
||||||
To run the koans, simply run
|
To run the koans, simply run
|
||||||
|
|
||||||
`./run.sh`
|
`run.sh`
|
||||||
|
|
||||||
or, on Windows,
|
or, on Windows,
|
||||||
|
|
||||||
`run.bat`
|
`run.bat`
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
(defproject functional-koans "0.1.0"
|
(defproject functional-koans "0.1.0"
|
||||||
:description "The functional koans"
|
:description "The functional koans"
|
||||||
:dependencies [[org.clojure/clojure "1.2.0"]]
|
:dependencies [[org.clojure/clojure "1.3.0-alpha1"]])
|
||||||
:namespaces [koans])
|
|
||||||
|
2
repl.bat
2
repl.bat
@ -1,2 +1,2 @@
|
|||||||
@echo off
|
@echo off
|
||||||
java -jar lib\clojure-1.2.0.jar
|
java -jar lib\clojure-1.3.0-alpha1.jar
|
||||||
|
2
repl.sh
2
repl.sh
@ -1,2 +1,2 @@
|
|||||||
java -jar lib/clojure-1.2.0.jar
|
java -jar lib/clojure-1.3.0-alpha1.jar
|
||||||
echo
|
echo
|
||||||
|
2
run.bat
2
run.bat
@ -1,2 +1,2 @@
|
|||||||
@echo off
|
@echo off
|
||||||
java -cp lib\clojure-1.2.0.jar;src clojure.main -e "(load \"path_to_enlightenment\")" -e "(do (in-ns 'path-to-enlightenment) (run))"
|
java -cp lib\clojure-1.3.0-alpha1.jar;src clojure.main -e "(load \"path_to_enlightenment\")" -e "(do (in-ns 'path-to-enlightenment) (run))"
|
||||||
|
2
run.sh
2
run.sh
@ -1,2 +1,2 @@
|
|||||||
java -cp lib/clojure-1.2.0.jar:src clojure.main -e '(load "path_to_enlightenment")' -e "(do (in-ns 'path-to-enlightenment) (run))"
|
java -cp lib/clojure-1.3.0-alpha1.jar:src clojure.main -e '(load "path_to_enlightenment")' -e "(do (in-ns 'path-to-enlightenment) (run))"
|
||||||
echo
|
echo
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
(defn raise-to-the-tenth-power [n]
|
(defn multiply-by-ten [n]
|
||||||
(Math/pow n 10))
|
(* 10 n))
|
||||||
|
|
||||||
(meditations
|
(meditations
|
||||||
"Functions are often defined before they are used"
|
"Functions are often defined before they are used"
|
||||||
(= __ (raise-to-the-tenth-power 2))
|
(= __ (multiply-by-ten 2))
|
||||||
|
|
||||||
"But they can also be defined inline"
|
"But they can also be defined inline"
|
||||||
(= __ ((fn [n] (Math/pow n __)) 2))
|
(= __ ((fn [n] (* __ n)) 2))
|
||||||
|
|
||||||
"Or using even shorter syntax"
|
"Or using even shorter syntax"
|
||||||
(= __ (#(Math/pow % 10) __))
|
(= __ (#(* 15 %) __))
|
||||||
|
|
||||||
"One function can beget another"
|
"One function can beget another"
|
||||||
(= __ ((fn []
|
(= __ ((fn []
|
||||||
|
@ -47,9 +47,9 @@
|
|||||||
1 "\"January\""
|
1 "\"January\""
|
||||||
2006 2010 2014
|
2006 2010 2014
|
||||||
"\"Vancouver\""]}
|
"\"Vancouver\""]}
|
||||||
"functions" {"__" [1024
|
"functions" {"__" [20
|
||||||
32 5
|
10 5
|
||||||
1024 2
|
30 2
|
||||||
20 "*"]
|
20 "*"]
|
||||||
"___" ["(fn [f] (f 5))"]}
|
"___" ["(fn [f] (f 5))"]}
|
||||||
"conditionals" {"__" [:a
|
"conditionals" {"__" [:a
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
(ns path-to-enlightenment
|
(ns path-to-enlightenment
|
||||||
(:use clojure.test))
|
(:use [clojure.test])
|
||||||
|
(:require [clojure.set]))
|
||||||
|
|
||||||
(def __ nil)
|
(def __ nil)
|
||||||
(def ___ (fn [& args] nil))
|
(def ___ (fn [& args] nil))
|
||||||
|
2
test.bat
2
test.bat
@ -1,2 +1,2 @@
|
|||||||
@echo off
|
@echo off
|
||||||
java -cp lib\clojure-1.2.0.jar;src clojure.main -e "(load \"path_to_answer_sheet\")" -e "(do (in-ns 'path-to-answer-sheet) (run))"
|
java -cp lib\clojure-1.3.0-alpha1.jar;src clojure.main -e "(load \"path_to_answer_sheet\")" -e "(do (in-ns 'path-to-answer-sheet) (run))"
|
||||||
|
2
test.sh
2
test.sh
@ -1,2 +1,2 @@
|
|||||||
java -cp lib/clojure-1.2.0.jar:src clojure.main -e '(load "path_to_answer_sheet")' -e "(do (in-ns 'path-to-answer-sheet) (run))"
|
java -cp lib/clojure-1.3.0-alpha1.jar:src clojure.main -e '(load "path_to_answer_sheet")' -e "(do (in-ns 'path-to-answer-sheet) (run))"
|
||||||
echo
|
echo
|
||||||
|
Loading…
Reference in New Issue
Block a user