Skip to content

Instantly share code, notes, and snippets.

@mpjdem
Last active September 3, 2019 16:55
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 mpjdem/11a275520d45bd82fadde01310573b61 to your computer and use it in GitHub Desktop.
Save mpjdem/11a275520d45bd82fadde01310573b61 to your computer and use it in GitHub Desktop.
'Command' design pattern in Clojure
(defn compose-quote [body-part creature-name]
(println (str "Go for the " body-part ", " creature-name "!")))
(defn execute [command & args]
(Thread/sleep 1000)
(apply command args))
(execute compose-quote "eyes" "Boo")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment