(defn
wrap-attrs
"Add an optional attribute argument to a function that returns a element vector."
[func]
(fn
[& args]
(if
(map? (first args))
(let
[[tag & body] (apply func (rest args))]
(if
(map? (first body))
(into [tag (merge (first body) (first args))] (rest body))
(into [tag (first args)] body)))
(apply func args))))