 (ns compojure.core
   "A concise syntax for generating Ring handlers."
-  (:use [clojure.contrib.def :only (name-with-attributes)]
-        clout.core
-        compojure.response))
+  (:require [clojure.string :as str])
+  (:use clout.core
+        compojure.response
+        [clojure.contrib.def :only (name-with-attributes)]))
 
 (defn- method-matches
   "True if this request matches the supplied method."

        form-method    (get-in request [:form-params "_method"])]
    (or (nil? method)
        (if (and form-method (= request-method :post))
          (= (.toUpperCase (name method)) form-method)
          (= method request-method)))))

(defn- prepare-route

  [path args & body]
  (compile-route nil path args body))

(defn- middleware-sym [x]
  (symbol (namespace x) (str "wrap-" (name x))))

(defn- ->middleware
  "Turn a keyword into a wrapper function symbol.
  e.g. :test => wrap-test
       (:test x) => (wrap-test x)"
  [kw]
  (cond
    (keyword? kw)
      (middleware-sym kw)
    (and (seq? kw) (keyword? (first kw)))
      (cons (middleware-sym (first kw)) (rest kw))
    :else
      kw))

(defmacro wrap!
  "DEPRECATED: Use '->' instead.
