Subject: Re: Help
From: Erik Naggum <clerik@naggum.no>
Date: 1998/03/20
Newsgroups: comp.lang.lisp
Message-ID: <3099401333254064@naggum.no>


* temp <laleave@ibm.net>
| Hi I am trying to write an iterative lisp function that given a list A
| returns a list with everything in A repeated twice consecutively.  For
| example A = [a,b,c] then the newlist = [a,a,b,b,c,c]. Any help would be
| greatly appreciated. Thanks.

  first, you have a pretty weird syntax for lists, but I guess you still
  mean lists like (A B C) and (A A B B C C) not something else entirely.

  however, back to your homework assignment: as you may have found out,
  there are many ways to do what you want to do, but I have not yet seen
  the simple _iterative_ solutions:

(loop for e in <list> collect e collect e)

  I'm sure you are not allowed to use LOOP, but rewriting this to use DO or
  DOLIST shouldn't be too hard.

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