(define sum (lambda (lst) (if (null? lst) 0 (+ (car lst) (sum (cdr lst)))))) (define length (lambda (lst) (if (null? lst) 0 (+ 1 (length (cdr lst)))))) (define in? (lambda (elt lst) (cond ((null? lst) #f) ((equal? (car lst) elt) #t) (else (in? elt (cdr lst)))))) (define position-of-in (lambda (elt lst) (define iter (lambda (lst acc) (if (in? elt lst) (if (equal? elt (car lst)) acc (iter (cdr lst) (+ 1 acc))) (error "BK error in position-in, elt not in list" elt lst)))) (iter lst 0)))