Last active
March 1, 2020 13:07
-
-
Save xhh/b1096cbfb434b32b51e60961f8b5c601 to your computer and use it in GitHub Desktop.
some clojure code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro comp* | |
"The left-to-right version of comp. | |
Takes a set of functions and returns a fn that is the composition | |
of those fns. The returned fn takes a variable number of args, | |
applies the leftmost of fns to the args, the next | |
fn (left-to-right) to the result, etc." | |
[& fns] | |
`(comp ~@(reverse fns))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment