Skip to content

Instantly share code, notes, and snippets.

@ghoseb
Created March 16, 2012 12:54
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ghoseb/2049970 to your computer and use it in GitHub Desktop.
Scaffold by Christophe Grand
(defn scaffold
"Print the ancestor method signatures of a given interface."
[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)))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment