previous | index | next

Scheme's list? Predicate and member Procedure

list? tests whether its argument is a list:
     (list? 'a) ⇒ #f

     (list? '(a b)) ⇒ #t

     (list? (cons 'a (cons 'b '()))) ⇒ #t

     (list? (cons 'a 'b)) ⇒ #f [not a true list]
member tests whether its first argument is a member of its second argument:
     (member 3 '(1 2 3 4 5)) ⇒ (3 4 5) [recall any non-#f value is true]

     (member 7 '(1 2 3 4 5)) ⇒ #f

     (member 3 "1 2 3 4 5") ⇒ Error - member: not a proper list: "1 2 3 4 5"

previous | index | next