1. Destructuring
Demystified
Demystified
A Tour of clojure’s Destructuring forms by
someone hopelessly unqualified.
2. TIL Session #1
What is it?
Why use it?
Where should I use them?
When should I use them?
How?
Cool tricks
3. What?
“A method of positionally binding locals based on
an expected form for a composite data structure”
- The Joy of Clojure
OR
“Picking out the bits you need”
- Tom Crinson
4. Why?
A lot of times you don’t need the whole
structure.
Keeps code readable
Keeps functions focussed
7. When?
“Whenever you find yourself calling nth
repeatedly, or
looking up constants in a map or using first or next,
ask yourself if restructuring would be a better fit.”
- The Joy of Clojure