Subject: Re: Problem with iteration
From: Erik Naggum <clerik@naggum.no>
Date: 1998/03/22
Newsgroups: comp.lang.lisp
Message-ID: <3099551227196509@naggum.no>


* Raffael Cavallaro
| (defun my-reverse (a-list)
|      (do ((n (- 1) (incf n)) (result '() (cons (nth n a-list) result)))
|          ((= n (- (length a-list) 1))  result )))

  yikes.

(defun my-reverse (list)
  (do ((reversed (list (pop list))
		 (cons (pop list) reversed)))
      ((endp list) reversed)))

#:Erik
-- 
  religious cult update in light of new scientific discoveries:
  "when we cannot go to the comet, the comet must come to us."