(spec/def ::test-spec (spec/* any?))
(spec/fdef test-macro
:args ::test-spec
:ret any?)
(defmacro test-macro [& body]
(println body))
(test-macro a b c)
(a b c)
=> nil
(defmacro test-macro [& body]
(spec/explain ::test-spec body))
(test-macro a b c)
Success!
=> nil
This doesn't:
(defmacro test-macro [& body]
(spec/conform ::test-spec body))
(test-macro a b c)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context
Stanislav.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/ixISA42ucVE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.