The cl-cont Reference Manual

This is the cl-cont Reference Manual, version 0.3.8, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:50:58 2024 GMT+0.

Table of Contents


1 Systems

The main system appears first, followed by any subsystem dependency.


1.1 cl-cont

A library that implements continuations by
transforming Common Lisp code to continuation passing style.

Maintainer

Leslie P. Polzer <>

Author

Slava Akhmechet, Stephen Compall <>

License

LLGPL

Version

0.3.8

Dependencies
  • closer-mop (system).
  • alexandria (system).
Source

cl-cont.asd.

Child Component

src (module).


2 Modules

Modules are listed depth-first from the system components tree.


2.1 cl-cont/src

Source

cl-cont.asd.

Parent Component

cl-cont (system).

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 cl-cont/cl-cont.asd

Source

cl-cont.asd.

Parent Component

cl-cont (system).

ASDF Systems

cl-cont.

Packages

cl-cont-asd.


3.1.2 cl-cont/src/cont.lisp

Source

cl-cont.asd.

Parent Component

src (module).

Packages

cl-cont.

Public Interface
Internals

3.1.3 cl-cont/src/special-transformers.lisp

Dependency

cont.lisp (file).

Source

cl-cont.asd.

Parent Component

src (module).

Public Interface
Internals

3.1.4 cl-cont/src/helper-transformers.lisp

Dependencies
Source

cl-cont.asd.

Parent Component

src (module).

Public Interface

3.1.5 cl-cont/src/walker.lisp

Dependencies
Source

cl-cont.asd.

Parent Component

src (module).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cl-cont

A library that implements continuations by transforming Common Lisp code to continuation passing style.

Source

cont.lisp.

Nickname

cont

Use List

common-lisp.

Public Interface
Internals

4.2 cl-cont-asd

Source

cl-cont.asd.

Use List
  • asdf/interface.
  • common-lisp.

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Macros

Macro: defcpstransformer (name lambda-list &body body)

A macro that allows defining special case CPS transformers.

Package

cl-cont.

Source

cont.lisp.

Macro: defun/cc (name arglist &body body)

A helper macro to define a function that supports CALL/CC.

Package

cl-cont.

Source

helper-transformers.lisp.

Macro: lambda/cc (args-list &body body)

A helper macro that wraps LAMBDA definitions with WITH-CALL/CC.

Package

cl-cont.

Source

special-transformers.lisp.

Macro: let/cc (k &body body)

A shortcut for CALL/CC.

Package

cl-cont.

Source

special-transformers.lisp.

Macro: with-call/cc (&body body)

Gives access to CALL/CC by transforming BODY to continuation passing style.

Package

cl-cont.

Source

walker.lisp.

Macro: without-call/cc (&body body)

A macro that allows writing macros to produce non-CPS code uniformly within and without with-call/cc.

Package

cl-cont.

Source

helper-transformers.lisp.


5.1.2 Ordinary functions

Function: call/cc (cc)

Implements delimited continuations.

Package

cl-cont.

Source

special-transformers.lisp.

Function: copy-transformation-context (ctx)

Copies transformation context. This is used for cases when the context has to be ’frozen’ in time and used at a later transformation stage.

Package

cl-cont.

Source

cont.lisp.

Function: cpstransformer (name)

Returns a CPS transformer named by a given NAME.

Package

cl-cont.

Source

cont.lisp.

Function: expr->cps (expr k-expr env)

Transforms expression to CPS style.

Package

cl-cont.

Source

walker.lisp.

Function: expr-sequence->cps (expr-list k-expr env)

Converts a list of expressions to be evaluated in order to CPS style.

Package

cl-cont.

Source

special-transformers.lisp.


5.1.3 Standalone methods

Method: describe-object :after ((obj funcallable/cc) stream)
Source

special-transformers.lisp.

Method: (setf documentation) ((obj funcallable/cc) (doc-type (eql function)))
Source

special-transformers.lisp.

Method: documentation ((obj funcallable/cc) (doc-type (eql function)))
Source

special-transformers.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *special-form-transformers*

A hashtable that maps symbols to functions. Each function acts as a transformer of a special form and must accept three arguments: an s-expression to transform to CPS-style, an an s-expression to continue to, and an environment object.

Package

cl-cont.

Source

cont.lisp.


5.2.2 Macros

Macro: apply/cc (fdesignator k &rest args)

Implements FUNCALL for a CPS converter.

Package

cl-cont.

Source

special-transformers.lisp.

Macro: expand-form (form)

A helper macro that expands forms by considering local macros.

Package

cl-cont.

Source

cont.lisp.

Macro: funcall/cc (fdesignator k &rest args)

Implements FUNCALL for a CPS converter.

Package

cl-cont.

Source

special-transformers.lisp.

Macro: transform-forms-in-env (forms k-expr transf-env)

Macroexpands code within a form that sets up a lexical environment and runs a CPS code walker on it.

Package

cl-cont.

Source

special-transformers.lisp.

Macro: with-local-function-names (names &body body)

Runs BODY within a transformation environment in which functions named by NAMES are declared as local.

Package

cl-cont.

Source

special-transformers.lisp.


5.2.3 Ordinary functions

Function: accum-mc-sequence->cps (expr-list fn k-expr args env)

Converts a list of expressions to be evaluated in order to CPS style and collects their results (including multiple values).

Package

cl-cont.

Source

special-transformers.lisp.

Function: application->cps (app-sym cons k-expr args env)

Transforms a function application to CPS style.

Package

cl-cont.

Source

walker.lisp.

Function: apply->cps (cons k-expr args env)

Transforms APPLY to CPS style.

Package

cl-cont.

Source

walker.lisp.

Function: atom->cps (atom k-expr)

Transforms an atom to CPS style.

Package

cl-cont.

Source

walker.lisp.

Function: call/cc-context-p (object)
Package

cl-cont.

Source

cont.lisp.

Function: cons->cps (cons k-expr env)

Transforms a cons to CPS style.

Package

cl-cont.

Source

walker.lisp.

Function: copy-call/cc-context (instance)
Package

cl-cont.

Source

cont.lisp.

Function: copy-hash-table (ht)

Shallow hashtable copy.

Package

cl-cont.

Source

cont.lisp.

Reader: ctx-block-tags (instance)
Writer: (setf ctx-block-tags) (instance)
Package

cl-cont.

Source

cont.lisp.

Target Slot

block-tags.

Reader: ctx-go-tags (instance)
Writer: (setf ctx-go-tags) (instance)
Package

cl-cont.

Source

cont.lisp.

Target Slot

go-tags.

Reader: ctx-local-functions (instance)
Writer: (setf ctx-local-functions) (instance)
Package

cl-cont.

Source

cont.lisp.

Target Slot

local-functions.

Function: declare-function-names-local (names)

Declares function names local in a transformation environment.

Package

cl-cont.

Source

special-transformers.lisp.

Function: duplicates-p (sequence &key key test)

Returns true if there are duplicate elements in the sequence, false otherwise.

Package

cl-cont.

Source

special-transformers.lisp.

Function: extract-declarations (expr-list)

Returns a list of declarations extracted from the EXPR-LIST.

Package

cl-cont.

Source

special-transformers.lisp.

Function: fdesignator-to-function/cc (fdesignator)

Converts a function designator to a function/cc.

Package

cl-cont.

Source

special-transformers.lisp.

Function: funcall->cps (cons k-expr args env)

Transforms FUNCALL to CPS style.

Package

cl-cont.

Source

walker.lisp.

Function: group-tagbody-forms (expr-list)

Groups TAGBODY forms into a list where each item is a list with CAR being the go-tag name (or nil for default first tag), and CDR is a list of expressions for the tag.

Package

cl-cont.

Source

special-transformers.lisp.

Function: lambda-expr->cps (cons k-expr env)

Converts a LAMBDA expression to CPS style.

Package

cl-cont.

Source

special-transformers.lisp.

Function: let*-varlist->cps (varlist let-body k-expr env)

Converts a list of variables from a LET* expression to CPS style.

Package

cl-cont.

Source

special-transformers.lisp.

Function: let-varlist->cons-pairs (varlist)

Converts a list of LET vars into name/value cons pairs.

Package

cl-cont.

Source

special-transformers.lisp.

Function: make-call/cc-context (&key block-tags go-tags local-functions)
Package

cl-cont.

Source

cont.lisp.

Function: make-funcallable (function)

Creates an instance of FUNCALLABLE/CC.

Package

cl-cont.

Source

special-transformers.lisp.

Function: named-tb-forms>cps (forms k-expr env)

Takes a list of named TAGBODY forms and converts CAR form to CPS.

Package

cl-cont.

Source

special-transformers.lisp.

Function: remove-declarations (expr-list)

Removes declarations from the EXPR-LIST.

Package

cl-cont.

Source

special-transformers.lisp.

Function: setq->cps (setq-pairs k-expr env)

Converts a list of SETQ pairs to CPS style.

Package

cl-cont.

Source

special-transformers.lisp.

Function: transform-local-function (fn env in-env-p)

Transforms a local (FLET or LABELS) function to CPS style.

Package

cl-cont.

Source

special-transformers.lisp.

Function: undeclare-function-names-local (names)

Undeclares function names local in a transformation environment.

Package

cl-cont.

Source

special-transformers.lisp.


5.2.4 Generic functions

Generic Reader: f/cc-function (object)
Generic Writer: (setf f/cc-function) (object)
Package

cl-cont.

Methods
Reader Method: f/cc-function ((funcallable/cc funcallable/cc))
Writer Method: (setf f/cc-function) ((funcallable/cc funcallable/cc))

A function object that accepts a continuation argument.

Source

special-transformers.lisp.

Target Slot

function.


5.2.5 Structures

Structure: call/cc-context

A structure that represents a context used during call/cc transformation.

Package

cl-cont.

Source

cont.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: block-tags
Initform

(make-hash-table)

Readers

ctx-block-tags.

Writers

(setf ctx-block-tags).

Slot: go-tags
Initform

(make-hash-table)

Readers

ctx-go-tags.

Writers

(setf ctx-go-tags).

Slot: local-functions
Readers

ctx-local-functions.

Writers

(setf ctx-local-functions).


5.2.6 Classes

Class: funcallable/cc

A structure that represents a funcallable object

Package

cl-cont.

Source

special-transformers.lisp.

Direct superclasses

funcallable-standard-object.

Direct methods
Direct slots
Slot: function

A function object that accepts a continuation argument.

Package

common-lisp.

Initargs

:function

Readers

f/cc-function.

Writers

(setf f/cc-function).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   D   E   F   G   L   M   N   R   S   T   U   W  
Index Entry  Section

(
(setf ctx-block-tags): Private ordinary functions
(setf ctx-go-tags): Private ordinary functions
(setf ctx-local-functions): Private ordinary functions
(setf documentation): Public standalone methods
(setf f/cc-function): Private generic functions
(setf f/cc-function): Private generic functions

A
accum-mc-sequence->cps: Private ordinary functions
application->cps: Private ordinary functions
apply->cps: Private ordinary functions
apply/cc: Private macros
atom->cps: Private ordinary functions

C
call/cc: Public ordinary functions
call/cc-context-p: Private ordinary functions
cons->cps: Private ordinary functions
copy-call/cc-context: Private ordinary functions
copy-hash-table: Private ordinary functions
copy-transformation-context: Public ordinary functions
cpstransformer: Public ordinary functions
ctx-block-tags: Private ordinary functions
ctx-go-tags: Private ordinary functions
ctx-local-functions: Private ordinary functions

D
declare-function-names-local: Private ordinary functions
defcpstransformer: Public macros
defun/cc: Public macros
describe-object: Public standalone methods
documentation: Public standalone methods
duplicates-p: Private ordinary functions

E
expand-form: Private macros
expr->cps: Public ordinary functions
expr-sequence->cps: Public ordinary functions
extract-declarations: Private ordinary functions

F
f/cc-function: Private generic functions
f/cc-function: Private generic functions
fdesignator-to-function/cc: Private ordinary functions
funcall->cps: Private ordinary functions
funcall/cc: Private macros
Function, (setf ctx-block-tags): Private ordinary functions
Function, (setf ctx-go-tags): Private ordinary functions
Function, (setf ctx-local-functions): Private ordinary functions
Function, accum-mc-sequence->cps: Private ordinary functions
Function, application->cps: Private ordinary functions
Function, apply->cps: Private ordinary functions
Function, atom->cps: Private ordinary functions
Function, call/cc: Public ordinary functions
Function, call/cc-context-p: Private ordinary functions
Function, cons->cps: Private ordinary functions
Function, copy-call/cc-context: Private ordinary functions
Function, copy-hash-table: Private ordinary functions
Function, copy-transformation-context: Public ordinary functions
Function, cpstransformer: Public ordinary functions
Function, ctx-block-tags: Private ordinary functions
Function, ctx-go-tags: Private ordinary functions
Function, ctx-local-functions: Private ordinary functions
Function, declare-function-names-local: Private ordinary functions
Function, duplicates-p: Private ordinary functions
Function, expr->cps: Public ordinary functions
Function, expr-sequence->cps: Public ordinary functions
Function, extract-declarations: Private ordinary functions
Function, fdesignator-to-function/cc: Private ordinary functions
Function, funcall->cps: Private ordinary functions
Function, group-tagbody-forms: Private ordinary functions
Function, lambda-expr->cps: Private ordinary functions
Function, let*-varlist->cps: Private ordinary functions
Function, let-varlist->cons-pairs: Private ordinary functions
Function, make-call/cc-context: Private ordinary functions
Function, make-funcallable: Private ordinary functions
Function, named-tb-forms>cps: Private ordinary functions
Function, remove-declarations: Private ordinary functions
Function, setq->cps: Private ordinary functions
Function, transform-local-function: Private ordinary functions
Function, undeclare-function-names-local: Private ordinary functions

G
Generic Function, (setf f/cc-function): Private generic functions
Generic Function, f/cc-function: Private generic functions
group-tagbody-forms: Private ordinary functions

L
lambda-expr->cps: Private ordinary functions
lambda/cc: Public macros
let*-varlist->cps: Private ordinary functions
let-varlist->cons-pairs: Private ordinary functions
let/cc: Public macros

M
Macro, apply/cc: Private macros
Macro, defcpstransformer: Public macros
Macro, defun/cc: Public macros
Macro, expand-form: Private macros
Macro, funcall/cc: Private macros
Macro, lambda/cc: Public macros
Macro, let/cc: Public macros
Macro, transform-forms-in-env: Private macros
Macro, with-call/cc: Public macros
Macro, with-local-function-names: Private macros
Macro, without-call/cc: Public macros
make-call/cc-context: Private ordinary functions
make-funcallable: Private ordinary functions
Method, (setf documentation): Public standalone methods
Method, (setf f/cc-function): Private generic functions
Method, describe-object: Public standalone methods
Method, documentation: Public standalone methods
Method, f/cc-function: Private generic functions

N
named-tb-forms>cps: Private ordinary functions

R
remove-declarations: Private ordinary functions

S
setq->cps: Private ordinary functions

T
transform-forms-in-env: Private macros
transform-local-function: Private ordinary functions

U
undeclare-function-names-local: Private ordinary functions

W
with-call/cc: Public macros
with-local-function-names: Private macros
without-call/cc: Public macros