开发者

How to test if a piece of code refers to a macro in Clojure?

开发者 https://www.devze.com 2023-02-01 16:35 出处:网络
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:

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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号