(dsssl) flatten list procedure

Subject: (dsssl) flatten list procedure
From: "Maltby, David G" <david.g.maltby@xxxxxxxx>
Date: Wed, 18 Apr 2001 08:58:42 -0400
I am looking for some help with what seems like a textbook Scheme problem
(although I could not find it in any of my Scheme textbooks).

I would like to have a procedure that takes a list, which may be a list of
lists, and returns a flattened list.  For example with input list ((a b) c d
((e f g) h i)) it would return (a b c d e f g h i), although order of the
atoms of the return list are not important to me.

My feeble thinking on this that if we let l be an arbitrary list, that if
the (car l) is a list then I would examine the (car (car l)) until it the
(car ...) is not a list.  Then I can cons that to my new list.  But how do I
get to the cdr of the inner lists?

Regards, David

 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist

Current Thread