euclid-distribute-zeros   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/pattern-language.xtm

Implementation

(define euclid-distribute-zeros
  (lambda (dst-undst)
    (let loop ((out '())
               (dst (car dst-undst))
               (undst (cadr dst-undst)))
      (if (or (null? dst) (null? undst))
          (append (list (reverse out))
                  (if (null? dst) '() (list dst))
                  (if (null? undst) '() (list undst)))
          (loop (cons (append (car dst) (car undst)) out)
                (cdr dst)
                (cdr undst))))))


Back to Index