A modern dialect of LISP
Functional paradigm
Dynamic typing
Created to run on the Java Virtual Machine
A relatively pure approach
Everything is an expression (data & functions)
Everything is a data structure (a list)
Uses prefix notation
Organise expressions in namespaces (like Java packages)
Clojure is compiled into bytecode before running
ClojureScript in the browser
Clojure on Microsoft CLR
Use OpenJDK or Oracle Java Standard Edition
Check its installed using the command:
javac -version
Leiningen is a build automation tool for Clojure
Download the install script from leiningen.org
Check leiningen is working with the command:
lein help
Clojure is a jar file
Use leiningen to pull it into your projects as a dependency
Clojure has a run time environment called the REPL
Use Leiningen to start a new REPL:
lein repl
Start with some simple expressions
(+ 1 2 3 4) (str "Hello" ", " "Clojure World") (def map-of-me {:name "John" :surname "Stevenson" :age 21 :honesty-rating "poor" :fav-authors ["Douglas Adams" "Terry Pratchett"]}
lein new my-app lein new template my-app
Version a clojure project as with any other language.
Don't version control external libraries, Leiningen takes care of that for you.
Github has a gitignore file for Clojure with Leiningen
– you can specify your own unique name
lein new heroku my-scalable-webapp heroku create unique-subdomain-name
Use Leiningen to run your app
lein run
lein repl (use 'namespace.name)
java -jar my-app.jar <or use maven, gradle, etc.>
Some source code using hightlits.js
(def clojure-devs "love brackets")
git init
I love red.
Hightliht text as a fragment of the slide
Press the "Down" key on the page or the down arrow to trigger fragments
#+ATTR_REVEAL: :frag
* Create
* Fragment
* At Ease
Change slide style to wake up the sleepy audience.