From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!npeer.kpnqwest.net!nreader1.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: How to reverse a list... References: <5b829932.0112030950.3f96120b@posting.google.com> <3C0C09D7.AB4C24F5@isomedia.com> <3216418834714099@naggum.net> Mail-Copies-To: never From: Erik Naggum Message-ID: <3216475795291629@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 29 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Tue, 04 Dec 2001 17:29:56 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader1.kpnqwest.net 1007486996 193.71.66.49 (Tue, 04 Dec 2001 18:29:56 MET) NNTP-Posting-Date: Tue, 04 Dec 2001 18:29:56 MET Xref: archiver1.google.com comp.lang.lisp:21862 * Erik Naggum > Traversing a vector is not particularly hard, either: > > (do ((forward 0 (1+ forward)) > (backward (1- (length vector)) (1- backward)) > (reversed (copy-seq sequence))) > ((minusp backward) reversed) > (setf (aref reversed backward) (aref reversed forward))) * Wolfhard Buß | Probably | | (do ((forward 0 (1+ forward)) | (backward (1- (length sequence)) (1- backward)) | (reversed (copy-seq sequence))) | ((<= backward forward) reversed) | (rotatef (aref reversed backward) (aref reversed forward)))) | | comes close to your intentions. That's a good variation. What I intended was actually to use (aref sequence forward), but it got mixed up somehow. /// -- The past is not more important than the future, despite what your culture has taught you. Your future observations, conclusions, and beliefs are more important to you than those in your past ever will be. The world is changing so fast the balance between the past and the future has shifted.