cl:set-difference   scheme


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

Implementation

(define (cl:set-difference lst1 lst2)
  (if (null? lst2)
      lst1
      (let build-difference ((lst1 lst1)
           (result '()))
  (cond ((null? lst1) (reverse result))
        ((member (car lst1) lst2) (build-difference (cdr lst1) result))
        (else (build-difference (cdr lst1) (cons (car lst1) result)))))))
;@


Back to Index