Skip to content

Instantly share code, notes, and snippets.

@hlship
Last active August 29, 2015 14:02
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 hlship/5761afbc1eeca8b005e8 to your computer and use it in GitHub Desktop.
Save hlship/5761afbc1eeca8b005e8 to your computer and use it in GitHub Desktop.
(defprotocol State (state [this]))
(defrecord StateImpl [state-value]
State
(state [this] state-value))
(-> (StateImpl. 42) state)
=> 42
(-> (StateImpl. 42) (assoc :state-value 99) state)
=> 99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment