;; Big thanks to Christophe Grand - https://groups.google.com/d/msg/clojure/L1GiqSyQVVg/m-WJogaqU8sJ (defn scaffold [iface] (doseq [[iface methods] (->> iface .getMethods (map #(vector (.getName (.getDeclaringClass %)) (symbol (.getName %)) (count (.getParameterTypes %)))) (group-by first))] (println (str " " iface)) (doseq [[_ name argcount] methods] (println (str " " (list name (into ['this] (take argcount (repeatedly gensym))))))))) ;;user=> (scaffold clojure.lang.IPersistentMap) ;; clojure.lang.IPersistentMap ;; (assoc [this G__441 G__442]) ;; (without [this G__443]) ;; (assocEx [this G__444 G__445]) ;; java.lang.Iterable ;; (iterator [this]) ;; clojure.lang.Associative ;; (containsKey [this G__446]) ;; (assoc [this G__447 G__448]) ;; (entryAt [this G__449]) ;; clojure.lang.IPersistentCollection ;; (count [this]) ;; (cons [this G__450]) ;; (empty [this]) ;; (equiv [this G__451]) ;; clojure.lang.Seqable ;; (seq [this]) ;; clojure.lang.ILookup ;; (valAt [this G__452 G__453]) ;; (valAt [this G__454]) ;; clojure.lang.Counted ;; (count [this]) ;; nil