     '()
     (reverse coll)))
 
-(defn build-str-concat
-  "Build code to string concatenate a sequence of forms."
-  [coll]
-  (let [buffer (gensym "buffer")]
-   `(let [~buffer (StringBuffer.)]
-     ~@(for [x (collapse-strs coll)]
-        `(.append ~buffer ~x))
-       (.toString ~buffer))))
-
-(defmacro html
-  "Efficiently compile a Clojure data structure to HTML"
-  [& content]
-  (build-str-concat
-    (mapcat compile-html content)))
+;(defmacro html
+;  "Efficiently compile a Clojure data structure into a list of HTML."
+;  [& content]
+;  `(list ~@(mapcat compile-html content)))

    (replace ">"  "&gt;")
    (replace "\"" "&quot;")))

(defn literal?
  "True if the value is a literal string, keyword, number, map, vector, nil
  or a quoted value."
  [x]
  (or (string? x)
      (number? x)
      (keyword? x)
      (vector? x)
      (map? x)
      (nil? x)
      (and (list? x)
           (= (first x) 'quote))))

(defn- pre-compile
  "Pre-compile a form if its arguments are all literals."
  [form]
  (if (every? literal? (rest form))
    (eval form)
    (list form)))

(defn- format-attr
  "Turn a key-value pair into a pair of attribute-value strings."

(ns hiccup
  "Efficiently generate HTML from a Clojure data structure."
  (:use clojure.contrib.def)
  (:use clojure.contrib.java-utils))

(derive clojure.lang.IPersistentVector ::vector)
(derive clojure.lang.IPersistentList ::list)
(derive clojure.lang.ISeq ::seq)

(defn escape-html
  "Change special characters into HTML character entities."
