cl:list-flatten   scheme


Defined in:  https://github.com/lambdamusic/extempore-extensions/blob/main/init/init_lisp.xtm

Implementation

;
;(list-flatten '(9 9 (9 9 9 ))))  = (9 9 9 9 9)
(define cl:list-flatten 
   (lambda (l)
      (cond ((null? l)
             '())
            ((atom? l)
             (list l))
            (#t (append (cl:list-flatten  (car l)) (cl:list-flatten  (cdr l)))))))


Back to Index

Similar Entries