More Tail Recursion - REMOVE
Here is a definition of REMOVE, using CONS
(define remove
(lambda (x l)
(cond ((null? l) NIL)
((eq? x (car l)) (remove x (cdr l)))
(else (cons (car l)
(remove x (cdr l)))))))
Note use of COND for case analysis
Previous slide
Next slide
Back to first slide
View graphic version