I am using this script from The little schemer, to get intersection of two sets. But I am getting unbound identifier error at \'member?\', can anyone please tell what\'s wrong w
My intersection solution:
#lang racket
(define (intersect set1 set2)
(cond [(empty? set1) '()]
[(empty? set2) '()]
[(= (caar set1) (caar set2)) (cons (list (caar set1)
(+ (cadar set1)
(cadar set2)))
(intersect (cdr set1) (cdr set2)))]
[(< (caar set1) (caar set2)) (intersect (cdr set1) set2)]
[else (intersect set1 (cdr set2))]))