SlideShare a Scribd company logo
1 of 61
Download to read offline
CLOJURE 101
@logaan
WEB
APPS
GUI
GUI
MOBILE
TERMINAL
ANIMATION
MUSIC
GAMES
ARDUINO
HEALTH
SPACE
true
false
3.14
"Kittens are cute"
nil
ram
'ram
‘farm-animal/ram
‘computer-part/ram
‘demolition-tool/ram
:bug
:insect/bug
:software/bug
[1 2 4]3, , ,
4][1 2 3
[1 2 :three "four"]
:bar 2},{:foo 1
:bar 2}{:foo 1
{
"fizz" true
:bugs false
[1 2 3] {:do "re"}
}
#{1 2 3}
'(1 2 3)
print "Hello, World")(
print "Hello, World")(
(+ 40 2)
(+ 10 8 20 4)
(fn [name]
(print "Hello " name))
(def host "Zendesk")
(print "Hello " name))
fn [name](
greet(def
)
fn greet(def
(print "Hello " name))
[name]
(defroutes app
(GET "/" []
"<h1>Hello World</h1>")
(route/not-found
"<h1>Page not found</h1>"))
WEB
(generate-string {:foo "bar" :baz 5})
=> {“foo”: “bar”, “baz”: 5}
(parse-string "{"foo":"bar"}")
;; => {"foo" "bar"}
JSON
(html [:span {:class "foo"} "bar"])
=> "<span class="foo">
bar
</span>"
 
(html [:ul
(for [x (range 1 4)]
[:li x])])
=> "<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>"
HTML / XML CREATION
(def xml-doc
(parse (File. "calendar.xml")))
(get-in xml-doc [:content 1 :content 0 :content])
=> [“Rover’s birthday”]
XML READING
(deftest addition-tests
(is (= 5 (+ 3 2)))
(is (= 10 (+ 5 5))))
UNITTESTING
THANKYOU
QUESTIONS?
OVERTIME
(reverse '(7 10 -))
; => (- 10 7)
(defmacro backwards [call]
(reverse call))
(- 10 7) ; => 3
MACROS
(- 10 7) ; => 3
(backwards (7 10 -)) ; => 3
(defmacro backwards [call]
(reverse call))
MACROS
def fib(0) do 0 end
def fib(1) do 1 end
def fib(n) do
fib(n-1) + fib(n-2)
end
PATTERN MATCHING
(defn-match fib
([0] 1)
([1] 1)
([?n] (+ (fib (- n 1))
(fib (- n 2)))))
for i := 0; i < 10; i++ {
go func(i int) {
sleep := time.Duration(rand.Intn(1000))
time.Sleep(sleep * time.Millisecond)
fmt.Println(i)
}(i)
}
GOROUTINES
(for [i (range 10)]
(go
(Thread/sleep (rand-int 1000))
(println i)))
Girl Geek Dinners - Clojure 101

More Related Content

What's hot

Sound design in computer games the evil within
Sound design in computer games the evil withinSound design in computer games the evil within
Sound design in computer games the evil within
crisgalliano
 
Hacking JavaScript Games - Cellular Automata
Hacking JavaScript Games - Cellular AutomataHacking JavaScript Games - Cellular Automata
Hacking JavaScript Games - Cellular Automata
Alan Richardson
 
The crew
The crewThe crew
The crew
BenCom1
 
openFrameworks 007 - sound
openFrameworks 007 - soundopenFrameworks 007 - sound
openFrameworks 007 - sound
roxlu
 
Ig1 task 2 analysis work sheet (2)
Ig1 task 2 analysis work sheet (2)Ig1 task 2 analysis work sheet (2)
Ig1 task 2 analysis work sheet (2)
bowes96123
 

What's hot (14)

Sound design in computer games the evil within
Sound design in computer games the evil withinSound design in computer games the evil within
Sound design in computer games the evil within
 
Final Fantasy X
Final Fantasy XFinal Fantasy X
Final Fantasy X
 
プログラミングはなぜ難しいのか
プログラミングはなぜ難しいのかプログラミングはなぜ難しいのか
プログラミングはなぜ難しいのか
 
Asynchronous programming FTW!
Asynchronous programming FTW!Asynchronous programming FTW!
Asynchronous programming FTW!
 
My quotes
My quotesMy quotes
My quotes
 
Hacking JavaScript Games - Cellular Automata
Hacking JavaScript Games - Cellular AutomataHacking JavaScript Games - Cellular Automata
Hacking JavaScript Games - Cellular Automata
 
The crew
The crewThe crew
The crew
 
Game rek
Game rekGame rek
Game rek
 
openFrameworks 007 - sound
openFrameworks 007 - soundopenFrameworks 007 - sound
openFrameworks 007 - sound
 
Phlebo
PhleboPhlebo
Phlebo
 
Microprocessors and interfacing d.a.godse a.p.godse
Microprocessors and interfacing   d.a.godse a.p.godseMicroprocessors and interfacing   d.a.godse a.p.godse
Microprocessors and interfacing d.a.godse a.p.godse
 
Batman arkam city sond desighn 1
Batman arkam city sond desighn 1Batman arkam city sond desighn 1
Batman arkam city sond desighn 1
 
Ig1 task 2 analysis work sheet (2)
Ig1 task 2 analysis work sheet (2)Ig1 task 2 analysis work sheet (2)
Ig1 task 2 analysis work sheet (2)
 
SCAN7
SCAN7SCAN7
SCAN7
 

Similar to Girl Geek Dinners - Clojure 101

Python for High School Programmers
Python for High School ProgrammersPython for High School Programmers
Python for High School Programmers
Siva Arunachalam
 
Marrow: A Meta-Framework for Python 2.6+ and 3.1+
Marrow: A Meta-Framework for Python 2.6+ and 3.1+Marrow: A Meta-Framework for Python 2.6+ and 3.1+
Marrow: A Meta-Framework for Python 2.6+ and 3.1+
ConFoo
 
Five Languages in a Moment
Five Languages in a MomentFive Languages in a Moment
Five Languages in a Moment
Sergio Gil
 

Similar to Girl Geek Dinners - Clojure 101 (20)

Basics
BasicsBasics
Basics
 
JavaForum Nord 2021: Java to Go - Google Go für Java-Entwickler
JavaForum Nord 2021: Java to Go - Google Go für Java-EntwicklerJavaForum Nord 2021: Java to Go - Google Go für Java-Entwickler
JavaForum Nord 2021: Java to Go - Google Go für Java-Entwickler
 
Music as data
Music as dataMusic as data
Music as data
 
Clojure入門
Clojure入門Clojure入門
Clojure入門
 
(first '(Clojure.))
(first '(Clojure.))(first '(Clojure.))
(first '(Clojure.))
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to Groovy
 
Lập trình Python cơ bản
Lập trình Python cơ bảnLập trình Python cơ bản
Lập trình Python cơ bản
 
Clojure Intro
Clojure IntroClojure Intro
Clojure Intro
 
Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?
 
An (Inaccurate) Introduction to Python
An (Inaccurate) Introduction to PythonAn (Inaccurate) Introduction to Python
An (Inaccurate) Introduction to Python
 
Elixir & Phoenix - fast, concurrent and explicit
Elixir & Phoenix - fast, concurrent and explicitElixir & Phoenix - fast, concurrent and explicit
Elixir & Phoenix - fast, concurrent and explicit
 
Python for High School Programmers
Python for High School ProgrammersPython for High School Programmers
Python for High School Programmers
 
Marrow: A Meta-Framework for Python 2.6+ and 3.1+
Marrow: A Meta-Framework for Python 2.6+ and 3.1+Marrow: A Meta-Framework for Python 2.6+ and 3.1+
Marrow: A Meta-Framework for Python 2.6+ and 3.1+
 
F# intro
F# introF# intro
F# intro
 
[EN] Ada Lovelace Day 2014 - Tampon run
[EN] Ada Lovelace Day 2014  - Tampon run[EN] Ada Lovelace Day 2014  - Tampon run
[EN] Ada Lovelace Day 2014 - Tampon run
 
An introduction to Ruby
An introduction to RubyAn introduction to Ruby
An introduction to Ruby
 
Five Languages in a Moment
Five Languages in a MomentFive Languages in a Moment
Five Languages in a Moment
 
Assignment6
Assignment6Assignment6
Assignment6
 
Let's golang
Let's golangLet's golang
Let's golang
 
Python basic
Python basic Python basic
Python basic
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

Girl Geek Dinners - Clojure 101