Hi,
(defn exchange!
[a b & {:keys [getter setter] {getter identity setter (fn [_ v] v)}}]
(let [av @a bv @b]
(alter a setter (getter bv))
(alter b setter (getter av))))
(defn exchange-color!
[a b]
(exchange! a b :getter :color :setter #(assoc %1 :color %2)))
(exchange-color! a b)
Something like that?
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en