Skip to content

Instantly share code, notes, and snippets.

Created March 30, 2010 11:36
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 anonymous/349024 to your computer and use it in GitHub Desktop.
Save anonymous/349024 to your computer and use it in GitHub Desktop.
(defprotocol State
(gets [state & path]))
(defn make-state []
(let [state (atom {:blah 12})]
(reify State
(gets [& path]
(get-in @state path)))))
(def a (make-state))
(gets a :blah)
should return 12
but returns : java.lang.IllegalArgumentException: No single method: gets of interface: cara.schema.state.State found for function: gets of protocol: State (NO_SOURCE_FILE:143)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment