我不明白以下内容如何不设置无限循环:
(define call/cc call-with-current-continuation) ; ccc alias
(define return #f) ; declare a global variable 'return'
(+ 1 (call/cc (lambda (cont) ; setup continuation with 'cont' as the exit procedure
(set! return cont) ; set global var 'return' to the exit procedure
1)))
(return 22) ; 23
当我调用 时(return 22)
,我跳回继续,但使用传递的值 22 作为call/cc
表单的新评估结果。这不会导致(return 22)
被评估为下一条语句,从而设置一个无限循环吗?
我知道这不是无限循环,但我不明白为什么不是。