$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The Taming of the Deftype
Search
Baishampayan Ghose
May 11, 2012
Programming
2
160
The Taming of the Deftype
Slides from a talk I presented at Clojure/West 2012, San Jose, CA.
Baishampayan Ghose
May 11, 2012
Tweet
Share
More Decks by Baishampayan Ghose
See All by Baishampayan Ghose
The Revenge of the Pragmatists
bg
0
260
The Postmodern Programmer
bg
0
100
The Roots of Go
bg
1
1.7k
On Solving Problems
bg
0
140
Other Decks in Programming
See All in Programming
JETLS.jl ─ A New Language Server for Julia
abap34
1
330
dotfiles 式年遷宮 令和最新版
masawada
1
750
sbt 2
xuwei_k
0
260
ZOZOにおけるAI活用の現在 ~モバイルアプリ開発でのAI活用状況と事例~
zozotech
PRO
8
5.5k
AIコーディングエージェント(NotebookLM)
kondai24
0
170
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
300
20 years of Symfony, what's next?
fabpot
2
350
Microservices rules: What good looks like
cer
PRO
0
1.2k
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
500
React Native New Architecture 移行実践報告
taminif
1
150
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
160
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
18
7.3k
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Building Flexible Design Systems
yeseniaperezcruz
330
39k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
GraphQLとの向き合い方2022年版
quramy
50
14k
Statistics for Hackers
jakevdp
799
230k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.6k
Why Our Code Smells
bkeepers
PRO
340
57k
Embracing the Ebb and Flow
colly
88
4.9k
Transcript
deftype the taming of the Baishampayan “BG” Ghose @ghoseb Clojure/West
2012 Friday 16 March 12
@ghoseb helpshift.com Friday 16 March 12
@ghoseb helpshift.com I caught a dead mouse in the office
the other day Friday 16 March 12
MOTIVATION Friday 16 March 12
Friday 16 March 12
Friday 16 March 12
Maps Friday 16 March 12
Records Friday 16 March 12
Types Friday 16 March 12
TO SUMMARIZE Friday 16 March 12
deftype Performance Collection Abstractions Named Type Mutable Fields Full Control
Friday 16 March 12
defrecord Performance Collection Abstractions Named Type HashMap Semantics * Friday
16 March 12
maps Every other use-case Friday 16 March 12
IN SHORT Friday 16 March 12
Use Maps! Friday 16 March 12
Dive into deftype Friday 16 March 12
Use the source, Luke! Friday 16 March 12
IPersistentMap Seqable Associative IPersistentCollection ILookup Counted IFn IPersistentSet IObj Object
IMeta IPersistentStack Indexed IPersistentVector Friday 16 March 12
IPersistentMap Seqable Associative IPersistentCollection ILookup Counted IFn IPersistentSet IObj Object
IMeta IPersistentStack Indexed IPersistentVector Friday 16 March 12
Friday 16 March 12
Scaffold Friday 16 March 12
‘scaffold’ by Christophe Grand Friday 16 March 12
} Interface we want Ancestor interface Method sigs. . .
. . . . . Friday 16 March 12
bit.ly/clj-scaffold steal this code! Friday 16 March 12
A Note About IFn Holy arities, Batman! Friday 16 March
12
A Note About IFn Should implement all to avoid non-helpful
exception. Friday 16 March 12
MUTABLE TYPES Friday 16 March 12
^:volatile-mutable ^:unsynchronized-mutable atomic reads & writes a ‘vanilla’ Java mutable
field Friday 16 March 12
Friday 16 March 12
Printing Friday 16 March 12
clojure.core/print-method for humans Friday 16 March 12
clojure.core/print-dup for the reader Friday 16 March 12
#mylib.core.MyType[1,2,3] Object Literal Reader Syntax Friday 16 March 12
Factory Functions Friday 16 March 12
Hide Implementation Details Avoid Importing Java Classes Friday 16 March
12
(my-type :foo :bar) (import myns.MyType) (MyType. [:foo :bar]) vs. Friday
16 March 12
AN EXAMPLE IMPLEMENTATION (a weekend hack) Friday 16 March 12
bit.ly/clj-chainmap steal this code! Friday 16 March 12
Fin Friday 16 March 12
Friday 16 March 12