Returns an unevaluated expression (to be used in a macro) of an
atom.
(defn build-atom
"Returns an unevaluated expression (to be used in a macro) of an
atom."
[f type]
(let [p (first f)
ts (map #(if (is-var? %) `(quote ~%) %) (next f))
b (if (seq ts) (apply assoc {} ts) nil)]
`(struct atomic-literal ~p ~b ~type)))
Comments top
No comments for build-atom. Log in to add a comment.