2016-12-07 14:16:45 -05:00
|
|
|
(defun reverse (the-list)
|
2017-03-03 15:06:49 -05:00
|
|
|
(if the-list
|
|
|
|
(append
|
|
|
|
(reverse (rest the-list))
|
|
|
|
(list (first the-list))
|
2016-12-07 14:16:45 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defun deep-reverse (the-list)
|
2017-03-03 15:06:49 -05:00
|
|
|
(if the-list
|
|
|
|
(append
|
|
|
|
(deep-reverse (rest the-list))
|
|
|
|
(list
|
|
|
|
(if (listp (first the-list))
|
|
|
|
(deep-reverse (first the-list))
|
|
|
|
(first the-list)
|
|
|
|
)
|
|
|
|
)
|
2016-12-07 14:16:45 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2017-03-03 15:06:49 -05:00
|
|
|
|