Skip to content

Instantly share code, notes, and snippets.

@Chouser
Created May 20, 2010 19:32
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 Chouser/407980 to your computer and use it in GitHub Desktop.
Save Chouser/407980 to your computer and use it in GitHub Desktop.
; &env disagrees with the compiler's treatment of :tag metadata?
(defmacro gettag [sym] (:tag (meta (key (find &env sym)))))
;=> #'com.sentryds.qdc.Explore/gettag
(let [#^Integer x 5, #^String x "foo"] (gettag x))
;=> java.lang.Integer
(let [#^Integer x 5, #^String x "foo"] (.toUpperCase x))
;=> "FOO"
@Chouser
Copy link
Author

Chouser commented May 24, 2010

Can use .tag or .sym on the &env val instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment