[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sat, 26 Jan 2002 16:51:06 +0900 (KST)
First of all, I have to say thank you very much those whom
have answered my trivial questions so far.
I cannot understand what the meaning of `continuation', and
how to do with `call-with-current-continuation'.
I've read several guile documents in addition to the book,
`The Scheme Programming Language -ANSI SCHEME-', but
I could understand neither.
Is there anyone can explain the basic idea of `continuation'
and can show some simple, brief and fullly explained example?
Or just let me know which document or book will be a good start.
In addition, the book says:
call/cc must be passed a procedure P of one argument.
call/cc obtains the current continuation add passes
it to P. The continuation itself is represented by a
procedure K. Each time K is applied to a value, it
returns the value to the continuation of the call/cc
(1) What's the exact meaning of `application' in the above
quotation? I suppose that meaning might be the same which
can be found in the Scheme grammer (also found in the book):
<application> -> (<expression> <expression>*)
(2) What's the exact meaning of *CURRENT* continuation?
Does it mean the expression that will be evaluate next?
(* 5 (k 4))))
I think that the `current continuation' of above code
is "(call/cc (lambda ...))" itself. Right?
(3) What's wrong in this code?
(* 5 k)))
=> ABORT: (wrong-type-arg)
In the code of question 2, 3, "call/cc" is an abbreviation of
"call-with-current-continuation" as you expected.
Korean version: http://pcrc.hongik.ac.kr/~cinsk/
Seong-Kook Shin <=