Skip to content

Instantly share code, notes, and snippets.

@oranenj
Created June 28, 2009 18:21
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/137331 to your computer and use it in GitHub Desktop.
Save oranenj/137331 to your computer and use it in GitHub Desktop.
(defn to-gl-const [k]
(let [gl (str "GL_" (.. (name k)
(replace \- \_) (toUpperCase)))]
`(. ~'GL ~(symbol gl))))
(to-gl-const 'foo)
(defmacro many-consts [& consts]
`(do ~@(map to-gl-const consts)))
(macroexpand-1 '(many-consts foo bar))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment