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
99
The Roots of Go
bg
1
1.7k
On Solving Problems
bg
0
140
Other Decks in Programming
See All in Programming
Microsoft Orleans, Daprのアクターモデルを使い効率的に開発、デプロイを行うためのSekibanの試行錯誤 / Sekiban: Exploring Efficient Development and Deployment with Microsoft Orleans and Dapr Actor Models
tomohisa
0
220
サーバーサイドのビルド時間87倍高速化
plaidtech
PRO
0
670
OSS開発者という働き方
andpad
5
1.4k
Oracle Database Technology Night 92 Database Connection control FAN-AC
oracle4engineer
PRO
1
310
UbieのAIパートナーを支えるコンテキストエンジニアリング実践
syucream
2
770
私の後悔をAWS DMSで解決した話
hiramax
4
170
デザインシステムが必須の時代に
yosuke_furukawa
PRO
2
130
開発チーム・開発組織の設計改善スキルの向上
masuda220
PRO
17
9.2k
RDoc meets YARD
okuramasafumi
4
160
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
190
Nuances on Kubernetes - RubyConf Taiwan 2025
envek
0
210
AHC051解法紹介
eijirou
0
640
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
Practical Orchestrator
shlominoach
190
11k
GraphQLとの向き合い方2022年版
quramy
49
14k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
110
20k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
185
54k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Side Projects
sachag
455
43k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.6k
Become a Pro
speakerdeck
PRO
29
5.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
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