Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A macro for collecting all predicates of a given class from my namespace and wrapping them in a disjunction.
(defmacro transformo
"Is satisfied when out-tree is a normalized version of the in-tree
node. Tries to use any goal annotated with ::rule."
[in-tree out-tree]
`(conde ~@(for [[sym var] (ns-interns *ns*)
:when (::rule (meta var))]
[(list sym in-tree out-tree)])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment