Skip to content

Instantly share code, notes, and snippets.

@ijp
Created October 21, 2014 00:28
Show Gist options
  • Save ijp/9e4c9c9a21821012cf34 to your computer and use it in GitHub Desktop.
Save ijp/9e4c9c9a21821012cf34 to your computer and use it in GitHub Desktop.
(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