| Simulation of other Paradigms and Continuations - slide 24 : 43 |
(define (list-length lst)
(catch 'exit
(letrec ((list-length1
(lambda (lst)
(cond ((null? lst) 0)
((pair? lst) (+ 1 (list-length1 (cdr lst))))
(else (throw 'exit 'improper-list))))))
(list-length1 lst))))






