Created
April 12, 2015 14:13
-
-
Save kouddy/7ced4203ed2950b05ae6 to your computer and use it in GitHub Desktop.
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
(define (subsets s) | |
(if (null? s) | |
(list null) | |
(let ((rest (subsets (cdr s)))) | |
(append rest ;;; append is like + for list | |
(map (lambda (l) (cons (car s) l)) rest))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment