Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (foreach f l)
- (define iter '())
- (set! l (call-with-current-continuation
- (lambda (continuation)
- (set! iter continuation)
- l)))
- (if (not (null? l))
- (begin
- (f (car l))
- (iter (cdr l)))))
- (foreach write '(1 2 3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement