I'm new to clojure, and I'm trying to use clojure.contrib.strint to build a URL. for example I might use this for a google search:
(def search_base_url "http://www.google.com/search?hl=en&q=~{query}")
(defn search_url [search_term]
(let [query (.replaceAll search_term "\\s+" "+")]
(<< search_base_url)))
But this gives me the compiler error:
error: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException: No matching method found: indexOf for class clojure.lang.Symbol.
I think strint uses indexOf a few times, so somehow I'm not giving the << function what it wants, it seems.
I've also tried (def search_base_url '(<< "http://myurl.com?~{params}"))
, but then I can't figure out how to evaluate that form in the context of my let. I could just put the string in the search_url function, but that feels inferior to me and I'm hoping the answer to this will help me understand clojure a bit better.
Thanks