看了一两个小时才看明白,什么叫continuation,
其实是这样的
举个例子
(+ 1 (call/cc
(lambda (k)
(+ 2 (k 3)))))
the rest of the program, from the point of view of the call/cc
-application, is the following program-with-a-hole (with []
representing the hole):
(+ 1 [])
In other words, this continuation is a program that will add 1
to whatever is used to fill its hole.
上面这段英文是说,从call/cc开始的剩下的代码,也就是(+ 1 []),"[]"就代表了一个位置,而continuation k就代表了(+ 1 []),其实k就是也个保存了加1运算的全局变量,只要你以后绑定k的值,比如(k 100),那么就会把100放在[]处,然后继续加1运算