Skip to content

Commit 920eda6

Browse files
Apply changes from by Linus Björnstam.
1 parent 9e6a39d commit 920eda6

File tree

6 files changed

+494
-312
lines changed

6 files changed

+494
-312
lines changed

compose.scm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(define (compose . functions)
2+
(define (make-chain thunk chain)
3+
(lambda args
4+
(call-with-values (lambda () (apply thunk args)) chain)))
5+
(if (null? functions)
6+
values
7+
(fold-left make-chain (car functions) (cdr functions))))

0 commit comments

Comments
 (0)