What is the function definition for member?

Posted by NHans on Stack Overflow See other posts from Stack Overflow or by NHans
Published on 2010-04-22T11:17:16Z Indexed on 2010/04/22 11:23 UTC
Read the original article Hit count: 153

Filed under:
(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.

© Stack Overflow or respective owner

Related posts about Scheme