Skip to content

Instantly share code, notes, and snippets.

@sw-samuraj
Last active April 4, 2017 09:08
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 sw-samuraj/1542b459b1f1f0db36bd083cc52d20e7 to your computer and use it in GitHub Desktop.
Save sw-samuraj/1542b459b1f1f0db36bd083cc52d20e7 to your computer and use it in GitHub Desktop.
An example of currying on Clojure for a blog post.
(defn spicy [first second third]
(println "I like food with" first "," second "and" third "."))
(def curry (partial spicy "curry"))
(def more-curry (partial curry "curry"))
(def curry-and-chilli (partial more-curry "chilli"))
(curry-and-chilli)
;; -> I like food with curry , curry and chilli .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment