I have been working on the following function flatten and so far have it working for just lists. I was wondering if someone could provide me with some insight on how to get
Here's one option:
(define (flatten x) (cond ((null? x) '()) ((pair? x) (append (flatten (car x)) (flatten (cdr x)))) (else (list x))))