l is a list. The procedure is supposed to turn a list l into a set. Yes I know a primitive set exists in Scheme. This is just a data structures exercise I'm doing.
2. '() - the empty list () is illegal in Scheme, so you quote it to keep it from being evaluated.
3. A well-structured program helps - break it up into lots of small, pure (whenever possible) functions and debug each separately. If you're having trouble with a single function, just choose an input and step through the function, looking at which branches it takes, the values of intermediate variables, etc. I just do this by hand, not with a debugger, which shouldn't be hard for smaller functions.
Name:
Anonymous2012-08-17 15:54
>>4's got it right
I personally tend to write
(cond ((null? l) l))
Name:
Anonymous2012-08-17 16:56
>>2
You can use memq, memv and member? to find elements in a list, they are part of R5RS.