SlideShare ist ein Scribd-Unternehmen logo
1 von 75
GGeettttiinngg ssttaarrtteedd wwiitthh 
((CClloojjuurree)) 
- or how I learned to stop worrying 
and love the (function)
Its a strange kind of love... 
ī€Š Clojure is very different 
ī€Š Part of your brain may rebel !! 
ī€Š Homo-Iconic 
ī€Š List based 
ī€Š Immutable state 
ī€Š Dynamically typed 
ī€Š Tiny syntax 
ī€Š Infinitely extensible 
with Macros
What is Clojure 
ī€Š Functional programming on the JVM 
ī€Š A better Lisp ?
Why get functional ? 
ī€Š Clock speeds stopped getting faster around 
2005 
ī€Š Cant get around the speed of silicon switches 
ī€Š Moores law still in effect 
ī€Š More cores added every 18 months 
ī€Š Laptops with 128 cores by 2020 ?? 
ī€Š Concurrency at the hardware level 
ī€Š Not just multi-threading
You may end up working 
here...
Why a better Lisp ? 
ī€Š Clojure is easier to understand 
ī€Š Nicer libraries 
ī€Š Great interoperability with Java 
platform 
ī€Š Closer to pure functional 
language 
ī€Š Explicitly define mutable state 
ī€Š STM ā€“ transactional memory
Classic or Re-Imagined 
ī€Š Lisp ī€Š Clojure
Why create Clojure 
ī€Š Concurrency in Java / OO is challenging 
ī€Š Mutable state-full paradigm 
ī€Š Fast enough persistent data structures made it 
viable 
ī€Š Functions as first class 
ī€Š Functions part of data structure 
ī€Š Functions do not have ā€œside effectsā€ 
ī€Š Focus on computation (maths) rather than 
procedural algorithms
Why use Clojure 
ī€Š Its a pure functional programming language 
ī€Š You can use existing Java code and platform 
ī€Š Simple syntax 
ī€Š It gets you thinking differently !!! 
ī€Š An excuse to learn Emacs properly ??
The downside of Clojure 
( x )
The downside of Clojure (2) 
( ( x ) )
The downside of Clojure (3) 
( ( ( x ) ) )
The downside of Clojure (4) 
( ( ( ( x ) ) ) )
The downside of Clojure (...) 
( ( ( ( ( x ) ) ) ) )
Tool support 
ī€Š Emacs 
ī€Š clojure-mode, clojure-test, 
paredit-mode 
ī€Š Netbeans 
ī€Š enclojure 
ī€Š IntelliJ 
ī€Š La Clojure 
ī€Š Eclipse 
ī€Š Counterclockwise 
plugin 
ī€Š Build tools 
ī€Š Leiningen 
ī€Š Emacs + Slime 
ī€Š Cake 
ī€Š Maven
Lets look at Clojure code
We're not in Kansas any 
more... 
ī€Š Java 
package ā€¦ ; 
class ā€¦; 
member variables; 
access retType methodName (param, param) {ā€¦} 
ī€Š Clojure 
(ns name-space-name) 
(defstruct my-data-struture :label-name) 
(functionName param (fn param)) 
; param's can be functions too !!
Its just a tree...
ā€¦ a tree structure 
ī€Š Functions are data 
ī€Š Data structures are functions !!
Download 
ī€Š clojure.org 
ī€Š Or via buld tool 
ī€Š Maven 
ī€Š Leiningen 
ī€Š Cake 
ī€Š Java 
ī€Š At least version 5 
ī€Š Version 6 better 
performance and 
reporting
All hail the REPL 
ī€Š An interactive shell for clojure 
ī€Š Using Leiningen (Line ā€“ ing ā€“ en) 
https://github.com/technomancy/leiningen/ 
lein 
lein repl
Leiningen Clojure project 
lein new 
lein deps 
lein repl 
lein swank 
ī€Š Create a new clojure project 
ī€Š Download clojure 
ī€Š Start the interactive shell 
ī€Š Start repl server for emacs
Leiningen project file 
(defproject my-jax-london-project "1.0.0-SNAPSHOT" 
:description "A meaningful description" 
:dependencies [[org.clojure/clojure "1.2.1"] 
[org.clojure/clojure-contrib "1.2.0"]] 
:dev-dependencies [[swank-clojure "1.2.1"] 
[org.clojars.rayne/autodoc "0.8.0- 
SNAPSHOT"]] 
:autodoc { :name "London Clojure dojo", :page-title "Dojo API"} 
;; Only re-fetch deps when they change in project.clj or when :library-path directory is empty. 
:checksum-deps true 
:license {:name "Eclipse Public License - v 1.0"
Loading code into the REPL 
(load-file "temp.clj") 
ī€Š Stuff too big to type 
ī€Š use an absolute path or a path relative to 
where you launched the REPL 
ī€Š Use Emacs or other IDE when you're ready
Simplest possible examples 
(* 2 2) 
(+ 1 2 3) 
( 24 4 3 2) 
( 2 4) 
( 2.0 4) 
(+ (* 4 5) 22) 
(+ 4 (* 3 2) 7) 
(+ 3 (* 2 (- 7 2) 4) (/ 16 4))
Calling Java... ooooo!! 
(javax.swing.JOptionPane/ 
showMessageDialog nil "Hello World" )
Ratio 
ī€Š Basic data type 
ī€Š Allow delaying computation 
ī€Š Avoid loss of precision 
(/ 2 4) 
(/ 2.0 4) 
(/ 1 3) 
(/ 1.0 3) 
(class (/ 1 3)
Simple function example 
(defn hello-world [name] (println(str "Hello " 
name))) 
(hello-world "jr0cket")
What class is that... 
(class (str "Jr0cket")) 
java.lang.String 
(class (defn hello-world [name] (str "Hello cruel 
world"))) 
clojure.lang.Var
str 
(str h e l l o) ī€Š Concatenate strings 
together 
ī€Š Can represent a 
character using
Booleans / Expressions 
(= 1 1.0) 
(= 1 2) 
(< 1 2) 
ī€Š True is a symbol, but 
also 
user=> (class true) 
java.lang.Boolean 
(if 0 (println ā€œTrueā€)) 
(if nil (println ā€œTrueā€)) 
(if ā€œā€ (println ā€œTrueā€))
More examples 
(last [1 1 2 3 5 8]) 
(defn penultimate [x] 
(last (butlast x)) ) 
(penultimate [1 2 3 4 5]) 
ī€Š (doc last) 
ī€Š (doc butlast)
And more... 
(nth [1 1 2 3 5 8] 2) 
(count [1 1 2 3 5 8]) 
(reverse [1 1 2 3 5 8]) 
(defn palindrome? [x] 
(= x (reverse x)) ) 
ī€Š Proposition ā€“ naming 
convention
Even more 
(flatten [[1 1] 2 [3 [5 8]]]) 
(compress "aaaabccaadeeee") 
(encode "aaaabccaadeeee") 
(replicate 10 "a")
Where to find out more... 
http://clojure.org/cheatsheet 
http://clojure.github.com/cloj 
ure/clojure.core-api.html
Your own functions 
ī€Š Define your own algorithms 
(defn square [x] (* x x))
Anonymous functions 
ī€Š (fn ) (# ) 
(def sqr #(* % %))
Overloading functions 
(defn make 
([ ] ; the make function that takes no arguments 
(struct vector 0 0)) 
([x y] ; ... takes x and y keywords as arguments 
(struct vector x y)) 
)
Pure functions ā€“ no side effects 
ī€Š Clojure functions are pure 
ī€Š they have no side effects 
ī€Š Unless you define them as such 
ī€Š Pure functions are easy to develop, test, and 
understand 
ī€Š Aim for pure functions where possible
Clojure data structures 
ī€Š ( Lists ) - Ordered collection of elements 
ī€Š (list 1 3 5) '(8 13 21) 
ī€Š { map } 
ī€Š 
ī€Š [ Vectors ] - Optimised for random access 
ī€Š [:tom :dick :harry] 
ī€Š Lists are for code, Vectors for data 
ī€Š (nth [:tom :dick :jane :harry ] 2)
List operations 
(first 1 2 3) 
ī€Š The head of the list 
(last 7 8 9) 
ī€Š The last element of the list 
(rest 1 2 3 4 5) 
ī€Š Everything but the head 
(cons :new-list '(1 2 3 4 5)) 
ī€Š New list, given head and tail
More data structures... 
(defstruct date :day :month :year) 
(struct date) 
ī€Š as we did not specify any parameters, we just 
get nil values 
ī€Š things in curly brackets are hash maps - the 
usual Java hashmaps
maps 
ī€Š { :a 1 :b 2} 
ī€Š user=> { :a 1 :b 2} 
ī€Š {:a 1, :b 2} 
ī€Š user=> { :a 1 :b } 
ī€Š java.lang.ArrayIndexOutOfB 
oundsException: 3 
ī€Š user=> { :a 1 :b 2} 
ī€Š {:a 1, :b 2} 
ī€Š user=> { :a 1 :b 3} ; this 
should make the repl 
complain in clojure 1.2, 
fine in 1.1 
ī€Š {:a 1, :b 3} 
ī€Š user=> {:a {:a 1}} 
ī€Š {:a {:a 1}} 
ī€Š user=> {{:a 1} :a} 
ī€Š {{:a 1} :a} 
ī€Š ; idiom - put :a on the left
Vectors 
ī€Š [:neo :morpheus :trinity :smith] 
ī€Š [:matrix-characters [:neo :morpheus :trinity 
:smith]] 
ī€Š (first [:neo :morpheus :trinity :smith]) 
ī€Š (nth [:matrix :babylon5 :firefly :stargate] 2) 
ī€Š (concat [:neo] [:trinity]) 
ī€Š (def my-vector 
ī€Š (vector? x)
Your own data structures 
ī€Š Special forms 
(def johnny {:first-name "John", :last-name 
"Stevenson"}) 
(defstruct person :first-name :last-name) 
(defrecord person [String :first-name String 
:last-name] :allow-nulls false)
Memory use 
ī€Š Once all references to an immutable structure 
disappears it can be garbage collected. 
ī€Š Loops that create intermittent structures are 
garbage collected every turn of the loop. 
;;Memory : 0 
(let [a (range 50000)]) ;; Memory: "big" while 
the let is "executing" 
;;Memory : 0 -- no reference to a anymore !
macros 
ī€Š Define extensions to the language 
ī€Š Clojure only has 7 primitive functions 
ī€Š Everything else in the language is created with 
macros 
ī€Š Allows the language to be extended easily 
without changes to the compiler
Special forms 
ī€Š Recognized by the Clojure compiler and not 
implemented in Clojure source code. 
ī€Š A relatively small number of special forms 
ī€Š New ones cannot be implemented 
ī€Š catch, def, do, dot ('.'), finally, fn, if, let, loop, 
monitor-enter, monitor-exit, new, quote, 
recur, set!, throw, try and var
if 
user=> (doc if) 
------------------------- 
if 
Special Form 
Please see http://clojure.org/special_forms#if 
nil
Sequences 
ī€Š Sequences are logical views of collections 
ī€Š Logical lists 
ī€Š Java collections, Clojure-specific collections, 
strings, streams, directory structures and XML 
trees. 
ī€Š New Clojure collections created efficiently 
ī€Š Creates a sort of branch (delta) in the data 
structure tree
Working with Sequences 
ī€Š first 
ī€Š rest 
ī€Š cons
Software Transactional 
Memory 
ī€Š Works like transactional databases 
ī€Š Provides safe, concurrent access to memory 
ī€Š Agents allow encapsulated access to mutable 
resources
Sharing mutable data 
ī€Š Use mutable references to immutable data 
ī€Š Reference Types 
ī€Š synchronous access to multiple pieces of 
shared data ("coordinated") by using STM 
ī€Š Atoms 
ī€Š synchronous access to a single piece of shared 
data. 
ī€Š Agents 
ī€Š asynchronous access to a single piece of 
shared data
Name-spaces 
ī€Š Define a namespace 
(ns name-space-name) 
ī€Š Include namespace code 
(use 'names-space-name) 
ī€Š Like a package statement in Java
Clojure Libraries 
(use 'clojure.contrib.str-utils) 
' 
ī€Š Dont treat the next thing as a function 
ī€Š Open source libraries - http://clojars.org/
Recursive functions 
ī€Š Functions that call 
themselves 
ī€Š Fractal coding 
ī€Š Tail recursion 
ī€Š Avoids blowing the 
heap 
ī€Š A trick as the JVM 
does not support 
tail recursion 
directly :-(
Tail recursion 
(defn factorial [x] 
(if (= x 0) 
1 
(* x (factorial (- x 1)) 
))) 
ī€Š Dont blow your stack 
!!
TDD with Clojure is nice 
ī€Š Clojure test 
(deftest test-name 
(is (= value (function params))) )
Simple test 
(ns simple-test 
(:use clojure.test) 
(:use simple)) 
(deftest simple-test 
(is (= (hello) "Hello world!")) 
(is (= (hello "test") "Hello test!")))
Working with Java 
ī€Š Java Classes 
ī€Š fullstop after class name 
ī€Š (JFrame. ) 
ī€Š (Math/cos 3) ; static method call 
ī€Š Java methods 
ī€Š fullstop before method name 
ī€Š (.getContentPane frame) ;;method name first 
ī€Š (. frame getContentPane) ;;object first
Importing 
(ns drawing-demo 
(:import [javax.swing JPanel JFrame] 
[java.awt Dimension]))
Working with Java (2) 
ī€Š Clojure gives you clean, simple, direct access 
to Java 
ī€Š call any Java API directly 
ī€Š (System/getProperties) 
ī€Š -> {java.runtime.name=Java(TM) SE Runtime 
Environment
Calling Clojure from Java 
ī€Š Export the clojure to a .jar 
ī€Š Add the jar to the classpath 
ī€Š Import the library in your code 
ī€Š Call it like any other method
Errors are inevitable 
ī€Š In the REPL 
(printStackTrace *e) 
ī€Š *e holds the last exception raised 
ī€Š Clojure exceptions are Java exceptions
Managing State in Immutable 
world 
ī€Š Mutable data structures to share between 
threads (Software Transactional Memory) 
ī€Š refs, vars, atoms, agents 
ī€Š No locks required for thread safe code, no 
deadlocks or race conditions 
ī€Š Atomically apply changes
Mutable functions 
ī€Š Swap! 
ī€Š 
ī€Š Name functions that have side effects with an 
exclamation mark 
ī€Š Naming convention
Deployment 
ī€Š lein jar 
ī€Š lein uberjar
Documentation 
(doc function-name) 
(javadoc class-name) 
(defn function-name 
ā€œA meaningful 
description of the 
functionā€ 
params ) 
ī€Š Show fn description 
ī€Š Show javadoc in 
browser 
ī€Š Write documentation 
for your own 
functions
Example documentation 
(doc str) 
Use doc to print the documentation for str: 
user=> (doc str) 
------------------------- 
clojure.core/str 
([] [x] [x & ys]) 
With no args, returns the empty string. With one 
arg x, returns x.toString(). (str nil) returns 
the empty string. With more than one arg, 
returns the concatenation of the str values 
of the args. 
ī€Š Fully qualified 
namespace 
ī€Š Arguments 
ī€Š Details
find-doc 
(find-doc ā€œreduceā€) 
user=> (find-doc "reduce" ) 
------------------------- 
clojure/areduce 
([a idx ret init expr]) 
Macro 
... details ... 
------------------------- 
clojure/reduce 
([f coll] [f val coll]) 
... details ... 
ī€Š Search for functions 
you dont know 
ī€Š Keyword parameter
Autodoc 
ī€Š Generate a website for your API's 
ī€Š http://tomfaulhaber.github.com/auto 
doc/ 
ī€Š Add dependency to your build file 
ī€Š http://clojars.org/org.clojars.rayne/autodoc 
ī€Š lein deps 
ī€Š lein autodoc
Where next 
ī€Š Coding dojo ā€“ London / start your own 
ī€Š www.londonjavacommunity.co.uk 
ī€Š Books ā€“ Programming Clojure (Pragmatic) 
ī€Š Website ā€“ clojure.org dev.clojure.org 
ī€Š Full Disclojure 
vimeo.com/channels/fulldisclojure 
ī€Š clojure.jr0cket.co.uk 
ī€Š 99 problems in clojure
Credits 
No parentheses 
were harmed in the 
making of this 
presentation....
TThhaannkk yyoouu 
ī€Š HHaavvee ffuunn 
lleeaarrnniinngg !!!! 
JJoohhnn@@jjrr00cckkeett..ccoomm 
@@jjrr00cckkeett 
jjoohhnn..jjrr00cckkeett..ccoo..uukk 
cclloojjuurree..jjrr00cckkeett..ccoo..uukk

Weitere Ƥhnliche Inhalte

Was ist angesagt?

Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneAndres Almiray
Ā 
Java7 New Features and Code Examples
Java7 New Features and Code ExamplesJava7 New Features and Code Examples
Java7 New Features and Code ExamplesNaresh Chintalcheru
Ā 
From Java to Parellel Clojure - Clojure South 2019
From Java to Parellel Clojure - Clojure South 2019From Java to Parellel Clojure - Clojure South 2019
From Java to Parellel Clojure - Clojure South 2019Leonardo Borges
Ā 
JavaOne 2013 - Clojure for Java Developers
JavaOne 2013 - Clojure for Java DevelopersJavaOne 2013 - Clojure for Java Developers
JavaOne 2013 - Clojure for Java DevelopersJan Kronquist
Ā 
Exploring Clojurescript
Exploring ClojurescriptExploring Clojurescript
Exploring ClojurescriptLuke Donnet
Ā 
Advance Java Programs skeleton
Advance Java Programs skeletonAdvance Java Programs skeleton
Advance Java Programs skeletonIram Ramrajkar
Ā 
06 Java Language And OOP Part VI
06 Java Language And OOP Part VI06 Java Language And OOP Part VI
06 Java Language And OOP Part VIHari Christian
Ā 
TclOO: Past Present Future
TclOO: Past Present FutureTclOO: Past Present Future
TclOO: Past Present FutureDonal Fellows
Ā 
Scala coated JVM
Scala coated JVMScala coated JVM
Scala coated JVMStuart Roebuck
Ā 
Adventures in TclOO
Adventures in TclOOAdventures in TclOO
Adventures in TclOODonal Fellows
Ā 
Excuse me, sir, do you have a moment to talk about tests in Kotlin
Excuse me, sir, do you have a moment to talk about tests in KotlinExcuse me, sir, do you have a moment to talk about tests in Kotlin
Excuse me, sir, do you have a moment to talk about tests in Kotlinleonsabr
Ā 
Spock: A Highly Logical Way To Test
Spock: A Highly Logical Way To TestSpock: A Highly Logical Way To Test
Spock: A Highly Logical Way To TestHoward Lewis Ship
Ā 
Kotlin is charming; The reasons Java engineers should start Kotlin.
Kotlin is charming; The reasons Java engineers should start Kotlin.Kotlin is charming; The reasons Java engineers should start Kotlin.
Kotlin is charming; The reasons Java engineers should start Kotlin.JustSystems Corporation
Ā 
Ad java prac sol set
Ad java prac sol setAd java prac sol set
Ad java prac sol setIram Ramrajkar
Ā 
Scala at HUJI PL Seminar 2008
Scala at HUJI PL Seminar 2008Scala at HUJI PL Seminar 2008
Scala at HUJI PL Seminar 2008Yardena Meymann
Ā 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojureAbbas Raza
Ā 
Blocks & GCD
Blocks & GCDBlocks & GCD
Blocks & GCDrsebbe
Ā 
Spock: Test Well and Prosper
Spock: Test Well and ProsperSpock: Test Well and Prosper
Spock: Test Well and ProsperKen Kousen
Ā 

Was ist angesagt? (20)

Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast Lane
Ā 
Java7 New Features and Code Examples
Java7 New Features and Code ExamplesJava7 New Features and Code Examples
Java7 New Features and Code Examples
Ā 
From Java to Parellel Clojure - Clojure South 2019
From Java to Parellel Clojure - Clojure South 2019From Java to Parellel Clojure - Clojure South 2019
From Java to Parellel Clojure - Clojure South 2019
Ā 
JavaOne 2013 - Clojure for Java Developers
JavaOne 2013 - Clojure for Java DevelopersJavaOne 2013 - Clojure for Java Developers
JavaOne 2013 - Clojure for Java Developers
Ā 
Exploring Clojurescript
Exploring ClojurescriptExploring Clojurescript
Exploring Clojurescript
Ā 
Advance Java Programs skeleton
Advance Java Programs skeletonAdvance Java Programs skeleton
Advance Java Programs skeleton
Ā 
06 Java Language And OOP Part VI
06 Java Language And OOP Part VI06 Java Language And OOP Part VI
06 Java Language And OOP Part VI
Ā 
TclOO: Past Present Future
TclOO: Past Present FutureTclOO: Past Present Future
TclOO: Past Present Future
Ā 
Scala coated JVM
Scala coated JVMScala coated JVM
Scala coated JVM
Ā 
Adventures in TclOO
Adventures in TclOOAdventures in TclOO
Adventures in TclOO
Ā 
Excuse me, sir, do you have a moment to talk about tests in Kotlin
Excuse me, sir, do you have a moment to talk about tests in KotlinExcuse me, sir, do you have a moment to talk about tests in Kotlin
Excuse me, sir, do you have a moment to talk about tests in Kotlin
Ā 
Spock: A Highly Logical Way To Test
Spock: A Highly Logical Way To TestSpock: A Highly Logical Way To Test
Spock: A Highly Logical Way To Test
Ā 
Kotlin is charming; The reasons Java engineers should start Kotlin.
Kotlin is charming; The reasons Java engineers should start Kotlin.Kotlin is charming; The reasons Java engineers should start Kotlin.
Kotlin is charming; The reasons Java engineers should start Kotlin.
Ā 
Ad java prac sol set
Ad java prac sol setAd java prac sol set
Ad java prac sol set
Ā 
Scala at HUJI PL Seminar 2008
Scala at HUJI PL Seminar 2008Scala at HUJI PL Seminar 2008
Scala at HUJI PL Seminar 2008
Ā 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
Ā 
Clojure: a LISP for the JVM
Clojure: a LISP for the JVMClojure: a LISP for the JVM
Clojure: a LISP for the JVM
Ā 
Java 7 New Features
Java 7 New FeaturesJava 7 New Features
Java 7 New Features
Ā 
Blocks & GCD
Blocks & GCDBlocks & GCD
Blocks & GCD
Ā 
Spock: Test Well and Prosper
Spock: Test Well and ProsperSpock: Test Well and Prosper
Spock: Test Well and Prosper
Ā 

Andere mochten auch

Clojure: an overview
Clojure: an overviewClojure: an overview
Clojure: an overviewLarry Diehl
Ā 
Clojure: The Art of Abstraction
Clojure: The Art of AbstractionClojure: The Art of Abstraction
Clojure: The Art of AbstractionAlex Miller
Ā 
DSL in Clojure
DSL in ClojureDSL in Clojure
DSL in ClojureMisha Kozik
Ā 
Functional programming in clojure
Functional programming in clojureFunctional programming in clojure
Functional programming in clojureJuan-Manuel Gimeno
Ā 
Clojure, Web and Luminus
Clojure, Web and LuminusClojure, Web and Luminus
Clojure, Web and LuminusEdward Tsech
Ā 
Yet another startup built on Clojure(Script)
Yet another startup built on Clojure(Script)Yet another startup built on Clojure(Script)
Yet another startup built on Clojure(Script)Paul Lam
Ā 
Intro to Java 8 Closures (Dainius Mezanskas)
Intro to Java 8 Closures (Dainius Mezanskas)Intro to Java 8 Closures (Dainius Mezanskas)
Intro to Java 8 Closures (Dainius Mezanskas)Kaunas Java User Group
Ā 
Clojure at BackType
Clojure at BackTypeClojure at BackType
Clojure at BackTypenathanmarz
Ā 
Writing DSL in Clojure
Writing DSL in ClojureWriting DSL in Clojure
Writing DSL in ClojureMisha Kozik
Ā 
Functional Reactive Programming in Clojurescript
Functional Reactive Programming in ClojurescriptFunctional Reactive Programming in Clojurescript
Functional Reactive Programming in ClojurescriptLeonardo Borges
Ā 
EPUB3ć§å¤‰ć‚ć‚‹é›»å­ę›øē±ć®č”Øē¾åŠ›
EPUB3ć§å¤‰ć‚ć‚‹é›»å­ę›øē±ć®č”Øē¾åŠ› EPUB3ć§å¤‰ć‚ć‚‹é›»å­ę›øē±ć®č”Øē¾åŠ›
EPUB3ć§å¤‰ć‚ć‚‹é›»å­ę›øē±ć®č”Øē¾åŠ› Youji Sakai
Ā 
JS Lab`16. Š Š¾Š¼Š°Š½ Š›ŃŽŃ‚ŠøŠŗŠ¾Š²: "ClojureScript, чтŠ¾ ты тŠ°ŠŗŠ¾Šµ?"
JS Lab`16. Š Š¾Š¼Š°Š½ Š›ŃŽŃ‚ŠøŠŗŠ¾Š²: "ClojureScript, чтŠ¾ ты тŠ°ŠŗŠ¾Šµ?"JS Lab`16. Š Š¾Š¼Š°Š½ Š›ŃŽŃ‚ŠøŠŗŠ¾Š²: "ClojureScript, чтŠ¾ ты тŠ°ŠŗŠ¾Šµ?"
JS Lab`16. Š Š¾Š¼Š°Š½ Š›ŃŽŃ‚ŠøŠŗŠ¾Š²: "ClojureScript, чтŠ¾ ты тŠ°ŠŗŠ¾Šµ?"GeeksLab Odessa
Ā 
HTML5ģ™€ ģ „ģžģ±…, ģœµķ•© ģ„œė¹„ģŠ¤ė”œ ė°œģ „ ķ˜„ķ™©
HTML5ģ™€ ģ „ģžģ±…, ģœµķ•© ģ„œė¹„ģŠ¤ė”œ ė°œģ „ ķ˜„ķ™©HTML5ģ™€ ģ „ģžģ±…, ģœµķ•© ģ„œė¹„ģŠ¤ė”œ ė°œģ „ ķ˜„ķ™©
HTML5ģ™€ ģ „ģžģ±…, ģœµķ•© ģ„œė¹„ģŠ¤ė”œ ė°œģ „ ķ˜„ķ™©Open Cyber University of Korea
Ā 
DITA, HTML5, and EPUB3 (Content Agility, June 2013)
DITA, HTML5, and EPUB3 (Content Agility, June 2013)DITA, HTML5, and EPUB3 (Content Agility, June 2013)
DITA, HTML5, and EPUB3 (Content Agility, June 2013)Contrext Solutions
Ā 
EPUB3 Now! at IDPF 2013 Digital Book
EPUB3 Now! at IDPF 2013 Digital BookEPUB3 Now! at IDPF 2013 Digital Book
EPUB3 Now! at IDPF 2013 Digital Bookliz_castro
Ā 
Winning the Erlang Editā€¢Buildā€¢Test Cycle
Winning the Erlang Editā€¢Buildā€¢Test CycleWinning the Erlang Editā€¢Buildā€¢Test Cycle
Winning the Erlang Editā€¢Buildā€¢Test CycleRusty Klophaus
Ā 
Messaging With Erlang And Jabber
Messaging With  Erlang And  JabberMessaging With  Erlang And  Jabber
Messaging With Erlang And Jabberl xf
Ā 
20 reasons why we don't need architects (@pavlobaron)
20 reasons why we don't need architects (@pavlobaron)20 reasons why we don't need architects (@pavlobaron)
20 reasons why we don't need architects (@pavlobaron)Pavlo Baron
Ā 

Andere mochten auch (20)

Clojure: an overview
Clojure: an overviewClojure: an overview
Clojure: an overview
Ā 
Clojure: The Art of Abstraction
Clojure: The Art of AbstractionClojure: The Art of Abstraction
Clojure: The Art of Abstraction
Ā 
DSL in Clojure
DSL in ClojureDSL in Clojure
DSL in Clojure
Ā 
Functional programming in clojure
Functional programming in clojureFunctional programming in clojure
Functional programming in clojure
Ā 
Clojure, Web and Luminus
Clojure, Web and LuminusClojure, Web and Luminus
Clojure, Web and Luminus
Ā 
Yet another startup built on Clojure(Script)
Yet another startup built on Clojure(Script)Yet another startup built on Clojure(Script)
Yet another startup built on Clojure(Script)
Ā 
Intro to Java 8 Closures (Dainius Mezanskas)
Intro to Java 8 Closures (Dainius Mezanskas)Intro to Java 8 Closures (Dainius Mezanskas)
Intro to Java 8 Closures (Dainius Mezanskas)
Ā 
Clojure at BackType
Clojure at BackTypeClojure at BackType
Clojure at BackType
Ā 
Writing DSL in Clojure
Writing DSL in ClojureWriting DSL in Clojure
Writing DSL in Clojure
Ā 
ETL in Clojure
ETL in ClojureETL in Clojure
ETL in Clojure
Ā 
Functional Reactive Programming in Clojurescript
Functional Reactive Programming in ClojurescriptFunctional Reactive Programming in Clojurescript
Functional Reactive Programming in Clojurescript
Ā 
EPUB3ć§å¤‰ć‚ć‚‹é›»å­ę›øē±ć®č”Øē¾åŠ›
EPUB3ć§å¤‰ć‚ć‚‹é›»å­ę›øē±ć®č”Øē¾åŠ› EPUB3ć§å¤‰ć‚ć‚‹é›»å­ę›øē±ć®č”Øē¾åŠ›
EPUB3ć§å¤‰ć‚ć‚‹é›»å­ę›øē±ć®č”Øē¾åŠ›
Ā 
JS Lab`16. Š Š¾Š¼Š°Š½ Š›ŃŽŃ‚ŠøŠŗŠ¾Š²: "ClojureScript, чтŠ¾ ты тŠ°ŠŗŠ¾Šµ?"
JS Lab`16. Š Š¾Š¼Š°Š½ Š›ŃŽŃ‚ŠøŠŗŠ¾Š²: "ClojureScript, чтŠ¾ ты тŠ°ŠŗŠ¾Šµ?"JS Lab`16. Š Š¾Š¼Š°Š½ Š›ŃŽŃ‚ŠøŠŗŠ¾Š²: "ClojureScript, чтŠ¾ ты тŠ°ŠŗŠ¾Šµ?"
JS Lab`16. Š Š¾Š¼Š°Š½ Š›ŃŽŃ‚ŠøŠŗŠ¾Š²: "ClojureScript, чтŠ¾ ты тŠ°ŠŗŠ¾Šµ?"
Ā 
HTML5ģ™€ ģ „ģžģ±…, ģœµķ•© ģ„œė¹„ģŠ¤ė”œ ė°œģ „ ķ˜„ķ™©
HTML5ģ™€ ģ „ģžģ±…, ģœµķ•© ģ„œė¹„ģŠ¤ė”œ ė°œģ „ ķ˜„ķ™©HTML5ģ™€ ģ „ģžģ±…, ģœµķ•© ģ„œė¹„ģŠ¤ė”œ ė°œģ „ ķ˜„ķ™©
HTML5ģ™€ ģ „ģžģ±…, ģœµķ•© ģ„œė¹„ģŠ¤ė”œ ė°œģ „ ķ˜„ķ™©
Ā 
DITA, HTML5, and EPUB3 (Content Agility, June 2013)
DITA, HTML5, and EPUB3 (Content Agility, June 2013)DITA, HTML5, and EPUB3 (Content Agility, June 2013)
DITA, HTML5, and EPUB3 (Content Agility, June 2013)
Ā 
EPUB3 Now! at IDPF 2013 Digital Book
EPUB3 Now! at IDPF 2013 Digital BookEPUB3 Now! at IDPF 2013 Digital Book
EPUB3 Now! at IDPF 2013 Digital Book
Ā 
Winning the Erlang Editā€¢Buildā€¢Test Cycle
Winning the Erlang Editā€¢Buildā€¢Test CycleWinning the Erlang Editā€¢Buildā€¢Test Cycle
Winning the Erlang Editā€¢Buildā€¢Test Cycle
Ā 
Messaging With Erlang And Jabber
Messaging With  Erlang And  JabberMessaging With  Erlang And  Jabber
Messaging With Erlang And Jabber
Ā 
Clojure class
Clojure classClojure class
Clojure class
Ā 
20 reasons why we don't need architects (@pavlobaron)
20 reasons why we don't need architects (@pavlobaron)20 reasons why we don't need architects (@pavlobaron)
20 reasons why we don't need architects (@pavlobaron)
Ā 

Ƅhnlich wie Getting started with Clojure

Clojure 1.1 And Beyond
Clojure 1.1 And BeyondClojure 1.1 And Beyond
Clojure 1.1 And BeyondMike Fogus
Ā 
Pune Clojure Course Outline
Pune Clojure Course OutlinePune Clojure Course Outline
Pune Clojure Course OutlineBaishampayan Ghose
Ā 
A Survey of Concurrency Constructs
A Survey of Concurrency ConstructsA Survey of Concurrency Constructs
A Survey of Concurrency ConstructsTed Leung
Ā 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lispelliando dias
Ā 
ClojureScript for the web
ClojureScript for the webClojureScript for the web
ClojureScript for the webMichiel Borkent
Ā 
55j7
55j755j7
55j7swein2
Ā 
Introductory Clojure Presentation
Introductory Clojure PresentationIntroductory Clojure Presentation
Introductory Clojure PresentationJay Victoria
Ā 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And SwingSkills Matter
Ā 
Lobos Introduction
Lobos IntroductionLobos Introduction
Lobos IntroductionNicolas Buduroi
Ā 
Presentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStackPresentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStackDavid Sanchez
Ā 
Clojure intro
Clojure introClojure intro
Clojure introBasav Nagur
Ā 
Enter The Matrix
Enter The MatrixEnter The Matrix
Enter The MatrixMike Anderson
Ā 
A Taste of Clojure
A Taste of ClojureA Taste of Clojure
A Taste of ClojureDavid Leung
Ā 
Clojure made simple - Lightning talk
Clojure made simple - Lightning talkClojure made simple - Lightning talk
Clojure made simple - Lightning talkJohn Stevenson
Ā 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevMattias Karlsson
Ā 
Clojure made really really simple
Clojure made really really simpleClojure made really really simple
Clojure made really really simpleJohn Stevenson
Ā 
Š›ŠµŠ¾Š½ŠøŠ“ ŠØŠµŠ²Ń†Š¾Š² Ā«Clojure Š² Š“ŠµŠ»ŠµĀ»
Š›ŠµŠ¾Š½ŠøŠ“ ŠØŠµŠ²Ń†Š¾Š² Ā«Clojure Š² Š“ŠµŠ»ŠµĀ»Š›ŠµŠ¾Š½ŠøŠ“ ŠØŠµŠ²Ń†Š¾Š² Ā«Clojure Š² Š“ŠµŠ»ŠµĀ»
Š›ŠµŠ¾Š½ŠøŠ“ ŠØŠµŠ²Ń†Š¾Š² Ā«Clojure Š² Š“ŠµŠ»ŠµĀ»DataArt
Ā 
Concurrency Constructs Overview
Concurrency Constructs OverviewConcurrency Constructs Overview
Concurrency Constructs Overviewstasimus
Ā 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Martin Odersky
Ā 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojureelliando dias
Ā 

Ƅhnlich wie Getting started with Clojure (20)

Clojure 1.1 And Beyond
Clojure 1.1 And BeyondClojure 1.1 And Beyond
Clojure 1.1 And Beyond
Ā 
Pune Clojure Course Outline
Pune Clojure Course OutlinePune Clojure Course Outline
Pune Clojure Course Outline
Ā 
A Survey of Concurrency Constructs
A Survey of Concurrency ConstructsA Survey of Concurrency Constructs
A Survey of Concurrency Constructs
Ā 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lisp
Ā 
ClojureScript for the web
ClojureScript for the webClojureScript for the web
ClojureScript for the web
Ā 
55j7
55j755j7
55j7
Ā 
Introductory Clojure Presentation
Introductory Clojure PresentationIntroductory Clojure Presentation
Introductory Clojure Presentation
Ā 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
Ā 
Lobos Introduction
Lobos IntroductionLobos Introduction
Lobos Introduction
Ā 
Presentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStackPresentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStack
Ā 
Clojure intro
Clojure introClojure intro
Clojure intro
Ā 
Enter The Matrix
Enter The MatrixEnter The Matrix
Enter The Matrix
Ā 
A Taste of Clojure
A Taste of ClojureA Taste of Clojure
A Taste of Clojure
Ā 
Clojure made simple - Lightning talk
Clojure made simple - Lightning talkClojure made simple - Lightning talk
Clojure made simple - Lightning talk
Ā 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
Ā 
Clojure made really really simple
Clojure made really really simpleClojure made really really simple
Clojure made really really simple
Ā 
Š›ŠµŠ¾Š½ŠøŠ“ ŠØŠµŠ²Ń†Š¾Š² Ā«Clojure Š² Š“ŠµŠ»ŠµĀ»
Š›ŠµŠ¾Š½ŠøŠ“ ŠØŠµŠ²Ń†Š¾Š² Ā«Clojure Š² Š“ŠµŠ»ŠµĀ»Š›ŠµŠ¾Š½ŠøŠ“ ŠØŠµŠ²Ń†Š¾Š² Ā«Clojure Š² Š“ŠµŠ»ŠµĀ»
Š›ŠµŠ¾Š½ŠøŠ“ ŠØŠµŠ²Ń†Š¾Š² Ā«Clojure Š² Š“ŠµŠ»ŠµĀ»
Ā 
Concurrency Constructs Overview
Concurrency Constructs OverviewConcurrency Constructs Overview
Concurrency Constructs Overview
Ā 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009
Ā 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
Ā 

Mehr von John Stevenson

ClojureX Conference 2017 - 10 amazing years of Clojure
ClojureX Conference 2017 - 10 amazing years of ClojureClojureX Conference 2017 - 10 amazing years of Clojure
ClojureX Conference 2017 - 10 amazing years of ClojureJohn Stevenson
Ā 
Confessions of a developer community builder
Confessions of a developer community builderConfessions of a developer community builder
Confessions of a developer community builderJohn Stevenson
Ā 
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in ClojurescriptProgscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in ClojurescriptJohn Stevenson
Ā 
Introduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with ClojurescriptIntroduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with ClojurescriptJohn Stevenson
Ā 
Thinking Functionally with Clojure
Thinking Functionally with ClojureThinking Functionally with Clojure
Thinking Functionally with ClojureJohn Stevenson
Ā 
Communication improbable
Communication improbableCommunication improbable
Communication improbableJohn Stevenson
Ā 
Getting into public speaking at conferences
Getting into public speaking at conferencesGetting into public speaking at conferences
Getting into public speaking at conferencesJohn Stevenson
Ā 
Functional web with clojure
Functional web with clojureFunctional web with clojure
Functional web with clojureJohn Stevenson
Ā 
Get into Functional Programming with Clojure
Get into Functional Programming with ClojureGet into Functional Programming with Clojure
Get into Functional Programming with ClojureJohn Stevenson
Ā 
Guiding people into Clojure
Guiding people into ClojureGuiding people into Clojure
Guiding people into ClojureJohn Stevenson
Ā 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperJohn Stevenson
Ā 
Get Functional Programming with Clojure
Get Functional Programming with ClojureGet Functional Programming with Clojure
Get Functional Programming with ClojureJohn Stevenson
Ā 
So you want to run a developer event, are you crazy?
So you want to run a developer event, are you crazy?So you want to run a developer event, are you crazy?
So you want to run a developer event, are you crazy?John Stevenson
Ā 
Trailhead live - Overview of Salesforce App Cloud
Trailhead live - Overview of Salesforce App CloudTrailhead live - Overview of Salesforce App Cloud
Trailhead live - Overview of Salesforce App CloudJohn Stevenson
Ā 
Introducing the Salesforce platform
Introducing the Salesforce platformIntroducing the Salesforce platform
Introducing the Salesforce platformJohn Stevenson
Ā 
Dreamforce14 Metadata Management with Git Version Control
Dreamforce14 Metadata Management with Git Version ControlDreamforce14 Metadata Management with Git Version Control
Dreamforce14 Metadata Management with Git Version ControlJohn Stevenson
Ā 
Salesforce Summer of Hacks London - Introduction
Salesforce Summer of Hacks London - IntroductionSalesforce Summer of Hacks London - Introduction
Salesforce Summer of Hacks London - IntroductionJohn Stevenson
Ā 
Heroku Introduction: Scaling customer facing apps & services
Heroku Introduction: Scaling customer facing apps & servicesHeroku Introduction: Scaling customer facing apps & services
Heroku Introduction: Scaling customer facing apps & servicesJohn Stevenson
Ā 
Developers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformDevelopers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformJohn Stevenson
Ā 
Developer week EMEA - Salesforce1 Mobile App overview
Developer week EMEA - Salesforce1 Mobile App overviewDeveloper week EMEA - Salesforce1 Mobile App overview
Developer week EMEA - Salesforce1 Mobile App overviewJohn Stevenson
Ā 

Mehr von John Stevenson (20)

ClojureX Conference 2017 - 10 amazing years of Clojure
ClojureX Conference 2017 - 10 amazing years of ClojureClojureX Conference 2017 - 10 amazing years of Clojure
ClojureX Conference 2017 - 10 amazing years of Clojure
Ā 
Confessions of a developer community builder
Confessions of a developer community builderConfessions of a developer community builder
Confessions of a developer community builder
Ā 
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in ClojurescriptProgscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Ā 
Introduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with ClojurescriptIntroduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with Clojurescript
Ā 
Thinking Functionally with Clojure
Thinking Functionally with ClojureThinking Functionally with Clojure
Thinking Functionally with Clojure
Ā 
Communication improbable
Communication improbableCommunication improbable
Communication improbable
Ā 
Getting into public speaking at conferences
Getting into public speaking at conferencesGetting into public speaking at conferences
Getting into public speaking at conferences
Ā 
Functional web with clojure
Functional web with clojureFunctional web with clojure
Functional web with clojure
Ā 
Get into Functional Programming with Clojure
Get into Functional Programming with ClojureGet into Functional Programming with Clojure
Get into Functional Programming with Clojure
Ā 
Guiding people into Clojure
Guiding people into ClojureGuiding people into Clojure
Guiding people into Clojure
Ā 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern Developer
Ā 
Get Functional Programming with Clojure
Get Functional Programming with ClojureGet Functional Programming with Clojure
Get Functional Programming with Clojure
Ā 
So you want to run a developer event, are you crazy?
So you want to run a developer event, are you crazy?So you want to run a developer event, are you crazy?
So you want to run a developer event, are you crazy?
Ā 
Trailhead live - Overview of Salesforce App Cloud
Trailhead live - Overview of Salesforce App CloudTrailhead live - Overview of Salesforce App Cloud
Trailhead live - Overview of Salesforce App Cloud
Ā 
Introducing the Salesforce platform
Introducing the Salesforce platformIntroducing the Salesforce platform
Introducing the Salesforce platform
Ā 
Dreamforce14 Metadata Management with Git Version Control
Dreamforce14 Metadata Management with Git Version ControlDreamforce14 Metadata Management with Git Version Control
Dreamforce14 Metadata Management with Git Version Control
Ā 
Salesforce Summer of Hacks London - Introduction
Salesforce Summer of Hacks London - IntroductionSalesforce Summer of Hacks London - Introduction
Salesforce Summer of Hacks London - Introduction
Ā 
Heroku Introduction: Scaling customer facing apps & services
Heroku Introduction: Scaling customer facing apps & servicesHeroku Introduction: Scaling customer facing apps & services
Heroku Introduction: Scaling customer facing apps & services
Ā 
Developers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformDevelopers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 Platform
Ā 
Developer week EMEA - Salesforce1 Mobile App overview
Developer week EMEA - Salesforce1 Mobile App overviewDeveloper week EMEA - Salesforce1 Mobile App overview
Developer week EMEA - Salesforce1 Mobile App overview
Ā 

KĆ¼rzlich hochgeladen

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
Ā 
FULL ENJOY šŸ” 8264348440 šŸ” Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY šŸ” 8264348440 šŸ” Call Girls in Diplomatic Enclave | DelhiFULL ENJOY šŸ” 8264348440 šŸ” Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY šŸ” 8264348440 šŸ” Call Girls in Diplomatic Enclave | Delhisoniya singh
Ā 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
Ā 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
Ā 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
Ā 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
Ā 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
Ā 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
Ā 
Scaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationScaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationRadu Cotescu
Ā 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
Ā 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
Ā 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
Ā 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
Ā 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
Ā 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
Ā 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
Ā 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
Ā 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
Ā 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
Ā 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
Ā 

KĆ¼rzlich hochgeladen (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
Ā 
FULL ENJOY šŸ” 8264348440 šŸ” Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY šŸ” 8264348440 šŸ” Call Girls in Diplomatic Enclave | DelhiFULL ENJOY šŸ” 8264348440 šŸ” Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY šŸ” 8264348440 šŸ” Call Girls in Diplomatic Enclave | Delhi
Ā 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
Ā 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Ā 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Ā 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Ā 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Ā 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
Ā 
Scaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationScaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organization
Ā 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Ā 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Ā 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
Ā 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Ā 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
Ā 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Ā 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Ā 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
Ā 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Ā 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Ā 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
Ā 

Getting started with Clojure

  • 1. GGeettttiinngg ssttaarrtteedd wwiitthh ((CClloojjuurree)) - or how I learned to stop worrying and love the (function)
  • 2. Its a strange kind of love... ī€Š Clojure is very different ī€Š Part of your brain may rebel !! ī€Š Homo-Iconic ī€Š List based ī€Š Immutable state ī€Š Dynamically typed ī€Š Tiny syntax ī€Š Infinitely extensible with Macros
  • 3. What is Clojure ī€Š Functional programming on the JVM ī€Š A better Lisp ?
  • 4. Why get functional ? ī€Š Clock speeds stopped getting faster around 2005 ī€Š Cant get around the speed of silicon switches ī€Š Moores law still in effect ī€Š More cores added every 18 months ī€Š Laptops with 128 cores by 2020 ?? ī€Š Concurrency at the hardware level ī€Š Not just multi-threading
  • 5. You may end up working here...
  • 6. Why a better Lisp ? ī€Š Clojure is easier to understand ī€Š Nicer libraries ī€Š Great interoperability with Java platform ī€Š Closer to pure functional language ī€Š Explicitly define mutable state ī€Š STM ā€“ transactional memory
  • 7. Classic or Re-Imagined ī€Š Lisp ī€Š Clojure
  • 8. Why create Clojure ī€Š Concurrency in Java / OO is challenging ī€Š Mutable state-full paradigm ī€Š Fast enough persistent data structures made it viable ī€Š Functions as first class ī€Š Functions part of data structure ī€Š Functions do not have ā€œside effectsā€ ī€Š Focus on computation (maths) rather than procedural algorithms
  • 9. Why use Clojure ī€Š Its a pure functional programming language ī€Š You can use existing Java code and platform ī€Š Simple syntax ī€Š It gets you thinking differently !!! ī€Š An excuse to learn Emacs properly ??
  • 10. The downside of Clojure ( x )
  • 11. The downside of Clojure (2) ( ( x ) )
  • 12. The downside of Clojure (3) ( ( ( x ) ) )
  • 13. The downside of Clojure (4) ( ( ( ( x ) ) ) )
  • 14. The downside of Clojure (...) ( ( ( ( ( x ) ) ) ) )
  • 15. Tool support ī€Š Emacs ī€Š clojure-mode, clojure-test, paredit-mode ī€Š Netbeans ī€Š enclojure ī€Š IntelliJ ī€Š La Clojure ī€Š Eclipse ī€Š Counterclockwise plugin ī€Š Build tools ī€Š Leiningen ī€Š Emacs + Slime ī€Š Cake ī€Š Maven
  • 16. Lets look at Clojure code
  • 17.
  • 18. We're not in Kansas any more... ī€Š Java package ā€¦ ; class ā€¦; member variables; access retType methodName (param, param) {ā€¦} ī€Š Clojure (ns name-space-name) (defstruct my-data-struture :label-name) (functionName param (fn param)) ; param's can be functions too !!
  • 19. Its just a tree...
  • 20. ā€¦ a tree structure ī€Š Functions are data ī€Š Data structures are functions !!
  • 21. Download ī€Š clojure.org ī€Š Or via buld tool ī€Š Maven ī€Š Leiningen ī€Š Cake ī€Š Java ī€Š At least version 5 ī€Š Version 6 better performance and reporting
  • 22. All hail the REPL ī€Š An interactive shell for clojure ī€Š Using Leiningen (Line ā€“ ing ā€“ en) https://github.com/technomancy/leiningen/ lein lein repl
  • 23. Leiningen Clojure project lein new lein deps lein repl lein swank ī€Š Create a new clojure project ī€Š Download clojure ī€Š Start the interactive shell ī€Š Start repl server for emacs
  • 24. Leiningen project file (defproject my-jax-london-project "1.0.0-SNAPSHOT" :description "A meaningful description" :dependencies [[org.clojure/clojure "1.2.1"] [org.clojure/clojure-contrib "1.2.0"]] :dev-dependencies [[swank-clojure "1.2.1"] [org.clojars.rayne/autodoc "0.8.0- SNAPSHOT"]] :autodoc { :name "London Clojure dojo", :page-title "Dojo API"} ;; Only re-fetch deps when they change in project.clj or when :library-path directory is empty. :checksum-deps true :license {:name "Eclipse Public License - v 1.0"
  • 25. Loading code into the REPL (load-file "temp.clj") ī€Š Stuff too big to type ī€Š use an absolute path or a path relative to where you launched the REPL ī€Š Use Emacs or other IDE when you're ready
  • 26. Simplest possible examples (* 2 2) (+ 1 2 3) ( 24 4 3 2) ( 2 4) ( 2.0 4) (+ (* 4 5) 22) (+ 4 (* 3 2) 7) (+ 3 (* 2 (- 7 2) 4) (/ 16 4))
  • 27. Calling Java... ooooo!! (javax.swing.JOptionPane/ showMessageDialog nil "Hello World" )
  • 28. Ratio ī€Š Basic data type ī€Š Allow delaying computation ī€Š Avoid loss of precision (/ 2 4) (/ 2.0 4) (/ 1 3) (/ 1.0 3) (class (/ 1 3)
  • 29. Simple function example (defn hello-world [name] (println(str "Hello " name))) (hello-world "jr0cket")
  • 30. What class is that... (class (str "Jr0cket")) java.lang.String (class (defn hello-world [name] (str "Hello cruel world"))) clojure.lang.Var
  • 31. str (str h e l l o) ī€Š Concatenate strings together ī€Š Can represent a character using
  • 32. Booleans / Expressions (= 1 1.0) (= 1 2) (< 1 2) ī€Š True is a symbol, but also user=> (class true) java.lang.Boolean (if 0 (println ā€œTrueā€)) (if nil (println ā€œTrueā€)) (if ā€œā€ (println ā€œTrueā€))
  • 33. More examples (last [1 1 2 3 5 8]) (defn penultimate [x] (last (butlast x)) ) (penultimate [1 2 3 4 5]) ī€Š (doc last) ī€Š (doc butlast)
  • 34. And more... (nth [1 1 2 3 5 8] 2) (count [1 1 2 3 5 8]) (reverse [1 1 2 3 5 8]) (defn palindrome? [x] (= x (reverse x)) ) ī€Š Proposition ā€“ naming convention
  • 35. Even more (flatten [[1 1] 2 [3 [5 8]]]) (compress "aaaabccaadeeee") (encode "aaaabccaadeeee") (replicate 10 "a")
  • 36. Where to find out more... http://clojure.org/cheatsheet http://clojure.github.com/cloj ure/clojure.core-api.html
  • 37. Your own functions ī€Š Define your own algorithms (defn square [x] (* x x))
  • 38. Anonymous functions ī€Š (fn ) (# ) (def sqr #(* % %))
  • 39. Overloading functions (defn make ([ ] ; the make function that takes no arguments (struct vector 0 0)) ([x y] ; ... takes x and y keywords as arguments (struct vector x y)) )
  • 40. Pure functions ā€“ no side effects ī€Š Clojure functions are pure ī€Š they have no side effects ī€Š Unless you define them as such ī€Š Pure functions are easy to develop, test, and understand ī€Š Aim for pure functions where possible
  • 41. Clojure data structures ī€Š ( Lists ) - Ordered collection of elements ī€Š (list 1 3 5) '(8 13 21) ī€Š { map } ī€Š ī€Š [ Vectors ] - Optimised for random access ī€Š [:tom :dick :harry] ī€Š Lists are for code, Vectors for data ī€Š (nth [:tom :dick :jane :harry ] 2)
  • 42. List operations (first 1 2 3) ī€Š The head of the list (last 7 8 9) ī€Š The last element of the list (rest 1 2 3 4 5) ī€Š Everything but the head (cons :new-list '(1 2 3 4 5)) ī€Š New list, given head and tail
  • 43. More data structures... (defstruct date :day :month :year) (struct date) ī€Š as we did not specify any parameters, we just get nil values ī€Š things in curly brackets are hash maps - the usual Java hashmaps
  • 44. maps ī€Š { :a 1 :b 2} ī€Š user=> { :a 1 :b 2} ī€Š {:a 1, :b 2} ī€Š user=> { :a 1 :b } ī€Š java.lang.ArrayIndexOutOfB oundsException: 3 ī€Š user=> { :a 1 :b 2} ī€Š {:a 1, :b 2} ī€Š user=> { :a 1 :b 3} ; this should make the repl complain in clojure 1.2, fine in 1.1 ī€Š {:a 1, :b 3} ī€Š user=> {:a {:a 1}} ī€Š {:a {:a 1}} ī€Š user=> {{:a 1} :a} ī€Š {{:a 1} :a} ī€Š ; idiom - put :a on the left
  • 45. Vectors ī€Š [:neo :morpheus :trinity :smith] ī€Š [:matrix-characters [:neo :morpheus :trinity :smith]] ī€Š (first [:neo :morpheus :trinity :smith]) ī€Š (nth [:matrix :babylon5 :firefly :stargate] 2) ī€Š (concat [:neo] [:trinity]) ī€Š (def my-vector ī€Š (vector? x)
  • 46. Your own data structures ī€Š Special forms (def johnny {:first-name "John", :last-name "Stevenson"}) (defstruct person :first-name :last-name) (defrecord person [String :first-name String :last-name] :allow-nulls false)
  • 47. Memory use ī€Š Once all references to an immutable structure disappears it can be garbage collected. ī€Š Loops that create intermittent structures are garbage collected every turn of the loop. ;;Memory : 0 (let [a (range 50000)]) ;; Memory: "big" while the let is "executing" ;;Memory : 0 -- no reference to a anymore !
  • 48. macros ī€Š Define extensions to the language ī€Š Clojure only has 7 primitive functions ī€Š Everything else in the language is created with macros ī€Š Allows the language to be extended easily without changes to the compiler
  • 49. Special forms ī€Š Recognized by the Clojure compiler and not implemented in Clojure source code. ī€Š A relatively small number of special forms ī€Š New ones cannot be implemented ī€Š catch, def, do, dot ('.'), finally, fn, if, let, loop, monitor-enter, monitor-exit, new, quote, recur, set!, throw, try and var
  • 50. if user=> (doc if) ------------------------- if Special Form Please see http://clojure.org/special_forms#if nil
  • 51. Sequences ī€Š Sequences are logical views of collections ī€Š Logical lists ī€Š Java collections, Clojure-specific collections, strings, streams, directory structures and XML trees. ī€Š New Clojure collections created efficiently ī€Š Creates a sort of branch (delta) in the data structure tree
  • 52. Working with Sequences ī€Š first ī€Š rest ī€Š cons
  • 53. Software Transactional Memory ī€Š Works like transactional databases ī€Š Provides safe, concurrent access to memory ī€Š Agents allow encapsulated access to mutable resources
  • 54. Sharing mutable data ī€Š Use mutable references to immutable data ī€Š Reference Types ī€Š synchronous access to multiple pieces of shared data ("coordinated") by using STM ī€Š Atoms ī€Š synchronous access to a single piece of shared data. ī€Š Agents ī€Š asynchronous access to a single piece of shared data
  • 55. Name-spaces ī€Š Define a namespace (ns name-space-name) ī€Š Include namespace code (use 'names-space-name) ī€Š Like a package statement in Java
  • 56. Clojure Libraries (use 'clojure.contrib.str-utils) ' ī€Š Dont treat the next thing as a function ī€Š Open source libraries - http://clojars.org/
  • 57. Recursive functions ī€Š Functions that call themselves ī€Š Fractal coding ī€Š Tail recursion ī€Š Avoids blowing the heap ī€Š A trick as the JVM does not support tail recursion directly :-(
  • 58. Tail recursion (defn factorial [x] (if (= x 0) 1 (* x (factorial (- x 1)) ))) ī€Š Dont blow your stack !!
  • 59. TDD with Clojure is nice ī€Š Clojure test (deftest test-name (is (= value (function params))) )
  • 60. Simple test (ns simple-test (:use clojure.test) (:use simple)) (deftest simple-test (is (= (hello) "Hello world!")) (is (= (hello "test") "Hello test!")))
  • 61. Working with Java ī€Š Java Classes ī€Š fullstop after class name ī€Š (JFrame. ) ī€Š (Math/cos 3) ; static method call ī€Š Java methods ī€Š fullstop before method name ī€Š (.getContentPane frame) ;;method name first ī€Š (. frame getContentPane) ;;object first
  • 62. Importing (ns drawing-demo (:import [javax.swing JPanel JFrame] [java.awt Dimension]))
  • 63. Working with Java (2) ī€Š Clojure gives you clean, simple, direct access to Java ī€Š call any Java API directly ī€Š (System/getProperties) ī€Š -> {java.runtime.name=Java(TM) SE Runtime Environment
  • 64. Calling Clojure from Java ī€Š Export the clojure to a .jar ī€Š Add the jar to the classpath ī€Š Import the library in your code ī€Š Call it like any other method
  • 65. Errors are inevitable ī€Š In the REPL (printStackTrace *e) ī€Š *e holds the last exception raised ī€Š Clojure exceptions are Java exceptions
  • 66. Managing State in Immutable world ī€Š Mutable data structures to share between threads (Software Transactional Memory) ī€Š refs, vars, atoms, agents ī€Š No locks required for thread safe code, no deadlocks or race conditions ī€Š Atomically apply changes
  • 67. Mutable functions ī€Š Swap! ī€Š ī€Š Name functions that have side effects with an exclamation mark ī€Š Naming convention
  • 68. Deployment ī€Š lein jar ī€Š lein uberjar
  • 69. Documentation (doc function-name) (javadoc class-name) (defn function-name ā€œA meaningful description of the functionā€ params ) ī€Š Show fn description ī€Š Show javadoc in browser ī€Š Write documentation for your own functions
  • 70. Example documentation (doc str) Use doc to print the documentation for str: user=> (doc str) ------------------------- clojure.core/str ([] [x] [x & ys]) With no args, returns the empty string. With one arg x, returns x.toString(). (str nil) returns the empty string. With more than one arg, returns the concatenation of the str values of the args. ī€Š Fully qualified namespace ī€Š Arguments ī€Š Details
  • 71. find-doc (find-doc ā€œreduceā€) user=> (find-doc "reduce" ) ------------------------- clojure/areduce ([a idx ret init expr]) Macro ... details ... ------------------------- clojure/reduce ([f coll] [f val coll]) ... details ... ī€Š Search for functions you dont know ī€Š Keyword parameter
  • 72. Autodoc ī€Š Generate a website for your API's ī€Š http://tomfaulhaber.github.com/auto doc/ ī€Š Add dependency to your build file ī€Š http://clojars.org/org.clojars.rayne/autodoc ī€Š lein deps ī€Š lein autodoc
  • 73. Where next ī€Š Coding dojo ā€“ London / start your own ī€Š www.londonjavacommunity.co.uk ī€Š Books ā€“ Programming Clojure (Pragmatic) ī€Š Website ā€“ clojure.org dev.clojure.org ī€Š Full Disclojure vimeo.com/channels/fulldisclojure ī€Š clojure.jr0cket.co.uk ī€Š 99 problems in clojure
  • 74. Credits No parentheses were harmed in the making of this presentation....
  • 75. TThhaannkk yyoouu ī€Š HHaavvee ffuunn lleeaarrnniinngg !!!! JJoohhnn@@jjrr00cckkeett..ccoomm @@jjrr00cckkeett jjoohhnn..jjrr00cckkeett..ccoo..uukk cclloojjuurree..jjrr00cckkeett..ccoo..uukk

Hinweis der Redaktion

  1. Clojure has a programmatic macro system which allows the compiler to be extended by user code You can add your own language features with macros. Clojure itself is built out of macros such as defstruct: (defstruct person :first-name :last-name) If you need different semantics, write your own macro. If you want a variant of structs with strong typing and configurable null-checking for all fields, you can create your own defrecord macro, to be used like this: (defrecord person [String :first-name String :last-name] :allow-nulls false) This ability to reprogram the language from within the language is the unique advantage of Lisp. You will see facets of this idea described in various ways: Lisp is homoiconic - Lisp code is just Lisp data. This makes it easy for programs to write other programs. The whole language is there, all the time. Paul Grahamā€™s essay ā€œRevenge of the Nerdsā€ explains why this is so powerful. http://www.paulgraham.com/icad.html Lisp syntax also eliminates rules for operator precedence and associativity, with fully parenthesized expressions, there is no possible ambiguity
  2. Hickey&amp;apos;s primary interest was concurrency ā€” he wanted the ability to write multi-threaded applications, but increasingly found the mutable, stateful paradigm of object oriented programming to be part of the problem The idea of a functional Lisp integrated with a commercially accepted host platform just seemed like chocolate and peanut butter. Coming up with persistent data structures that were fast enough was the tipping point for my considering it viable. functions as first-class objects, meaning that functions can be placed into data structures, passed as arguments to other functions, evaluated in comparisons, even returned as the return value of another function. Moreover, functions do not have &amp;quot;side effects&amp;quot; ā€” the ability to modify program state or data. This paradigm focuses on computation in the mathematical sense, rather than procedural algorithms, and is a completely different approach to programming. Clojure does provide persistent data structures For application developers, the most significant distinction is that Clojure defaults to making all data structures immutable developers must use one of four special mutable structures that are explicitly designed to be shared between threads: refs, vars, atoms, and agents. Clojure uses software transactional memory (STM) to coordinate changing these mutable structures while keeping them in a consistent state, much like a transactional database. This model makes it considerably simpler to write thread-safe code than it is in object oriented languages. No locks are required, therefore there are no deadlocks or race conditions.
  3. Throw away your knowledge about OO and try something different
  4. The downside of Lispā€™s simple, regular syntax, at least for beginners, is Lispā€™s fixation on parentheses and on lists as the core data type. Clojure offers an interesting combination of features that makes Lisp more approachable for non-Lispers.
  5. The downside of Lispā€™s simple, regular syntax, at least for beginners, is Lispā€™s fixation on parentheses and on lists as the core data type. Clojure offers an interesting combination of features that makes Lisp more approachable for non-Lispers.
  6. The downside of Lispā€™s simple, regular syntax, at least for beginners, is Lispā€™s fixation on parentheses and on lists as the core data type. Clojure offers an interesting combination of features that makes Lisp more approachable for non-Lispers.
  7. The downside of Lispā€™s simple, regular syntax, at least for beginners, is Lispā€™s fixation on parentheses and on lists as the core data type. Clojure offers an interesting combination of features that makes Lisp more approachable for non-Lispers.
  8. The downside of Lispā€™s simple, regular syntax, at least for beginners, is Lispā€™s fixation on parentheses and on lists as the core data type. Clojure offers an interesting combination of features that makes Lisp more approachable for non-Lispers.
  9. Note: prefix notation
  10. What are the 7 primitive functions?
  11. When you require a library named clojure.contrib.str-utils, Clojure looks for a file named clojure/contrib/str-utils.clj on the CLASSPATH To avoid having to use the namespace for your library, you have to use refer, like so - (refer &amp;apos;examples/introduction) The use function does both require refer, like so ā€“ (use &amp;apos;examples.introduction) o force a library to reload: (use :reload-all &amp;apos;examples.introduction) The :reload-all flag is useful if you are making changes and want to see results without restarting the REPL.
  12. This is barfing because the evaluator has to keep around state for each call due to the expression (* x (factorial (- x 1))) . We need to make this function tail recursive. recur can be thought of as the Clojure operator for looping. Think of it like a function call for the nearest enclosing let or function definition supplied with new variables. Naively we can switch over to using this by doing: user&amp;gt; (defn factorial2 [x] (if (= x 0) 1 (* x (recur (- x 1))))) But this is a compile-time error (which in itself is pretty neat!). java.lang.UnsupportedOperationException: Can only recur from tail position (NO_SOURCE_FILE:4) An accumulator parameter is an extra parameter to a function that&amp;apos;s used to gather intermediate parts of the calculation. If we do this, we can make sure that the recur call is in the tail position. Using an anonymous function we get: (defn factorial3 [x] ((fn [x y] (if (= x 0) y (recur (- x 1) (* x y)))) x 1)) Now when recur is used, it doesn&amp;apos;t need to keep any of the previous stack frame around. This means we can finally calculate factorial 1000000, which begins with 282 and ends with lots of zeros!
  13. Use doc to print the documentation for str: user=&amp;gt; (doc str) ------------------------- clojure.core/str ([] [x] [x &amp; ys]) With no args, returns the empty string. With one arg x, returns x.toString(). (str nil) returns the empty string. With more than one arg, returns the concatenation of the str values of the args. The first line of docā€™s output contains the fully qualified name of the function. The next line contains the possible argument lists, generated directly from the code. (Some common argument names and their uses are explained in the sidebar on the following page.) Finally, the remaining lines contain the functionā€™s doc-string, if the function definition included one.