ring wandering
(use srfi-1) (define (flatten xs) (if (pair? xs) (append-map flatten xs) (list xs)))
(define (flatten tree) (fold-right (lambda (e acc) (if (pair? e) (append (flatten e) acc) (cons e acc))) '() tree))
0 件のコメント:
コメントを投稿