University of Washington • CSE583 • D. Notkin © 2000
37
Tail recursion examples
l(define (last x)
  (if (null? (cdr x)) (car x)
      (last (cdr x))))
l(define (member e x)
  (cond ((null? x) #f)
        ((eqv? e (car x) #t)
        (else (member e (cdr x)))))
lThe bold-italics invocations represent the final thing that the function does
–After that, it’s just a bunch of returns that don’t “do” anything