O'Reilly logo
  • Leandro Gonçalves de Oliveira thinks this is interesting:

2. Update your function so it takes a second argument consisting of the search engines to use.

From

Cover of Clojure for the Brave and True

Note

(def search-provider {:google "https://www.google.com.br/search?q=" :bing "https://www.bing.com/search?q="})

(defn search-online [text provider] (if-let [url (get search-provider provider)] (slurp (str "https://www.bing.com/search?q=" text)) :provider-not-found))

(search-online "clojure" :bing)