Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Introduction to Clojure
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Pablo Tamarit
October 30, 2012
Programming
82
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introduction to Clojure
Pablo Tamarit
October 30, 2012
More Decks by Pablo Tamarit
See All by Pablo Tamarit
From Bash to Z shell in 5 min
ptamarit
1
92
Introduction à Clojure
ptamarit
0
98
Other Decks in Programming
See All in Programming
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
150
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
280
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
150
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.1k
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
120
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
250
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
4.8k
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
4
700
巨大モノリシックアプリ モダン化大作戦
ktcryomm
1
1k
What We Talk About When We Talk About XP
m_seki
2
660
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
190
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
220
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
850
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
330
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.9k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
The SEO Collaboration Effect
kristinabergwall1
1
570
Optimizing for Happiness
mojombo
378
71k
Unsuck your backbone
ammeep
672
58k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
Music & Morning Musume
bryan
48
7.4k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
680
Transcript
Introduction to Clojure Pablo Tamarit October 30, 2012 GenevaJUG
? 2000 2001 2002 2003 2004 2005 2006 2007 2008
2009 2010 2011 2012 1999 - 2005 EIG 2007 - 2049 CERN
(def basket [{:name "apples", :type :fruits} {:name "pears", :type :fruits}
{:name "scoubidous", :type :objects}]) (group-by :type basket) {:fruits [{:type :fruits, :name "apples"} {:type :fruits, :name "pears"}], :objects [{:type :objects, :name "scoubidous"}]} Sampling
• Philosophical part • Theoretical part • Practical part
Philosophical part
Clojure • Created in 2007 • Simplicity • Not object
oriented! • Dynamic typing • Everything is immutable • No state • No side effects • Dialect of Lisp! + λ
Lisp • Invented in 1958
John McCarthy 1927 – 2011
Lisp • Invented in 1958 • Lots of Irritating Superfluous
Parentheses?
Lisp • Invented in 1958 • Lots of Irritating Superfluous
Parentheses • Homoiconicity • Macros paulgraham.com/avg.html
Theoretical part
Language • Simple syntax, rich vocabulary. – Syntax: data, functions
– Vocabulary: functions clojure.org/cheatsheet
Syntax: collections List ("one" 2 3 3) Vector ["one" 2
3 3] Set #{"one" 2 3} Map {:name "Pablo", :age 28} (:age {:name "Pablo", :age 28}) 28
Syntax: functions Call (+ 1 2 3) Definition (defn abs
[n] (if (neg? n) (- n) n)) Anonymous definition (fn [x y] (+ (abs x) (abs y))) Sugared anonymous definition #(+ (abs %1) (abs %2)) condition then else vector list fn args
Vocabulary: functions (def coll [-42 5 -0.1]) (map abs coll)
(42 5 0.1) (reduce + 0 coll) -37.1 (filter neg? coll) (-42 -0.1)
Interop Java Clojure new JFrame("Titre") (JFrame. "Titre") Color.RED Color/RED frame.setTitle("Titre2")
(.setTitle frame "Titre2") frame.getTitle().toLowerCase() (.. frame getTitle toLowerCase) frame.add(panel) frame.pack() frame.setVisible(true) (doto frame (.add panel) (.pack) (.setVisible true)) 2 4 1 3
Practical part
What to install? • Nothing! <dependency> <groupId>org.clojure</groupId> <artifactId>clojure</artifactId> <version>1.4.0</version> </dependency>
• What’s in the JAR? – The library – REPL: java -jar clojure.jar – Compiler: .clj .class
Tools • Build – leiningen – clojure-maven-plugin • IDE –
Counterclockwise (Eclipse) – La Clojure (IntelliJ IDEA) – Emacs!
Resources • Presentations: – blip.tv/clojure – infoq.com/clojure • Books: –
clojurebook.com – joyofclojure.com • Exercises: – 4clojure.com
Questions?
Image credits • Clojure logo: © Tom Hickey (tomhickey.com) •
Aerial view of the LHC: © 2001 CERN (cdsweb.cern.ch/record/42370) • The Treachery of Images: © 1929 René Magritte • Duke models: © Sun Microsystems Inc. (duke.kenai.com/models) • Portrait of John McCarthy: © 2006 null0 (flic.kr/p/q39Sg) • The Call of the Peaks: © 1942 René Magritte • Clairvoyance: © 1936 René Magritte • Cooled Beans: © 2008 Chris Bay (flic.kr/p/4z6CBA) • Gears: © Dima Yagnyuk (thenounproject.com/noun/gears/#icon- No2174, thenounproject.com/Deadtype) • Tools: © Jacob Hardbower (thenounproject.com/noun/tools/#icon- No4684, thenounproject.com/HeartWired)