tags:

views:

33

answers:

1
(define (member atom list)
  (cond
    ((null? list) '())
    (= atom (car list) "True")
      (else
      (member atom(cdr list)))
    )
 )

(member '5 '(1 2 3 4 5))

Always it gives true even though that atom isn't a member in the list. Could you plz help me to clarify this question as soon as possible.

+2  A: 

The second clause of cond should be:

((= atom (car list)) "True")
Vijay Mathew
Thank you very much! I missed a bracket.. This helped me lot!
NHans