|
|
|
|
|
by cgag
4439 days 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)]
...))
|
|