Define a recursive lisp function which takes one argument as a list and return last element of list
Answers
Answered by
2
Code:
(defun last-list (list)
(if (endp list)
nil
(let ((result (last-list (rest list))))
(if (not (null result))
result
(if (listp (first list))
(first list)
nil)))))
Similar questions