| Duba, B., R. Harper, and D. MacQueen. Type-checking first-class continuations. In Conference Record of the 18th Annual ACM Symposium on Principles of Programming Languages, January 1991, pp. 163--173. |
.... of imperative programs for parallel programming [GL91] And Cl ement Pellerin has implemented a compiler from a concurrent constraint language to CML [Pel92] 5 Implementation CML is written entirely in SML, using a couple of non standard extensions provided by SML NJ: first class continuations [DHM91] and asynchronous signals [Rep90a] We added one minor primitive operation to the compiler (a ten line change in a 30,000 line compiler) which was necessary to guarantee that tail recursion is preserved by sync. Threads are implemented using first class continuations (a technique owed to 4 ....
Duba, B., R. Harper, and D. MacQueen. Type-checking first-class continuations. In Conference Record of the 18th Annual ACM Symposium on Principles of Programming Languages, January 1991, pp. 163--173.
.... available implementation of SML developed by Dave MacQueen and Andrew Appel, with contributions from a number of other people [AM87] It runs on a variety of UNIX based systemsand has a highly portable run time system [Appel90] SML NJ supports first class continuations as an extension [DHM] . Our mechanism treats asynchronous signals as continuation producing operations. A signal handler is a function from continuations to continuations: it takes take the current continuation at the time of the signal and returns a, possibly different, continuation. Because of the problems with ....
..... 2 Continuations in SML NJ SML NJ uses a continuation passing style (CPS) code generator, which produces high quality code [AJ89] The use of CPS in the compiler allows the easy introduction of first class continuations into the language. Unlike in Scheme, continuations are statically typed [DHM] ; they have the polymorphic type ff cont. There are two built in operations on continuations: val callcc : a cont a) a val throw : a cont ( a b) A cont is the type of a function representing the rest of the program with a formal parameter of type . Continuations are ....
Duba, B., R. Harper and D.B. MacQueen. "Type-checking first-class continuations," in preparation.
....accessible to the programmer as first class values. 3 The Scheme function callwith current continuation (call cc for short) calls a function with the current continuation as the argument. First class continuations are supported in SML NJ via an abstract type and two primitive functions [DHM91] type a cont val callcc : 1a cont 1a) 1a val throw : a cont a b These can be used to implement loops, back tracking, exceptions and various concurrency mechanisms, such ascoroutines [Wan80] and engines [DH89] For example, the following is a continuation based version (from ....
.... type a cont val callcc : 1a cont 1a) 1a val throw : a cont a b These can be used to implement loops, back tracking, exceptions and various concurrency mechanisms, such ascoroutines [Wan80] and engines [DH89] For example, the following is a continuation based version (from [DHM91] of the product function given in the previous section: fun product l = callcc ( fn exit = let fun loop ( n) n loop (0: throw exit 0 loop (i: r, n) loop (r, i n) in loop (l, 1) end) This function uses the continuation exit to short circuit the evaluation if 0 is ....
[Article contains additional citation context not shown here]
Duba, B., R. Harper, and D. MacQueen. Type-checking first-class continuations. In Conference Record of the 18th Annual ACM Symposium on Principles of Programming Languages, January 1991, pp. 163--173.
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC