#Prictice 2.60
(define (element-of-set? x set)
(cond ((null? set) '())
((equal? x (car set)) #t)
(else (element-of-set? x (cdr set)))))
(define (adjoin-set x set)
(cons x set))
(define (union-set set1 set2)
(append set1 set2))
(define (intersection-set set1 set2)
(cond ((or (null? set1) (null? set2)) '())
((element-of-set? (car set1) set2)
(cons (car set1)
(intersection-set (cdr set1) (remove-element-set (car set1) set2))))
(else (intersection-set (cdr set1) set2))))
(define (remove-element-set x set)
(cond ((null? set) '())
((equal? x (car set)) (cdr set))
(else (cons (car set) (remove-element-set x (cdr set))))))
(define (remove-element-set x set)
(define (remove-element-set-iter acc origin)
(cond ((null? origin) acc)
((equal? (car origin) x) (append acc (cdr origin)))
(else (remove-element-set-iter (cons (car origin) acc) (cdr origin)))))
(remove-element-set-iter '() set))