2.23 Exercise 2.23
I have chosen to use nil as the return value rather than true. This isn’t exactly what I’d like to do, but I don’t think for-each should have a return value, and at this time I think this is closer to that.
(define (for-each f items) (if (null? items) nil ((lambda () (f (car items)) (for-each f (cdr items))))))