compose &rest functions => composite-function
Arguments and Values:
functions---a list of designators for functions.
composite-function---a function created by composing functions.
compose returns a function which is created by composing functions right-associatively.
This implementation is fairly straightforward, but very inefficient. In my benchmarks, I found it to be orders of magnitude slower than writing out an equivalent lambda function. However, a compiler macro speeds up some common cases immensely:
This version allows composition of functions with multiple arguments and return values.
Alexandria contains this function. (likely nonexhaustive)