I try to reverse a list, i can't use the function "nreverse"
I try :
(defun dolist-reverse (l)
(let ((new-list (make-list (length l))))
(dolist (x l new-list)
(setf new-list (cons x new-list)))))
But the result is :
CL-USER> (dolist-reverse '(1 2 3))
(3 2 1 NIL NIL NIL)
How can i do ? (i need to use dolist)
EDIT :
Finally fix my problem :
(defun dolist-reverse (l)
(let ((new-list))
(dolist (x l new-list)
(setf new-list (cons x new-list)))))