They're saying that
(defun user-reverse (l)
(if (endp l)
nil
(append (user-reverse (rest l))
(list (first l)))))
Is bad because of n(n + 1)/2 of computation.
Then they say go this way :
(defun user-reverse (l &optional result)
(if (endp l)
result
(user-reverse (rest l)
(cons (first l) result))))
So I was thinking, why couldn't you do something like this instead :
(defun user-reverse (l)
(do ((new-list nil))
((endp l) new-list)
(push (pop l) new-list)))
Is any of this a bad habit or anything? Or does it copy the list or something? They teach 'DO' a couple chapters back and was wondering if any of the LISPers out can say if this is on par or worse or what not to their example? Basically, was wondering in terms of their bad 'n' example how it stands up?