Subject: Re: Multivalue tail recursion?
From: rpw3@rpw3.org (Rob Warnock)
Date: Sun, 09 Sep 2007 19:42:39 -0500
Newsgroups: comp.lang.lisp
Message-ID: <u7ednZ1ZWcRiD3nbnZ2dnUVZ_v-hnZ2d@speakeasy.net>
David Trudgett  <dtrudgett@yahoo.com> wrote:
+---------------
| But in CL we don't use recursive procedure definitions to do
| iteration. We use iterative constructs instead:
|     (LOOP FOR ITEM IN '(SOME SORT OF LIST) COLLECT ITEM) 
|     => (SOME SORT OF LIST)
| Of course, this solution doesn't look nearly as impressive and also
| neglects to reverse the order of the items in the list...
+---------------

And even if one were resisting LOOP for sme odd reason,
there are still plenty of other ways to do it in CL, e.g.:

    > (let (accum)
	(dolist (i '(some sort of list) accum)
	  (push i accum)))

    (LIST OF SORT SOME)
    > 

Of course, for that *particular* semantics you'd be better
of with simply:

    > (reverse '(some sort of list))

    (LIST OF SORT SOME)
    > 


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607