Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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.8k
On Solving Problems
bg
0
140
Other Decks in Programming
See All in Programming
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
160
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
160
Event Storming
hschwentner
3
1.3k
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
210
15年目のiOSアプリを1から作り直す技術
teakun
1
610
猫の手も借りたい!ので AIエージェント猫を作って社内に放した話 Claude Code × Container Lambda の Slack Bot "DevNeko"
naramomi7
0
250
AI活用のコスパを最大化する方法
ochtum
0
120
CopilotKit + AG-UIを学ぶ
nearme_tech
PRO
1
130
Fundamentals of Software Engineering In the Age of AI
therealdanvega
1
200
Python’s True Superpower
hynek
0
200
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1.7k
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
1.1k
Featured
See All Featured
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
230
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Context Engineering - Making Every Token Count
addyosmani
9
740
How to Ace a Technical Interview
jacobian
281
24k
A Soul's Torment
seathinner
5
2.4k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
370
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
65
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
220
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
660
Claude Code のすすめ
schroneko
67
220k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.8k
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