On Jun 24, 2009, at 6:13 PM, CuppoJava wrote:
Is there a nice way of doing this without having to go back to using Java's string syntax?
I don't see a nice way to do it. You can use either (java.util.rexex.Pattern/compile my-str) or (with-in-str (str \# \" my-str \") (read))to create a regex Pattern from a my-str, but building the my-str out of literal pieces will still involve the reader reading string literals and expecting them to be escaped properly as Java strings.
If we someday get arbitrary symbol names delimited by "|", using them to produce the literal parts your template might work. That's listed as "shorter-term" at http://clojure.org/todo . The equivalent of a shell script "heredoc" (http://en.wikipedia.org/wiki/Heredoc) could also be useful here.
--Steve
smime.p7s
Description: S/MIME cryptographic signature