Skip to content

Instantly share code, notes, and snippets.

View megakorre's full-sized avatar

Patrik Kårlin megakorre

View GitHub Profile
@megakorre
megakorre / func-interface.clj
Created July 18, 2012 18:43
functional interface implementation in clojure
(defmacro fi
[interface args & code]
(let [interface-type (.getMapping *ns* interface)
methods (-> (.getMethods interface-type)
seq)
method-sym (.getName (first methods))]
(when-not (= (count methods) 1)