Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 130 lines (82 sloc) 3.878 kb
6115be0 @trptcolin Props to Aaron, Relevance, EdgeCase, and contributors.
trptcolin authored
1 # Clojure Koans
2
3 The Clojure Koans are a fun and easy way to get started with Clojure - no
4 experience assumed or required. Just follow the instructions below to start
5 making tests pass!
49e460a @abedra starting... lots of work to do
abedra authored
6
ae98548 @trptcolin provide link to clojure jar & add wording about necessary lib location
trptcolin authored
7
49e460a @abedra starting... lots of work to do
abedra authored
8 ### Getting Started
9
00f5fa0 @trptcolin removing unused dependencies & adding script runners
trptcolin authored
10 The only things you need to run the Clojure Koans are:
11
12 - JRE 1.5 or higher
26c702f @trptcolin Provide clickable links in README.
trptcolin authored
13 - [clojure-1.3.0-alpha3.jar](https://github.com/downloads/clojure/clojure/clojure-1.3.0-alpha3.zip)
ae98548 @trptcolin provide link to clojure jar & add wording about necessary lib location
trptcolin authored
14
7aa2271 @trptcolin Update README for 1.3.0-alpha3.
trptcolin authored
15 clojure-1.3.0-alpha3.jar needs to be placed in a directory `lib` under this
fe1f96b @trptcolin Upgrade to Clojure 1.3.0-alpha1.
trptcolin authored
16 project.
00f5fa0 @trptcolin removing unused dependencies & adding script runners
trptcolin authored
17
26c702f @trptcolin Provide clickable links in README.
trptcolin authored
18 You can use [Leiningen](http://github.com/technomancy/leiningen) to
fa9b517 @trptcolin Make launchers more resilient to Clojure version changes.
trptcolin authored
19 automatically install the Clojure jar in the right place. Leiningen will also
20 get you a couple more jarfiles, including JLine, which allows you some of the
21 functionality of readline (command-line history, for example).
00f5fa0 @trptcolin removing unused dependencies & adding script runners
trptcolin authored
22
ae98548 @trptcolin provide link to clojure jar & add wording about necessary lib location
trptcolin authored
23 After you have leiningen installed, run
49e460a @abedra starting... lots of work to do
abedra authored
24
25 `lein deps`
26
5fd564b @trptcolin Improve first-steps explanation.
trptcolin authored
27 which will download all dependencies you need to run the Clojure koans.
49e460a @abedra starting... lots of work to do
abedra authored
28
ae98548 @trptcolin provide link to clojure jar & add wording about necessary lib location
trptcolin authored
29
49e460a @abedra starting... lots of work to do
abedra authored
30 ### Running The Koans
31
32 To run the koans, simply run
33
baecf7e @trptcolin Move scripts into their own directory.
trptcolin authored
34 `script/run` on Mac/\*nix
00f5fa0 @trptcolin removing unused dependencies & adding script runners
trptcolin authored
35
baecf7e @trptcolin Move scripts into their own directory.
trptcolin authored
36 `script\run` on Windows
fe1f96b @trptcolin Upgrade to Clojure 1.3.0-alpha1.
trptcolin authored
37
5fd564b @trptcolin Improve first-steps explanation.
trptcolin authored
38 You'll see something like this:
39
40 FAIL in clojure.lang.PersistentList$EmptyList@1 (equalities.clj:1)
41 We shall contemplate truth by testing reality, via equality.
42 expected: (= __ true)
43 actual: (not (= nil true))
44
45 The output is telling you that you have a failing test in equalities.clj.
46 So open that file up and make it pass! In general, you just fill in the
47 blanks to make tests pass. Sometimes there are several (or even an infinite
48 number) of correct answers: any of them will work in these cases.
49
50 The koans differ from normal TDD in that the tests are already written for you,
51 so you'll have to pay close attention to the failure messages, because up until
52 the very end, making a test pass just means that the next failure message comes
53 up.
54
55 While it's very easy (especially at first) to just fill in the blanks making
56 things pass, you should work slowly, making sure you understand why the answer
57 is what it is. Enjoy your path to Clojure enlightenment!
6115be0 @trptcolin Props to Aaron, Relevance, EdgeCase, and contributors.
trptcolin authored
58
8b596c3 @trptcolin Notes on contributing.
trptcolin authored
59
498e003 @trptcolin Introduce the REPL.
trptcolin authored
60 ### Trying more things out
61
62 There's a REPL (Read-Evaluate-Print Loop) included in the Clojure Koans. Just
63 run:
64
65 `script/repl` on Mac/\*nix
66
67 `script\repl` on Windows
68
69 Here are some interesting commands you might try, once you're in a running REPL:
70
71 (find-doc "vec")
72 (find-doc #"vec$")
73 (doc vec)
74
75 And if those still don't make sense:
76
77 (doc doc)
78 (doc find-doc)
79
80 will show you what those commands mean.
81
82 You can exit the REPL with `CTRL-d` on any OS.
83
84
8b596c3 @trptcolin Notes on contributing.
trptcolin authored
85 ### Contributing
86
736e106 @trptcolin Update contributing section.
trptcolin authored
87 Patches are encouraged! Make sure the answer sheet still passes (`script/test`,
88 or `script\test` on Windows), and send a pull request.
8b596c3 @trptcolin Notes on contributing.
trptcolin authored
89
736e106 @trptcolin Update contributing section.
trptcolin authored
90 The file ideaboard.txt has lots of good places to start. In general, patches are
91 easiest if you start on a brand new idea, unless there are obvious flaws or
92 omissions for existing koans.
8b596c3 @trptcolin Notes on contributing.
trptcolin authored
93
94
6115be0 @trptcolin Props to Aaron, Relevance, EdgeCase, and contributors.
trptcolin authored
95 ### Contributors (in order of appearance)
96
97 - Aaron Bedra
98 - Colin Jones
99 - Eric Lavigne
100 - Nuno Marquez
4c74b1b @trptcolin Add Micah to the contributor list & fix a couple typos.
trptcolin authored
101 - Micah Martin
a0a8677 @trptcolin Update contributors list.
trptcolin authored
102 - Michael Kohl
9ed1868 @trptcolin Update contributors list.
trptcolin authored
103 - Ben Lickly
9c947e7 @trptcolin Update contributors list.
trptcolin authored
104 - Alex Robbins
3e4d2ca @trptcolin Update contributors list and ideaboard.
trptcolin authored
105 - Jaskirat Singh Veen
106
6115be0 @trptcolin Props to Aaron, Relevance, EdgeCase, and contributors.
trptcolin authored
107
108
109 ### Credits
110
111 These exercises were started by [Aaron Bedra](http://github.com/abedra) of
112 [Relevance, Inc.](http://github.com/relevance) in early 2010, as a learning
113 tool for newcomers to functional programming. Aaron's macro-fu makes these
b289405 @trptcolin Finish incomplete sentence.
trptcolin authored
114 koans extremely simple and fun to use, and to improve upon, and without
115 Relevance's initiative, this project would not exist.
6115be0 @trptcolin Props to Aaron, Relevance, EdgeCase, and contributors.
trptcolin authored
116
117 Using the [koans](http://en.wikipedia.org/wiki/koan) metaphor as a tool for
118 learning a programming language started with the
119 [Ruby Koans](http://rubykoans.com) by [EdgeCase](http://github.com/edgecase).
120
775e79b @trptcolin Include Eclipse license v10 (same as Clojure itself).
trptcolin authored
121
122 ### License
123
124 The use and distribution terms for this software are covered by the
125 Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
126 which can be found in the file epl-v10.html at the root of this distribution.
127 By using this software in any fashion, you are agreeing to be bound by
128 the terms of this license.
129
Something went wrong with that request. Please try again.