3 ms·
Hmm, not sure I agree with "[W]hile Clojure does have some nice syntax for handling maps, which can be used to represent records, it's unfortunately still prett
by KingMob 9y ago
Hmm, not sure I agree with "[W]hile Clojure does have some nice syntax for handling maps, which can be used to represent records, it's unfortunately still pretty idiomatic to store tuples in lists in Clojure code."
It's way more common to use key/value maps, precisely because Clojure has a simple, universal reader macro for representing it. Likewise, his Clojure example at the end:
(def point ['vec3d 3 4 -3])
(match [point] ['vec3d x y z] (printf "(%s,%s,%s)" x y z))
is absurd. I can't imagine anyone familiar with Clojure choosing that over a simple map or record. E.g.:
{:x 3 :y 4 :z -3}