Quantcast
Channel: w3courses.com - Member
Browsing latest articles
Browse All 2 View Live

Check if an Element is a Member of a List using Scheme Source Code

The following code checks if an element is a member of a listCODE (define (member? x y)      (cond ((null? y) #f) ((eqv? x (car y)) #t)             (else (member? x (cdr y)))))RESULT> (member_list...

View Article


List Member Function using Prolog Source Code

The following code checks if an element is a member of a given listCODE member(X, [X|Y]). member(X, [H|L]) :- member(X, L).RESULT ?- member(b, [a,b,c]). Yes

View Article

Browsing latest articles
Browse All 2 View Live