Skip to content

Instantly share code, notes, and snippets.

@divs1210
Last active April 6, 2016 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save divs1210/5f344be5c877adc6f2b775f7fc914f31 to your computer and use it in GitHub Desktop.
Save divs1210/5f344be5c877adc6f2b775f7fc914f31 to your computer and use it in GitHub Desktop.
This works fine for some time, but then I start getting an exception saying: "No implementation of method: :search of protocol: #'some.thing/ISearchEngine found for class: some.thing.SearchEngine"
(defprotocol ISearchEngine
"Search the web"
(search [engine term] "Search the web for a single (one-word) term."))
(defrecord SearchEngine [url]
ISearchEngine
(search [this term]
(-> (str (:url this) term)
http/get deref :body)))
(defonce google
(SearchEngine. "https://www.google.co.in/search?q="))
(defonce bing
(SearchEngine. "https://www.bing.com/search?q="))
(defonce ddg
(SearchEngine. "https://duckduckgo.com/?q="))
(search google "wonko+the+sane")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment