Add Counterclockwise integration
This commit is contained in:
parent
00b7e7c69f
commit
e8b5998a54
24 changed files with 103 additions and 1 deletions
18
.classpath
Normal file
18
.classpath
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="lib" path="/Users/gary/ena/talk/2014-01-18-clojure-full-day/workspace/clojure-koans/target/classes"/>
|
||||
<classpathentry kind="lib" path="/Users/gary/.m2/repository/jline/jline/0.9.94/jline-0.9.94.jar"/>
|
||||
<classpathentry kind="lib" path="/Users/gary/.m2/repository/clj-time/clj-time/0.5.0/clj-time-0.5.0.jar"/>
|
||||
<classpathentry kind="lib" path="/Users/gary/.m2/repository/fresh/fresh/1.0.2/fresh-1.0.2.jar"/>
|
||||
<classpathentry kind="lib" path="/Users/gary/.m2/repository/koan-engine/koan-engine/0.2.0/koan-engine-0.2.0.jar"/>
|
||||
<classpathentry kind="lib" path="/Users/gary/.m2/repository/org/clojure/tools.nrepl/0.2.3/tools.nrepl-0.2.3.jar"/>
|
||||
<classpathentry kind="lib" path="/Users/gary/.m2/repository/spyscope/spyscope/0.1.4/spyscope-0.1.4.jar"/>
|
||||
<classpathentry kind="lib" path="/Users/gary/.m2/repository/org/clojure/clojure/1.5.1/clojure-1.5.1.jar"/>
|
||||
<classpathentry kind="lib" path="/Users/gary/.m2/repository/clojure-complete/clojure-complete/0.2.3/clojure-complete-0.2.3.jar"/>
|
||||
<classpathentry kind="lib" path="/Users/gary/.m2/repository/lein-koan/lein-koan/0.1.2/lein-koan-0.1.2.jar"/>
|
||||
<classpathentry kind="lib" path="/Users/gary/.m2/repository/joda-time/joda-time/2.2/joda-time-2.2.jar"/>
|
||||
<classpathentry kind="src" path="resources"/>
|
||||
<classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
20
.project
Normal file
20
.project
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>clojure-koans</name>
|
||||
<comment>The Clojure koans.</comment>
|
||||
<projects/>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>ccw.builder</name>
|
||||
<arguments/>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments/>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>ccw.nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
@ -5,5 +5,6 @@
|
|||
:dev-dependencies [[lein-koan "0.1.2"]]
|
||||
:profiles {:dev {:dependencies [[lein-koan "0.1.2"]]}}
|
||||
:repl-options {:init-ns user}
|
||||
:plugins [[lein-koan "0.1.2"]]
|
||||
:plugins [[lein-koan "0.1.2"]
|
||||
[lein2-eclipse "2.0.0"]]
|
||||
:main koan-engine.runner/exec)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.01-equalities
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(meditations
|
||||
"We shall contemplate truth by testing reality, via equality"
|
||||
(= __ true)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.02-lists
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(meditations
|
||||
"Lists can be expressed by function or a quoted form"
|
||||
(= '(__ __ __ __ __) (list 1 2 3 4 5))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.03-vectors
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(meditations
|
||||
"You can use vectors in clojure as array-like structures"
|
||||
(= __ (count [42]))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.04-sets
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(meditations
|
||||
"You can create a set by converting another collection"
|
||||
(= #{3} (set __))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.05-maps
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(meditations
|
||||
"Don't get lost when creating a map"
|
||||
(= {:a 1 :b 2} (hash-map :a 1 __ __))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.06-functions
|
||||
(:require (koan-engine [core :refer [meditations __ ___]])))
|
||||
|
||||
(defn multiply-by-ten [n]
|
||||
(* 10 n))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.07-conditionals
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(defn explain-defcon-level [exercise-term]
|
||||
(case exercise-term
|
||||
:fade-out :you-and-what-army
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.08-higher-order-functions
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(meditations
|
||||
"The map function relates a sequence to another"
|
||||
(= [__ __ __] (map (fn [x] (* 4 x)) [1 2 3]))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.09-runtime-polymorphism
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(defn hello
|
||||
([] "Hello World!")
|
||||
([a] (str "Hello, you silly " a "."))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.10-lazy-sequences
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(meditations
|
||||
"There are many ways to generate a sequence"
|
||||
(= __ (range 1 5))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.11-sequence-comprehensions
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(meditations
|
||||
"Sequence comprehensions can bind each element in turn to a symbol"
|
||||
(= __
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.12-creating-functions
|
||||
(:require (koan-engine [core :refer [meditations __ ___]])))
|
||||
|
||||
(defn square [x] (* x x))
|
||||
|
||||
(meditations
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.13-recursion
|
||||
(:require (koan-engine [core :refer [meditations __ ___]])))
|
||||
|
||||
(defn is-even? [n]
|
||||
(if (= n 0)
|
||||
__
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.14-destructuring
|
||||
(:require (koan-engine [core :refer [meditations __ ___]])))
|
||||
|
||||
(def test-address
|
||||
{:street-address "123 Test Lane"
|
||||
:city "Testerville"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.15-refs
|
||||
(:require (koan-engine [core :refer [meditations __ ___]])))
|
||||
|
||||
(def the-world (ref "hello"))
|
||||
(def bizarro-world (ref {}))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.16-atoms
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(def atomic-clock (atom 0))
|
||||
|
||||
(meditations
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.17-macros
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(defmacro hello [x]
|
||||
(str "Hello, " x))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.18-datatypes
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(defrecord Nobel [prize])
|
||||
(deftype Pulitzer [prize])
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.19-java-interop
|
||||
(:require (koan-engine [core :refer [meditations __ ___]])))
|
||||
|
||||
(meditations
|
||||
"You may have done more with Java than you know"
|
||||
(= __ (class "warfare")) ; hint: try typing (javadoc "warfare") in the REPL
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.20-partition
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(meditations
|
||||
"To split a collection you can use the partition function"
|
||||
(= '((0 1) (2 3)) (__ 2 (range 4)))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
(ns koans.21-group-by
|
||||
(:require (koan-engine [core :refer [meditations __]])))
|
||||
|
||||
(defn get-odds-and-evens [coll]
|
||||
(let [{odds true evens false} (group-by __ coll)]
|
||||
[odds evens]))
|
||||
|
|
|
|||
Loading…
Reference in a new issue