flatten   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/scheme.xtm

Implementation

;; flatten down to a list of atoms
(define (flatten list)
   (cond ((null? list) '())
   ((list? (car list)) (append (flatten (car list)) (flatten (cdr list))))
   (else (cons (car list) (flatten (cdr list))))))


Back to Index

Similar Entries