SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
Clojure
● LISP on the JVM
● Dynamic
● Started in 2007 by Rich Hickey
● 3 years of planning
● Current version - 1.6.0
● Eclipse license
Defining Features
● LISP syntax but not Common LISP or Scheme
– Macros
● Immutability
● Functional
● JVM based
– Java interop
– Not OOP
● Supports Concurrency
Syntax
● Numbers: 1234, 1.234, 1.234M
● Ratios: 22/7
● Strings: “foo”, “bar”, Characters: a b c
● Symbols: foo, bar, Keywords: :foo, :bar
● Boolean: true, false, Null: nil
● Regex Patterns: #”a*b”
Data Structures
● Lists – singly linked, grow at front:
– (1 2 3 4)
● Vectors – indexed, grow at end:
– [1 2 3 4]
● Maps – key/value associations:
– {:a 1 :b 2 :c 3}
● Sets: #{:a :b :c}
● Everything nests inside each other
Syntax
● That's the entire syntax
● Data strcuture are the code (Homoiconicity)
● All data literals stand for themselves except:
– Lists (IFn invocation)
– Symbols (“pointers”)
Lists as Invocations Example
● (+ 1 1) => 2
● (+ 1 2 (+ 3 4 5)) => 15
● (first [:a :b :c]) => :a
● (rest [:a :b :c]) => (:b :c)
● (class “foo”) => java.lang.String
● (class 1) => java.long.Long
Persistent Data Structures
● All Clojure data structures are persistent
● Collections maintain performance guarantees:
– New + Old version of collections are available after
change
– New versions are not full copies
– Thread safe, iteration safe
● Sequences replace traditional lists
– All Clojure and Java collections can be made into
seqs
Persistent Data Structure
Performance
● O(log32 N) ~= O(1)
A
B C
D E F G
H I J K L M N'
A’
C’
G’
N
Seq General Macros
● All seqs, which means all lists, vectors, hash-
maps, hash-sets, strings etc. can use the multi
purpose seq macros. A kind of polymorphism
over collections.
(def xs [:a :b :c])
– (first xs) => :a , (rest xs) => (:b :c)
– (count xs) => 3 , (contains? xs :d) => false
– (remove #(= % :b) xs) => (:a :c)
– (nth xs 2) => :c
Laziness
● Seqs can be lazy
– (repeat :a) => (:a :a :a :a :a …)
● Processing is delayed until the seq is realized:
– (class (repeat :a)) => clojure.lang.LazySeq
● Realize part of a lazy seq:
– (take 3 (repeat :a)) => (:a :a :a)
Philosophy
● Use libraries instead of frameworks
● REPL first development
– Small and isolated functions
● Data structures instead of classes
DEMO
Java Interop
● (.toLowerCase “AppsFlyer”) => “appsflyer”
– (.<method> <object> [<arg1> …])
● (Foo. “bar”) => #<Foo bar>
– (<class>. [<constrcutor arg1>...])
● (Integer/parseInt “5”) => 5
– (<class>/<static method> [<arg1>...])
● (.contains “AppsFlyer FTW” “FTW”) => true
Concurrency
● Clojure uses STM – no locks in the code
– Multiversion Concurrency Control (MVCC)
– Readers never impede writers and writers never impeded
readers
● 3 primitive containers to store mutable data – atom, ref,
agent
– Refs – coordinated-sync access to many identities
– Atoms – Uncoordinated-sync access to a single identity
– Agents – Uncoordinated-async access to a single identity
So Much More...
● Metadata
● Optimized tail recursion
● Destructuring binding in let/fn/loop
● List comprehensions
● Multimethods
● Parallel computations
● Macros

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
shimi_k
 
Lisp for Python Programmers
Lisp for Python ProgrammersLisp for Python Programmers
Lisp for Python Programmers
Vsevolod Dyomkin
 

Was ist angesagt? (20)

2013 05 ny
2013 05 ny2013 05 ny
2013 05 ny
 
Frontend application architecture, patterns, and workflows
Frontend application architecture, patterns, and workflowsFrontend application architecture, patterns, and workflows
Frontend application architecture, patterns, and workflows
 
JDK8 Functional API
JDK8 Functional APIJDK8 Functional API
JDK8 Functional API
 
Java JVM Memory Cheat Sheet
Java JVM Memory Cheat SheetJava JVM Memory Cheat Sheet
Java JVM Memory Cheat Sheet
 
Towards hasktorch 1.0
Towards hasktorch 1.0Towards hasktorch 1.0
Towards hasktorch 1.0
 
scala-gopher: async implementation of CSP for scala
scala-gopher:  async implementation of CSP  for  scalascala-gopher:  async implementation of CSP  for  scala
scala-gopher: async implementation of CSP for scala
 
Clojure/conj 2017
Clojure/conj 2017Clojure/conj 2017
Clojure/conj 2017
 
SE 20016 - programming languages landscape.
SE 20016 - programming languages landscape.SE 20016 - programming languages landscape.
SE 20016 - programming languages landscape.
 
Modern frontend in react.js
Modern frontend in react.jsModern frontend in react.js
Modern frontend in react.js
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
 
Lisp for Python Programmers
Lisp for Python ProgrammersLisp for Python Programmers
Lisp for Python Programmers
 
Xanadu - Java Chapter Meeting
Xanadu - Java Chapter Meeting Xanadu - Java Chapter Meeting
Xanadu - Java Chapter Meeting
 
Csp scala wixmeetup2016
Csp scala wixmeetup2016Csp scala wixmeetup2016
Csp scala wixmeetup2016
 
Meet the-other-elephant
Meet the-other-elephantMeet the-other-elephant
Meet the-other-elephant
 
Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015
 
Onyx
OnyxOnyx
Onyx
 
MathML: onde estamos?
MathML: onde estamos?MathML: onde estamos?
MathML: onde estamos?
 
Incremental Development with Lisp: Building a Game and a Website
Incremental Development with Lisp: Building a Game and a WebsiteIncremental Development with Lisp: Building a Game and a Website
Incremental Development with Lisp: Building a Game and a Website
 
Coding convention
Coding conventionCoding convention
Coding convention
 
DB reading group may 16, 2018
DB reading group may 16, 2018DB reading group may 16, 2018
DB reading group may 16, 2018
 

Ähnlich wie Clojure - LISP on the JVM

Clojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp ProgrammersClojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp Programmers
elliando dias
 
Design and Implementation of the Security Graph Language
Design and Implementation of the Security Graph LanguageDesign and Implementation of the Security Graph Language
Design and Implementation of the Security Graph Language
Asankhaya Sharma
 
An Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional ParadigmsAn Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional Paradigms
Miles Sabin
 
Rust All Hands Winter 2011
Rust All Hands Winter 2011Rust All Hands Winter 2011
Rust All Hands Winter 2011
Patrick Walton
 
From Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn IntroductionFrom Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn Introduction
elliando dias
 

Ähnlich wie Clojure - LISP on the JVM (20)

Clojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp ProgrammersClojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp Programmers
 
Design and Implementation of the Security Graph Language
Design and Implementation of the Security Graph LanguageDesign and Implementation of the Security Graph Language
Design and Implementation of the Security Graph Language
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
 
Thorny Path to the Large Scale Graph Processing, Алексей Зиновьев (Тамтэк)
Thorny Path to the Large Scale Graph Processing, Алексей Зиновьев (Тамтэк)Thorny Path to the Large Scale Graph Processing, Алексей Зиновьев (Тамтэк)
Thorny Path to the Large Scale Graph Processing, Алексей Зиновьев (Тамтэк)
 
Thorny path to the Large-Scale Graph Processing (Highload++, 2014)
Thorny path to the Large-Scale Graph Processing (Highload++, 2014)Thorny path to the Large-Scale Graph Processing (Highload++, 2014)
Thorny path to the Large-Scale Graph Processing (Highload++, 2014)
 
An Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional ParadigmsAn Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional Paradigms
 
A brief introduction to lisp language
A brief introduction to lisp languageA brief introduction to lisp language
A brief introduction to lisp language
 
Rust All Hands Winter 2011
Rust All Hands Winter 2011Rust All Hands Winter 2011
Rust All Hands Winter 2011
 
MATLAB Programming
MATLAB Programming MATLAB Programming
MATLAB Programming
 
R programmingmilano
R programmingmilanoR programmingmilano
R programmingmilano
 
MatlabIntro (1).ppt
MatlabIntro (1).pptMatlabIntro (1).ppt
MatlabIntro (1).ppt
 
From Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn IntroductionFrom Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn Introduction
 
Matlab lec1
Matlab lec1Matlab lec1
Matlab lec1
 
Java 8
Java 8Java 8
Java 8
 
Short intro to scala and the play framework
Short intro to scala and the play frameworkShort intro to scala and the play framework
Short intro to scala and the play framework
 
Pune Clojure Course Outline
Pune Clojure Course OutlinePune Clojure Course Outline
Pune Clojure Course Outline
 
HPC Essentials 0
HPC Essentials 0HPC Essentials 0
HPC Essentials 0
 
ClojureScript for the web
ClojureScript for the webClojureScript for the web
ClojureScript for the web
 
CNIT 127 Ch 2: Stack overflows on Linux
CNIT 127 Ch 2: Stack overflows on LinuxCNIT 127 Ch 2: Stack overflows on Linux
CNIT 127 Ch 2: Stack overflows on Linux
 
Stripe CTF3 wrap-up
Stripe CTF3 wrap-upStripe CTF3 wrap-up
Stripe CTF3 wrap-up
 

Mehr von Tikal Knowledge

Processing Big Data in Realtime
Processing Big Data in RealtimeProcessing Big Data in Realtime
Processing Big Data in Realtime
Tikal Knowledge
 
Docking your services_with_docker
Docking your services_with_dockerDocking your services_with_docker
Docking your services_with_docker
Tikal Knowledge
 
Tikal Fuse Day Access Layer Implementation (C#) Based On Mongo Db
Tikal Fuse Day   Access Layer Implementation (C#) Based On Mongo DbTikal Fuse Day   Access Layer Implementation (C#) Based On Mongo Db
Tikal Fuse Day Access Layer Implementation (C#) Based On Mongo Db
Tikal Knowledge
 
Introduction To Cloud Computing
Introduction To Cloud ComputingIntroduction To Cloud Computing
Introduction To Cloud Computing
Tikal Knowledge
 

Mehr von Tikal Knowledge (20)

Tabtale story: Building a publishing and monitoring mobile games architecture...
Tabtale story: Building a publishing and monitoring mobile games architecture...Tabtale story: Building a publishing and monitoring mobile games architecture...
Tabtale story: Building a publishing and monitoring mobile games architecture...
 
Kafka short
Kafka shortKafka short
Kafka short
 
Heatmap
HeatmapHeatmap
Heatmap
 
Processing Big Data in Realtime
Processing Big Data in RealtimeProcessing Big Data in Realtime
Processing Big Data in Realtime
 
Docking your services_with_docker
Docking your services_with_dockerDocking your services_with_docker
Docking your services_with_docker
 
Who moved my_box
Who moved my_boxWho moved my_box
Who moved my_box
 
Writing a Fullstack Application with Javascript - Remote media player
Writing a Fullstack Application with Javascript - Remote media playerWriting a Fullstack Application with Javascript - Remote media player
Writing a Fullstack Application with Javascript - Remote media player
 
.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013
.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013 .Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013
.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013
 
Tikal's Backbone_js introduction workshop
Tikal's Backbone_js introduction workshopTikal's Backbone_js introduction workshop
Tikal's Backbone_js introduction workshop
 
TCE Automation
TCE AutomationTCE Automation
TCE Automation
 
Tce automation-d4
Tce automation-d4Tce automation-d4
Tce automation-d4
 
Cloud computing - an insight into "how does it really work ?"
Cloud computing - an insight into "how does it really work ?" Cloud computing - an insight into "how does it really work ?"
Cloud computing - an insight into "how does it really work ?"
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud Computing
 
Tikal Fuse Day Access Layer Implementation (C#) Based On Mongo Db
Tikal Fuse Day   Access Layer Implementation (C#) Based On Mongo DbTikal Fuse Day   Access Layer Implementation (C#) Based On Mongo Db
Tikal Fuse Day Access Layer Implementation (C#) Based On Mongo Db
 
Ship early ship often with Django
Ship early ship often with DjangoShip early ship often with Django
Ship early ship often with Django
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
AWS Case Study
AWS Case StudyAWS Case Study
AWS Case Study
 
Introduction To Cloud Computing
Introduction To Cloud ComputingIntroduction To Cloud Computing
Introduction To Cloud Computing
 
Building Components In Flex3
Building Components In Flex3Building Components In Flex3
Building Components In Flex3
 
Osgi Democamp
Osgi DemocampOsgi Democamp
Osgi Democamp
 

Kürzlich hochgeladen

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Kürzlich hochgeladen (20)

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 

Clojure - LISP on the JVM

  • 1. Clojure ● LISP on the JVM ● Dynamic ● Started in 2007 by Rich Hickey ● 3 years of planning ● Current version - 1.6.0 ● Eclipse license
  • 2. Defining Features ● LISP syntax but not Common LISP or Scheme – Macros ● Immutability ● Functional ● JVM based – Java interop – Not OOP ● Supports Concurrency
  • 3. Syntax ● Numbers: 1234, 1.234, 1.234M ● Ratios: 22/7 ● Strings: “foo”, “bar”, Characters: a b c ● Symbols: foo, bar, Keywords: :foo, :bar ● Boolean: true, false, Null: nil ● Regex Patterns: #”a*b”
  • 4. Data Structures ● Lists – singly linked, grow at front: – (1 2 3 4) ● Vectors – indexed, grow at end: – [1 2 3 4] ● Maps – key/value associations: – {:a 1 :b 2 :c 3} ● Sets: #{:a :b :c} ● Everything nests inside each other
  • 5. Syntax ● That's the entire syntax ● Data strcuture are the code (Homoiconicity) ● All data literals stand for themselves except: – Lists (IFn invocation) – Symbols (“pointers”)
  • 6. Lists as Invocations Example ● (+ 1 1) => 2 ● (+ 1 2 (+ 3 4 5)) => 15 ● (first [:a :b :c]) => :a ● (rest [:a :b :c]) => (:b :c) ● (class “foo”) => java.lang.String ● (class 1) => java.long.Long
  • 7. Persistent Data Structures ● All Clojure data structures are persistent ● Collections maintain performance guarantees: – New + Old version of collections are available after change – New versions are not full copies – Thread safe, iteration safe ● Sequences replace traditional lists – All Clojure and Java collections can be made into seqs
  • 8. Persistent Data Structure Performance ● O(log32 N) ~= O(1) A B C D E F G H I J K L M N' A’ C’ G’ N
  • 9. Seq General Macros ● All seqs, which means all lists, vectors, hash- maps, hash-sets, strings etc. can use the multi purpose seq macros. A kind of polymorphism over collections. (def xs [:a :b :c]) – (first xs) => :a , (rest xs) => (:b :c) – (count xs) => 3 , (contains? xs :d) => false – (remove #(= % :b) xs) => (:a :c) – (nth xs 2) => :c
  • 10. Laziness ● Seqs can be lazy – (repeat :a) => (:a :a :a :a :a …) ● Processing is delayed until the seq is realized: – (class (repeat :a)) => clojure.lang.LazySeq ● Realize part of a lazy seq: – (take 3 (repeat :a)) => (:a :a :a)
  • 11. Philosophy ● Use libraries instead of frameworks ● REPL first development – Small and isolated functions ● Data structures instead of classes
  • 12. DEMO
  • 13. Java Interop ● (.toLowerCase “AppsFlyer”) => “appsflyer” – (.<method> <object> [<arg1> …]) ● (Foo. “bar”) => #<Foo bar> – (<class>. [<constrcutor arg1>...]) ● (Integer/parseInt “5”) => 5 – (<class>/<static method> [<arg1>...]) ● (.contains “AppsFlyer FTW” “FTW”) => true
  • 14. Concurrency ● Clojure uses STM – no locks in the code – Multiversion Concurrency Control (MVCC) – Readers never impede writers and writers never impeded readers ● 3 primitive containers to store mutable data – atom, ref, agent – Refs – coordinated-sync access to many identities – Atoms – Uncoordinated-sync access to a single identity – Agents – Uncoordinated-async access to a single identity
  • 15. So Much More... ● Metadata ● Optimized tail recursion ● Destructuring binding in let/fn/loop ● List comprehensions ● Multimethods ● Parallel computations ● Macros