(define (list-length-iter-cps lst res k0) (cond ((null? lst) (k0 res)) ((pair? lst) (list-length-iter-cps (cdr lst) (+ res 1) k0)) (else (k0 'improper-list)))) ; k0 is passed along the tail recursive calls, and ; can also be used for passing 'an exceptional value'.