Skip to content

Instantly share code, notes, and snippets.

@mpenet
Created March 16, 2012 23:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpenet/2053633 to your computer and use it in GitHub Desktop.
Save mpenet/2053633 to your computer and use it in GitHub Desktop.
useful bit from cgrand
(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)))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment