CL-CONT

This page contains basic information about cl-cont.

Lambda

What is cl-cont?

cl-cont is a code walker that implements delimited continuations in Common Lisp.

How do I use it?

Here is a simple example:

(with-call/cc (+ 1 (call/cc (lambda (k)
                               (setf cc k)
                               (funcall k 2)))))
=> 3

(funcall cc 3)
=> 4

(funcall cc 10)
=> 11
	  

Instead of call/cc one can use a helper macro let/cc.

(with-call/cc (+ 1 (let/cc k
                     (setf cc k)
                     (funcall k 2))))
=> 3
	  

What subset of Common Lisp is supported by cl-cont?

All special operators listed under http://www.lisp.org/HyperSpec/Body/sec_3-1-2-1-2-1.html are supported with the following limitation: call/cc cannot appear within the body of catch, throw, progv, or unwind-protect.

Because compilers often expand standard macros into non-standard CL code, supporting all special operators is not sufficient to support all of Common Lisp. cl-cont makes special arrangements to support defun. Currently defgeneric and defmethod are not supported. Additional cases will be handled as they are exposed.

Calling call/cc from functions passed to standard functions (like mapcar) is not supported because standard functions have not been transformed to CPS style. Eventually cl-cont will provide its own version of commonly used standard functions that accept higher order parameters.

These limitations will be addressed as the need arises. Patches are welcome!

What license is cl-cont released under?

cl-cont is released under LLGPL (LGPL with Franz's preamble that resolves some Lisp related ambiguities). In human terms, you can use cl-cont for anything you want (including proprietary software), but you must release changes made to cl-cont itself for the world to enjoy.

Is cl-cont platform independent?

cl-cont is fully supported on SBCL, CMUCL, CLISP, Lispworks, AllegroCL, and OpenMCL.

How do I get cl-cont?

cl-cont is ASDF-installable. For information about the current version please see the changelog.

In addition the repository is available via darcs:

darcs get http://common-lisp.net/project/cl-cont/darcs/cl-cont

How do I get support?

Since cl-cont was written to support continuations in Weblocks web framework, for support questions please use Weblocks google group.

Special thanks to the kind folks at Franz Inc. for helping support cl-cont development.