Q:

Check If Two Sets Are Equal - Scheme

;checks to see if two sets (represented as lists) are equal

(define (setsEqual? S1 S2)
(cond
 ( (null? (cdr S1)) (in_member S1 S2))
 ( (in_member (car S1) S2) (setsEqual? (cdr S1) S2))
 (else false)))

;checks for an element in the list
(define (in_member x list)
(cond
 ( (eq? x (car list)) true)
 ( (null? list) false)
 (else (in_member x (cdr list)))))

Can't seem to find a base case to get this working. Any help is appreciated!

A:

What is a set? (It's a list---okay, what is a list?) Here's a hint: there are two variants of "list": '() (aka null, aka empty) and those made with cons. Your function(s) should follow the structure of the data they consume. Yours don't.
I recommend reading How to Design Programs (text available online); it will teach you a "design recipe" for tackling problems like these. The rough outline is: describe your data semi-formally (that answers what is a list?), formulate examples and tests; use your description of the data to create a template for processing that kind of data; finally, fill in the template. The key thing is that the template is determined by the data definition. It's reusable, and filling in the template for a specific function can often be done in seconds---if you've created your template and examples correctly.
HtDP Chapter 9 talks about processing lists, specifically. That'll help with in_member. 
Chapter 17 talks about processing multiple complex arguments (eg, two lists at once). One more hint: if I were writing this function, I would make use of the following fact about sets: two sets are equal if each is a subset of the other.

