From: Ken Forbus

Subject: Re: My clumsy solution to flattening

Date: 1999-3-3 10:37

Please stop using this mailing list for random lisp questions.  This is a
technical support list
for a particular Lisp product.  The kind of discussion you are having
belongs on a newsgroup, such as comp.lang.lisp, not a private forum such as
this one.

I am sending this to the entire list as a reminder that, by responding to
such inappropriate questions, you are only encouraging people to abuse this
list.  Apologies for the bandwidth, but not the message: Please CUT IT OUT.
 Thanks.

	Ken

At 07:28 AM 3/3/99 -0500, Darren Teemull wrote:
>Thanks for all the suggestions from the people who responded to my >earlier questions. This is what I finally came up with (Sorry, but I >don't think it matches anyone's suggestion, but that's simply because of >my ineptness at Lisp) feel free to rip it apart and improve on it if you >like. > >Solution to the flattening and combining of two lists, each containing >any amount of nested lists and brackets (eg. 1=((a b) c) & 2=(d ((e) f)) >then (flatten 1 2) = (a b c d e f)) : > >(defun flatten (fl1 fl2) > (cond ((null fl2) NIL) > (t (cond ((null fl1) (flatten fl2 (cdr fl2))) > ((listp (car fl1)) > (cons (car (flatten (car fl1) fl2)) > (if (null (cdr (car fl1))) > (flatten (cdr fl1) fl2) > (flatten (cons (cdr (car fl1)) (cdr >fl1)) fl2)))) > (t (cons (car fl1) (flatten (cdr fl1) >fl2))))))) > >Thanks & Later, >DFT >Software Engineering student, University of Toronto > > >