Last active
August 29, 2015 14:11
-
-
Save tkhoa2711/516800ce50370f8f2385 to your computer and use it in GitHub Desktop.
Reverse nested list in Common Lisp
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
(defun reverse-nested-list (list) | |
"reverse nested list" | |
(mapcar #'(lambda (l) | |
(if (not (consp l)) | |
l | |
(reverse-deep l))) | |
(reverse list))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment