lein new training cd training tree cat project.clj cat src/training/core.clj
Integrity is an ecosystem.
Libraries are plain old jars
Clojure is itself a jar
Clojure can make direct use of other jars
Easy to deploy
Leiningen
lein new training cd training tree cat project.clj cat src/training/core.clj
. ├── CHANGELOG.md ├── doc │ └── intro.md ├── LICENSE ├── project.clj ├── README.md ├── resources ├── src │ └── training │ └── core.clj └── test └── training └── core_test.clj
(defproject training "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license
{:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]])
(ns training.core)
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
$ lein repl
We type in an expression:
(+ 1 2)
Clojure returns a result:
=> 3
⇒ means evaluates to |
IntelliJ IDEA + Cursive
Wide range of editor support options
See manual end of section 1
(+ 2 3)
;=> 5
(* 31 79)
;=> 2449
(/ 10 2)
;=> 5
(/ 2 10)
;=> 1/5
(+ 1 2 3)
;=> 6
(println "hello world") ;⇒ "hello world"
(* 5 4 3 2 1)
;=> 120