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 à Clojure
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Pablo Tamarit
October 30, 2012
Programming
98
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introduction à 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 to Clojure
ptamarit
0
82
Other Decks in Programming
See All in Programming
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
460
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
JIS keyboard support in Omarchy
lef237
0
120
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
The Rails Doctrine Decade
koic
2
590
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
0
170
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
420
すこし踏み込む CancellationToken
htkym
2
1.7k
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
360
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
Optimizing for Happiness
mojombo
378
71k
Designing for humans not robots
tammielis
254
26k
What's in a price? How to price your products and services
michaelherold
247
13k
Are puppies a ranking factor?
jonoalderson
2
4.1k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
4 Signs Your Business is Dying
shpigford
187
23k
Transcript
Introduction à Clojure Pablo Tamarit 30 octobre 2012 GenevaJUG
? 2000 2001 2002 2003 2004 2005 2006 2007 2008
2009 2010 2011 2012 1999 - 2005 EIG 2007 - 2049 CERN
(def panier [{:nom "pommes", :type :fruits} {:nom "poires", :type :fruits}
{:nom "scoubidous", :type :objets}]) (group-by :type panier) {:fruits [{:type :fruits, :nom "pommes"} {:type :fruits, :nom "poires"}], :objets [{:type :objets, :nom "scoubidous"}]} Avant-goût
• Partie philosophique • Partie théorique • Partie pratique
Partie philosophique
Clojure • Créé en 2007 • Simplicité • Pas d’orienté
objet! • Typage dynamique • Tout est immutable • Pas d'état • Pas d'effets de bord • Dialecte de Lisp! + λ
Lisp • Inventé en 1958
John McCarthy 1927 – 2011
Lisp • Inventé en 1958 • Lots of Irritating Superfluous
Parentheses?
Lisp • Inventé en 1958 • Lots of Irritating Superfluous
Parentheses • Homoiconicité • Macros paulgraham.com/avg.html
Partie théorique
Langage • Syntaxe simple, vocabulaire riche. – Syntaxe: données, fonctions
– Vocabulaire: fonctions clojure.org/cheatsheet
Syntaxe: collections Liste ("un" 2 3 3) Vecteur ["un" 2
3 3] Set #{"un" 2 3} Map {:nom "Pablo", :age 28} (:age {:nom "Pablo", :age 28}) 28
Syntaxe: fonctions Appel (+ 1 2 3) Définition (defn abs
[n] (if (neg? n) (- n) n)) Définition anonyme (fn [x y] (+ (abs x) (abs y))) Définition anonyme sucrée #(+ (abs %1) (abs %2)) condition then else vecteur liste fn args
Vocabulaire: fonctions (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
Partie pratique
Quoi installer? • Rien! <dependency> <groupId>org.clojure</groupId> <artifactId>clojure</artifactId> <version>1.4.0</version> </dependency> •
Qui a-t-il dans le JAR? – La librairie – REPL: java -jar clojure.jar – Compilateur: .clj .class
Outils • Build – leiningen – clojure-maven-plugin • IDE –
Counterclockwise (Eclipse) – La Clojure (IntelliJ IDEA) – Emacs!
Apprentissage • Présentations: – blip.tv/clojure – infoq.com/clojure • Livres: –
clojurebook.com – joyofclojure.com • Exercices: – 4clojure.com
Questions?
Crédits graphiques • Logo Clojure: © Tom Hickey (tomhickey.com) •
Vue aérienne du LHC: © 2001 CERN (cdsweb.cern.ch/record/42370) • La Trahison des images: © 1929 René Magritte • Duke models: © Sun Microsystems Inc. (duke.kenai.com/models) • Portrait de John McCarthy: © 2006 null0 (flic.kr/p/q39Sg) • L'Appel des cimes: © 1942 René Magritte • La 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)