Skip to content

Instantly share code, notes, and snippets.

@quii
Created July 24, 2015 13:14
Show Gist options
  • Save quii/5769807cc207959f0ccb to your computer and use it in GitHub Desktop.
Save quii/5769807cc207959f0ccb to your computer and use it in GitHub Desktop.
Function composition in Clojure
foo=> (defn x [a] (+ a 1))
#'foo/x
foo=> (defn y [a] (+ a 2))
#'foo/y
foo=> (-> 5 x y)
8
foo=> (defn z [a] (-> a x y))
#'foo/z
foo=> (z 10)
13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment