Skip to content

Instantly share code, notes, and snippets.

@mpjdem
Last active September 3, 2019 16:55
Show Gist options
  • Select an option

  • Save mpjdem/11a275520d45bd82fadde01310573b61 to your computer and use it in GitHub Desktop.

Select an option

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")
@mpjdem

mpjdem commented Aug 30, 2019

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment