Check element is in list or not Scheme
Posted: Thu Apr 26, 2018 10:32 am
I am trying to write a function which is checking whether element is in list(return true) or not(return false.)
In this case my expected output is #t but i get Error: execute: unbound symbol: "el" [in?] error.
another test case is :
my expected output is #f
Code: Select all
(define in? (lambda ('el lst)
(cond ((member el lst '#t) (else '#f)))
))
(in? 3 '(2 5 3))
another test case is :
Code: Select all
(in? 2 ’(1 (2) 5))