3 ms·
For me, the following is a lot more readable than cadadr: (def coll [[1 2 3] [4 5 6] [7 8 9]]) (second (second coll)) ; => 5 And
by ataggart 16y ago
For me, the following is a lot more readable than cadadr:
(def coll [[1 2 3]
[4 5 6]
[7 8 9]])
(second (second coll)) ; => 5
And often when I'm digging deep inside a nested data structure, I don't need just one piece of data, so destructuring comes in handy:
(let [[[top-left]
[_ middle]
[_ _ bottom-right]] coll]
[top-left middle bottom-right]) ; => [1 5 9]