 	(invoke [this x] (.applyTo this (list x)))
 	(applyTo [this args] (let [tag (first args)] (tag this))))
 
-(impl-invoke (defrecord Tag [tag-name attrs css items]
+(defrecord-ifn Tag [tag-name attrs css items]
 	java.lang.Object
 	(toString [_]
 		(let [attrs-with-css (if (empty? css) attrs (assoc attrs :style (str css)))]

					" />"
					[">" (map html-escape items) "</" tag-name ">"]))))
	clojure.lang.IFn
	(applyTo [this args] (apply extend-tag this args))))

(defrecord Literal [s] java.lang.Object (toString [_] s))


;; Character Entities

(defmacro defentity
	([id] `(defentity ~id ~id))
	([id value] `(def ~id (literal ~(str "&" (name value) ";")))))

(defentity nbsp)
