This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns deftype+ | |
"Augmented deftype sporting a new :delegate option.") | |
;; code to get the methods of interfaces and protocols | |
(defmulti get-methods | |
"Return a map of all method names to their arity." | |
class) | |
(defmethod get-methods clojure.lang.PersistentArrayMap | |
[protocol] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns mlimotte.util) | |
; A variation on clojure.core/merge-with | |
(defn merge-with-key | |
"Returns a map that consists of the rest of the maps conj-ed onto | |
the first. If a key occurs in more than one map, the mapping(s) | |
from the latter (left-to-right) will be combined with the mapping in | |
the result by calling (f key val-in-result val-in-latter)." | |
[f & maps] |