Skip to content

Instantly share code, notes, and snippets.

@piyushmaurya23
Last active October 31, 2017 20:58
Show Gist options
  • Save piyushmaurya23/71a4e66202158827f552 to your computer and use it in GitHub Desktop.
Save piyushmaurya23/71a4e66202158827f552 to your computer and use it in GitHub Desktop.
7. Define a Recursive LISP function which takes one argument as a list and returns reverse of the list. (do not use reverse predicate)
(defun list_append(l1 l2)
(if (null l1)
l2
(cons (first l1)(list_append (rest l1) l2))))
(defun list_reverse(l)
(if (null l)
nil
(list_append (list_reverse (rest l))
(list (first l)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment