3 ms·
I would just accept the hash, I think a lot of us prefer it to the pseudo keyword args. (defn message [text {:keys [style color]}] ...) (message "Text"
by cgag 13y ago
I would just accept the hash, I think a lot of us prefer it to the pseudo keyword args.
(defn message [text {:keys [style color]}] ...)
(message "Text" {:style :bold :color :red})
To the person asking, that {:keys [style color]} is destructuring, it's not required, but it's nice, it's equivalent to doing:
(defn message [text opts]
(let [style (:style opts)
color (:color opts)]
...))