Added a list flattening procedure
1 files changed, 8 insertions(+), 0 deletions(-)

A => flatten.scm
A => flatten.scm +8 -0
@@ 0,0 1,8 @@ 
+;; Public domain code. Or CC0 if your jurisdiction doesn't have the notion of PD.
+
+(define (flatten lst)
+  (let loop ((lst lst) (acc '()))
+    (cond
+     ((null? lst) acc)
+     ((pair? lst) (loop (car lst) (loop (cdr lst) acc)))
+     (else (cons lst acc)))))