Removing last two elements from a list in Lisp

Viewed 1243

I need to remove the last two elements from a list in common list, but I can remove only one. What's the way?

(defun my-butlast (list)
        (loop for l on list
              while (rest l)
              collect (first l)))
2 Answers
Related