The trivial-continuation Reference Manual

This is the trivial-continuation Reference Manual, version 0.1.5, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:55:32 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 trivial-continuation

Provides an implementation of function call continuation and combination.

Author

Eric Diethelm <>

License

MIT

Version

0.1.5

Dependencies
  • trivial-utilities (system).
  • log4cl (system).
Source

trivial-continuation.asd.

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 trivial-continuation/trivial-continuation.asd

Source

trivial-continuation.asd.

Parent Component

trivial-continuation (system).

ASDF Systems

trivial-continuation.


3.1.2 trivial-continuation/package.lisp

Source

trivial-continuation.asd.

Parent Component

trivial-continuation (system).

Packages

trivial-continuation.


3.1.3 trivial-continuation/trivial-continuation.lisp

Source

trivial-continuation.asd.

Parent Component

trivial-continuation (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 trivial-continuation

trivial-continuation provides an implementation of function call continuation and combination.

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Macros

Macro: cc/create-return (value continuation &key operation named-define)

Create a new result to be returned from inside *CC/DEFINE*.

Package

trivial-continuation.

Source

trivial-continuation.lisp.

Macro: cc/define (name (&rest args) &body body)

Define a function to serve as a continuation.

Package

trivial-continuation.

Source

trivial-continuation.lisp.

Macro: cc/define-lambda ((&rest args) &body body)

Define a lambda to serve as a continuation.

Package

trivial-continuation.

Source

trivial-continuation.lisp.

Macro: cc/define-named-lambda (name (&rest args) &body body)

Define a named lambda to serve as a continuation.

Package

trivial-continuation.

Source

trivial-continuation.lisp.

Macro: cc/delegate (&key named-define)

Indicate that this does not carry any result, but instead a continuation should be called. Used inside of *CC/DEFINE*.

Package

trivial-continuation.

Source

trivial-continuation.lisp.

Macro: cc/return (result &key named-define)

Return the *RESULT* from inside of *CC/DEFINE*.

Package

trivial-continuation.

Source

trivial-continuation.lisp.

Macro: cc/terminate (&key named-define)

Indicate that this result should be the last in a chain. Used inside of *CC/DEFINE*.

Package

trivial-continuation.

Source

trivial-continuation.lisp.


5.1.2 Ordinary functions

Function: call-continuation (cont)

Call the continuation of a *CONTINUATION-RESULT*, checking if one is defined. Emits a warning when calling on an object with *OPERATION* :terminate.

Package

trivial-continuation.

Source

trivial-continuation.lisp.

Function: cc/continue (cont)

Call the continuation of a *CONTINUATION-RESULT*, checking if one is defined and modifying *CONT*. Emits a warning when calling on an object with *OPERATION* :terminate.

Package

trivial-continuation.

Source

trivial-continuation.lisp.

Function: follow-chain (result)

Return whether *RESULT* has a valid continuation.

Package

trivial-continuation.

Source

trivial-continuation.lisp.


5.1.3 Generic functions

Generic Function: combine-continuations (head tail)

Combine two continuations to form a new one. *HEAD* and *TAIL* can (independently) be *CONTINUATION-RESULT* or a function returning a *CONTINUATION-RESULT*

Package

trivial-continuation.

Source

trivial-continuation.lisp.

Methods
Method: combine-continuations ((head function) (tail function))
Method: combine-continuations ((head function) (tail continuation-result))
Method: combine-continuations ((head continuation-result) (tail function))
Method: combine-continuations ((head continuation-result) (tail continuation-result))
Generic Reader: continuation (object)
Package

trivial-continuation.

Methods
Reader Method: continuation ((continuation-result continuation-result))

The *CONTINUATION* slot holds the continuation function to be called next.

Source

trivial-continuation.lisp.

Target Slot

continuation.

Generic Reader: operation (object)
Package

trivial-continuation.

Methods
Reader Method: operation ((continuation-result continuation-result))

The *OPERATION* slot controls how two continuations are to be combined.
Valid values are:
:combine - the current continuation carries a valid result, and still other continuations should be called :delegate - the current continuation does not have any result, but still another continuation should be called :terminate - no further continuation shall be called

Source

trivial-continuation.lisp.

Target Slot

operation.

Generic Reader: result (object)
Package

trivial-continuation.

Methods
Reader Method: result ((continuation-result continuation-result))

The *RESULT* slot carries the return value from calling a continuation.

Source

trivial-continuation.lisp.

Target Slot

result.


5.1.4 Standalone methods

Method: clone ((obj continuation-result) &key &allow-other-keys)

Make a deep copy of the given *continuation-result.

Package

trivial-utilities.

Source

trivial-continuation.lisp.

Method: print-object ((var continuation-result) out)
Source

trivial-continuation.lisp.


5.1.5 Classes

Class: continuation-result

The *CONTINUATION-RESULT* class represents the result of a method, the continuation from it and the combination operation.

Package

trivial-continuation.

Source

trivial-continuation.lisp.

Direct methods
Direct slots
Slot: result

The *RESULT* slot carries the return value from calling a continuation.

Initargs

:result

Readers

result.

Writers

This slot is read-only.

Slot: continuation

The *CONTINUATION* slot holds the continuation function to be called next.

Type

(or null function)

Initargs

:continuation

Readers

continuation.

Writers

This slot is read-only.

Slot: operation

The *OPERATION* slot controls how two continuations are to be combined.
Valid values are:
:combine - the current continuation carries a valid result, and still other continuations should be called :delegate - the current continuation does not have any result, but still another continuation should be called :terminate - no further continuation shall be called

Type

(member :terminate :combine :delegate)

Initform

:terminate

Initargs

:operation

Readers

operation.

Writers

This slot is read-only.


5.2 Internals


5.2.1 Special variables

Special Variable: +continuation-failed+
Package

trivial-continuation.

Source

trivial-continuation.lisp.

Special Variable: +continue-to-next+
Package

trivial-continuation.

Source

trivial-continuation.lisp.


5.2.2 Ordinary functions

Function: combine (first-cont next-cont)
Package

trivial-continuation.

Source

trivial-continuation.lisp.

Function: rewrite-terminators (name body)

Run over *BODY* adding (:named-define name) to every cc/{delegate|terminate|create-return|return}.

Package

trivial-continuation.

Source

trivial-continuation.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   C   F   G   M   O   P   R  
Index Entry  Section

C
call-continuation: Public ordinary functions
cc/continue: Public ordinary functions
cc/create-return: Public macros
cc/define: Public macros
cc/define-lambda: Public macros
cc/define-named-lambda: Public macros
cc/delegate: Public macros
cc/return: Public macros
cc/terminate: Public macros
clone: Public standalone methods
combine: Private ordinary functions
combine-continuations: Public generic functions
combine-continuations: Public generic functions
combine-continuations: Public generic functions
combine-continuations: Public generic functions
combine-continuations: Public generic functions
continuation: Public generic functions
continuation: Public generic functions

F
follow-chain: Public ordinary functions
Function, call-continuation: Public ordinary functions
Function, cc/continue: Public ordinary functions
Function, combine: Private ordinary functions
Function, follow-chain: Public ordinary functions
Function, rewrite-terminators: Private ordinary functions

G
Generic Function, combine-continuations: Public generic functions
Generic Function, continuation: Public generic functions
Generic Function, operation: Public generic functions
Generic Function, result: Public generic functions

M
Macro, cc/create-return: Public macros
Macro, cc/define: Public macros
Macro, cc/define-lambda: Public macros
Macro, cc/define-named-lambda: Public macros
Macro, cc/delegate: Public macros
Macro, cc/return: Public macros
Macro, cc/terminate: Public macros
Method, clone: Public standalone methods
Method, combine-continuations: Public generic functions
Method, combine-continuations: Public generic functions
Method, combine-continuations: Public generic functions
Method, combine-continuations: Public generic functions
Method, continuation: Public generic functions
Method, operation: Public generic functions
Method, print-object: Public standalone methods
Method, result: Public generic functions

O
operation: Public generic functions
operation: Public generic functions

P
print-object: Public standalone methods

R
result: Public generic functions
result: Public generic functions
rewrite-terminators: Private ordinary functions