tree-member   scheme


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

Implementation

(define (tree-member mem tree)
  (if (member #t
              (flatten
               (let loop ((tree tree))
                 (if (pair? tree)
                     (cons (loop (car tree)) (loop (cdr tree)))
                     (if (null? tree) '()
                         (if (equal? tree mem) #t #f))))))
      #t #f))


Back to Index