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
150
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
210
The Postmodern Programmer
bg
0
85
The Roots of Go
bg
1
1.5k
On Solving Problems
bg
0
130
Other Decks in Programming
See All in Programming
What We Can Learn From OSS
inouehi
0
400
코틀린으로 멀티플랫폼 만들기
pangmoo
0
120
Designing for tomorrow's programming workflows
honnibal
PRO
2
110
OpenTelemetry のサービスという概念について
azukiazusa1
2
1.1k
雑に思考を整理する技術と効能
konifar
55
24k
Code Reviews
bkuhlmann
4
880
Folding Cheat Sheet #1
philipschwarz
PRO
0
210
今の SmartHR にエンジニアで入社するとどうなるの?
daisukeshinoku
5
4.6k
[技育CAMPアカデミア]アイディアを形に!【超入門】スマホアプリ開発〜リリースまでの流れをご紹介
teamlab
PRO
0
340
pixivアプリでマルチモジュールを実現するまで
gatosyocora
1
130
[SF Ruby, March 2024] Rails on Wasm
palkan
0
370
Folding Cheat Sheet #2
philipschwarz
PRO
0
110
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
186
16k
Designing for Performance
lara
602
67k
The Pragmatic Product Professional
lauravandoore
24
5.8k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
115
18k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
220
21k
We Have a Design System, Now What?
morganepeng
42
6.7k
A better future with KSS
kneath
231
16k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
24
2.3k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
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