How to test if a piece of code refers to a macro in Clojure?
In clojure is there something li开发者_开发技巧ke "is-macro?" to test to see if something is a macro?
Given a var, its metadata can tell you whether it's a macro:
(:macro (meta #'when))
=> true
(:macro (meta #'identity))
=> nil
精彩评论