Skip to content

Instantly share code, notes, and snippets.

Created March 16, 2012 12:54
What would you like to do?
Scaffold by Christophe Grand
(defn scaffold
"Print the ancestor method signatures of a given interface."
(doseq [[iface methods] (->> iface
(map #(vector (.getName (.getDeclaringClass %))
(symbol (.getName %))
(count (.getParameterTypes %))))
(group-by first))]
(println (str " " iface))
(doseq [[_ name argcount] methods]
(str " "
(list name (into ['this] (take argcount (repeatedly gensym)))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment