Skip to content

Instantly share code, notes, and snippets.

@pepijndevos
Created December 25, 2009 16: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 pepijndevos/263669 to your computer and use it in GitHub Desktop.
Save pepijndevos/263669 to your computer and use it in GitHub Desktop.
(def actions (atom {}))
(defn register [action function]
(swap! actions assoc action (conj (action @actions) function)))
(defn do-action [action arg]
(reduce #(%2 %1) arg (action @actions)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment