On Thu, Oct 9, 2008 at 4:57 PM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> Go for it.

(defmethod print-method java.util.regex.Pattern [p #^Writer w]
  (.write w "#\"")
  (loop [[#^Character c & r :as s] (seq (.pattern #^java.util.regex.Pattern p))]
    (when s
      (cond
        (= c \\) (do (.append w \\)
                     (.append w #^Character (first r))
                     (recur (rest r)))
        (= c \") (do (.write w "\\\"")
                     (recur r))
        :else    (do (.append w c)
                     (recur r)))))
  (.append w \"))

--Chouser

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to