This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

Check element is in list or not Scheme

1 post · 1445 views

I am trying to write a function which is checking whether element is in list(return true) or not(return false.)

(define in? (lambda ('el lst)
(cond ((member el lst '#t) (else '#f)))

))



(in? 3 '(2 5 3))
In this case my expected output is #t but i get Error: execute: unbound symbol: "el" [in?] error.

another test case is :
 (in? 2 ’(1 (2) 5))
my expected output is #f