Warning: Parameter 3 to processTexinfoTag() expected to be a reference, value given in /Users/gambit/Sites/wiki/includes/parser/Parser.php on line 3333

Warning: Parameter 3 to processTexinfoTag() expected to be a reference, value given in /Users/gambit/Sites/wiki/includes/parser/Parser.php on line 3333
Documentation:Procedure call-with-current-continuation - Gambit wiki

Documentation:Procedure call-with-current-continuation

From Gambit wiki

(Difference between revisions)
Jump to: navigation, search
m (Initial submission)
 
Line 15: Line 15:
===User contributed comments, clarifications and examples===
===User contributed comments, clarifications and examples===
 +
 +
These procedures return a procedure that invokes the continuation, and not the continuations themselves.
 +
 +
    > (procedure? (call/cc (lambda (k) k)))
 +
    #t
 +
    > (continuation? (call/cc (lambda (k) k)))
 +
    #f
 +
    > (procedure? (continuation-capture (lambda (k) k)))
 +
    #f
 +
    > (continuation? (continuation-capture (lambda (k) k)))
 +
    #t
<texinfo>
<texinfo>

Latest revision as of 04:05, 11 October 2009



User contributed comments, clarifications and examples

These procedures return a procedure that invokes the continuation, and not the continuations themselves.

   > (procedure? (call/cc (lambda (k) k)))
   #t
   > (continuation? (call/cc (lambda (k) k)))
   #f
   > (procedure? (continuation-capture (lambda (k) k)))
   #f
   > (continuation? (continuation-capture (lambda (k) k)))
   #t


Personal tools
documentation