Skip to content

Instantly share code, notes, and snippets.

@oranenj
Created June 21, 2009 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oranenj/133660 to your computer and use it in GitHub Desktop.
Save oranenj/133660 to your computer and use it in GitHub Desktop.
(defmacro foo [name]
(let [c (Class/forName name)
first-met (first (.getMethods c))]
`(defn ~(symbol (.getName first-met)) [& ~'args] "hello")))
(macroexpand '(foo "java.lang.String"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment