Created
October 21, 2014 00:28
-
-
Save ijp/9e4c9c9a21821012cf34 to your computer and use it in GitHub Desktop.
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 (make-palindrome l) | |
(define (loop l suffix) | |
(if (null? (cdr l)) | |
(cons (car l) suffix) | |
(cons (car l) | |
(loop (cdr l) (cons (car l) suffix))))) | |
(if (null? l) | |
#f ; arbitrary choice | |
(loop l '()))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment