Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!swrinde!ucsd!pacbell.com!pacbell!att!cbnewsc!lgm From: lgm@cbnewsc.att.com (lawrence.g.mayka) Newsgroups: comp.lang.lisp Subject: Re: Adding items to the end of a list. Summary: Series, MAPCAR, LOOP are alternatives Message-ID: <1990Sep7.005109.27309@cbnewsc.att.com> Date: 7 Sep 90 00:51:09 GMT References: <1990Sep5.011910.1177@mentor.com> <3372@skye.ed.ac.uk> Organization: AT&T Bell Laboratories Lines: 25 In article <3372@skye.ed.ac.uk>, jeff@aiai.ed.ac.uk (Jeff Dalton) writes: > In article <1990Sep5.011910.1177@mentor.com> plogan@mentor.com (Patrick Logan) writes: > >I see a lot of LISP code building lists backwards and then reversing > >them. I don't know if I've ever seen any C code doing that. Is it too > >easy to write sloppy code in LISP? I don't think it is any more > >difficult to write efficient list manipulations in Scheme than it is > >in C. > > How soon they forget. What do you think `tconc' (Interlisp, > Franz Lisp, etc.) was for? > > For a more modern approach, look at Appendix B, "Generators and > Gatherers" in Guy Steele Jr.'s CLtL II. (It's similar to your > object-oriented technique.) The "Series" of Appendix A are often useful here too, as well as old standbys like MAPCAR. Otherwise, I use the COLLECT keyword of the new expanded LOOP macro. Lawrence G. Mayka AT&T Bell Laboratories lgm@iexist.att.com Standard disclaimer.