2017-03-06 11:00:18 -05:00
|
|
|
(load "functions.lisp")
|
|
|
|
|
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))
|
2017-03-06 11:00:18 -05:00
|
|
|
(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))
|
2017-03-06 11:00:18 -05:00
|
|
|
(first the-list))))))
|