practicalli / clojure

Practicalli Clojure REPL Driven Development
https://practical.li/clojure/
Creative Commons Attribution Share Alike 4.0 International
90 stars 36 forks source link

Deconstructing Clojure data #386

Open practicalli-johnny opened 3 years ago

practicalli-johnny commented 3 years ago

All the many wonderful ways to deconstruct

destructure map keys from many namespaces like so : user=> (let [{:keys [:a/one :b/two three]} {:a/one 1 :b/two 2 :three 3}] [one two three]) ;; => [1 2 3]

also destructure like :a/keys to use the same namespace for multiple keys that share one