; compare Program 11.8, pg. 353 - (define while-proc ; TYPE: (-> ((-> () boolean) (-> () void)) ; void) (lambda (pred-th body-th) ; EFFECT: do the pred-th, if it's true do the body-th; ; repeat until the pred-th is false. (letrec ((loop ; TYPE: (-> () void) (lambda () (if (pred-th) (begin (body-th) (loop)))))) (loop))))