Last active
March 16, 2018 11:42
-
-
Save Slackwise/5da78ed94b5c837e224e6182726e6f67 to your computer and use it in GitHub Desktop.
Reduce in Scheme: my favorite function ever, written as reduced as possible, using only special forms.
This file contains 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
(define (reduce f i l) | |
(if (null? l) | |
i | |
(f i (reduce f (car l) (cdr l))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment