Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!shelby!neon!Gang-of-Four.Stanford.EDU!iam From: iam@Gang-of-Four.Stanford.EDU (Ian Mason) Newsgroups: comp.lang.lisp Subject: Re: Adding items to the end of a list. Message-ID: <1990Sep5.175308.20173@Neon.Stanford.EDU> Date: 5 Sep 90 17:53:08 GMT References: <1990Sep5.011910.1177@mentor.com> Sender: news@Neon.Stanford.EDU (USENET News System) Reply-To: iam@Gang-of-Four.Stanford.EDU (Ian Mason) Organization: Stanford University Lines: 21 i am not sure i understand the point of the posting. it is just as easy to write a tail recursive version of copy-list that conses onto the front, and the trick of course generalizes to the usual list recursion. since i am not fluent in scheme here it is in vanila lisp (defun copylist (l) (if (null l) l (let ((w (cons (car l) (cdr l))))(loop (cdr l) w w)))) (defun loop (x y z) (if (null x) z (let ((w (cons (car x) (cdr x)))) (progn (rplacd y w)(loop (cdr x) w z))))) a correctness proof can be found in "science of computer programming 10 1988 177-210" -iam-