gscheme/examples/call-cc.scm

12 lines
225 B
Scheme
Raw Normal View History

2022-08-05 05:28:40 -04:00
(define rec
(lambda (n stop)
(display n) (newline)
(if (= n 0) (stop 0)
(begin
(rec (- n 1) stop)
(display n) (newline)))))
(rec 6 (lambda (x) '()))
(call-with-current-continuation
(lambda (t) (rec 6 t)))