(index ("escape-procedure" 0) ("escape-procedure?" 550) ("continuation" 690) ("current" 788) ("continuation?" 1176) ("continuation->procedure" 1262) ("capture" 1397) ("graft" 1675) ("throw" 1791) ("catch" 1909) ("goto" 2267) ("call" 2394) ("continuations" 2502) ("continuations-used" 2600) ("make-amb" 2718) ("make-threads" 2870) ("iterate" 3066))
(def (sig (procedure "(escape-procedure)" (id escape-procedure))) (p "captures and returns the current continuation as an escape procedure. Typically used as follows") (highlight scheme "(let ((cc (escape-procedure)))\n  (cond\n    ((escape-procedure? cc)\n     ;; normal body\n     ;; possibly calling (cc val) ...\n    ((ok? cc)\n     ;; exceptional case\n     ;; do something with cc ...))") (p "Note, that the let is invoked twice, first after the call to escape-procedure, then with the object val, which was bound to cc by calling (cc val)."))
(def (sig (procedure "(escape-procedure? xpr)" (id escape-procedure?))) (p "type predicate, defined simultaneously with escape-procedure"))
(def (sig (procedure "(continuation)" (id continuation))) (p "deprecated, use current instead."))
(def (sig (procedure "(current)" (id current))) (p "captures and returns the current continuation. Typically used as follows") (highlight scheme "(let ((cc (current)))\n  (if (continuation? cc)\n    ... (throw cc val) ...\n    ... do something with val ...))") (p "Note, that the let is invoked twice, first after the call to current, then with the object val, which was thrown to cc."))
(def (sig (procedure "(continuation? xpr)" (id continuation?))) (p "type predicate"))
(def (sig (procedure "(continuation->procedure cont)" (id continuation->procedure))) (p "transforms a continuation into a procedure"))
(def (sig (procedure "(capture proc)" (id capture))) (p "The same as call/cc but with a different datatype: Captures the current continuation as a continuation datatype (contrary to a procedure datatype in call/cc) and calls proc with that continuation as its only argument."))
(def (sig (procedure "(graft cont thunk)" (id graft))) (p "tail-calls thunk with the implicit continuation cont."))
(def (sig (procedure "(throw cont val ....)" (id throw))) (p "throws the values val .... to the continuation cont."))
(def (sig (syntax "(catch cont xpr ....)" (id catch))) (p "The same as let/cc of miscmacros but with a different datatype: Binds the cont variable to the current continuation as a continuation and executes the body xpr .... in this context. Typically used as follows") (pre " ") (highlight scheme "(catch k\n  ...\n  (if ...\n    (throw k val)\n    ...))"))
(def (sig (procedure "(goto cc)" (id goto))) (p "The infamous goto, but with a continuation as argument instead of a label."))
(def (sig (procedure "(call receiver)" (id call))) (p "The same as call/cc, but implemented via capture."))
(def (sig (procedure "(continuations sym ..)" (id continuations))) (p "documentation procedure"))
(def (sig (procedure "(continuations-used sym ..)" (id continuations-used))) (p "the usual documentation procedure"))
(def (sig (procedure "(make-amb)" (id make-amb))) (p "produces an ambiguous choice object, which accepts three messages, 'choose, 'fail and 'assert."))
(def (sig (procedure "(make-threads)" (id make-threads))) (p "produces a threads object, which accepts five messages, 'halt, 'quit, 'spawn, 'yield and 'start, implementing cooperative threads."))
(def (sig (syntax "(iterate var iterator xpr . xprs)" (id iterate))) (p "iterates var over iterater and applies the body, xpr . xprs, to each item. iterator should be a curried procedure of a container and a yield routine, the latter supplying one value at each pass."))
