The misc-extensions Reference Manual

This is the misc-extensions Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 17:21:12 2024 GMT+0.

Table of Contents


1 Systems

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


1.1 misc-extensions

Source

misc-extensions.asd.

Child Component

src (module).


2 Modules

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


2.1 misc-extensions/src

Source

misc-extensions.asd.

Parent Component

misc-extensions (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 misc-extensions/misc-extensions.asd

Source

misc-extensions.asd.

Parent Component

misc-extensions (system).

ASDF Systems

misc-extensions.


3.1.2 misc-extensions/src/defs.lisp

Source

misc-extensions.asd.

Parent Component

src (module).

Packages

3.1.3 misc-extensions/src/new-let.lisp

Dependency

defs.lisp (file).

Source

misc-extensions.asd.

Parent Component

src (module).

Public Interface
Internals

3.1.4 misc-extensions/src/gmap.lisp

Dependency

new-let.lisp (file).

Source

misc-extensions.asd.

Parent Component

src (module).

Public Interface
Internals

3.1.5 misc-extensions/src/fn.lisp

Dependency

gmap.lisp (file).

Source

misc-extensions.asd.

Parent Component

src (module).

Public Interface

fn (macro).


3.1.6 misc-extensions/src/tests.lisp

Dependency

fn.lisp (file).

Source

misc-extensions.asd.

Parent Component

src (module).


3.1.7 misc-extensions/src/rev-fun-bind.lisp

Dependency

tests.lisp (file).

Source

misc-extensions.asd.

Parent Component

src (module).

Public Interface

3.1.8 misc-extensions/src/contexts.lisp

Dependency

rev-fun-bind.lisp (file).

Source

misc-extensions.asd.

Parent Component

src (module).

Public Interface
Internals

3.1.9 misc-extensions/src/context-tests.lisp

Dependency

contexts.lisp (file).

Source

misc-extensions.asd.

Parent Component

src (module).

Internals

4 Packages

Packages are listed by definition order.


4.1 rev-fun-bind

Source

defs.lisp.

Use List

common-lisp.

Public Interface

4.2 new-let

Source

defs.lisp.

Use List

common-lisp.

Public Interface
Internals

4.3 lexical-contexts

Source

defs.lisp.

Use List

common-lisp.

Public Interface
Internals

4.4 gmap

Source

defs.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: bcond (&rest clauses)

A generalization of CL:COND that makes it convenient to compute a value in the predicate expression of a clause and then use that value in the consequent. If the predicate expression is a LET form, then the scope of the variables bound by the LET is extended to include the consequent expressions. For example:

(cond ((let ((x (foo)))
(bar x))
(baz x)))

Here the X in (BAZ X) is the one bound to the result of (FOO).

Package

new-let.

Source

new-let.lisp.

Macro: cond (&rest clauses)

A generalization of CL:COND that makes it convenient to compute a value in the predicate expression of a clause and then use that value in the consequent. If the predicate expression is a LET form, then the scope of the variables bound by the LET is extended to include the consequent expressions. For example:

(cond ((let ((x (foo)))
(bar x))
(baz x)))

Here the X in (BAZ X) is the one bound to the result of (FOO).

Package

new-let.

Source

new-let.lisp.

Macro: def-gmap-arg-type (name args &body body)

Defines a GMap arg-type. Syntax is identical to ‘defun’. The body should return a list of 1 to 5 elements: (0, "init") the initial value of the state variable; (1, "exitp"), if non-nil, a function of one argument which is called on the state variable, a true result causing the iteration to exit; (2, "argfn"), if non-nil, a function of one argument which is called on the state variable to get the value to be used on this iteration; (3, "nextfn"), if non-nil, a function of one argument which is called on the state variable to get the new value of same; and (4, "let-specs") a list of clauses for an ‘nlet’ that will wrapped around the entire expansion.

It is also possible for an arg-type to generate multiple arguments. If element 2, "argfn", is of the form ‘(:values N FN)’, FN should be a function returning N values, which will be passed as separate arguments to the function being mapped.

Package

gmap.

Source

gmap.lisp.

Macro: def-gmap-res-type (name args &body body)

Defines a GMap result-type. Syntax is identical to ‘defun’. The body should return a list of 2 to 5 elements: (0, "init") the initial value of the state variable; (1, "resfn") a function of two arguments which is called on the state variable and the current value of the function being mapped, returning the new value of the state variable; (2, "cleanup"), if non-nil, a function of one argument which is called on the final value of the state variable to get the value of the ‘gmap’ form; (3, "filterp"), if non-nil, a predicate of one argument which is called on the current value of the function being mapped, a false value causing "resfn" not to be called on this iteration (and the state variable to be unchanged); and (4, "let-specs") a list of clauses for an ‘nlet’ that will wrapped around the entire expansion.

It is also possible for a result-type to consume more than one value of the function being mapped. If element 1, "resfn", is of the form ‘(:consume N FN)’, FN should be a function of N + 1 arguments, and will receive N values from the function being mapped.

Package

gmap.

Source

gmap.lisp.

Macro: defcontext (context-name parameter-list &body body)
Package

lexical-contexts.

Source

contexts.lisp.

Macro: deflex (var &optional val doc)

Declares ‘var’ as a global lexical variable, and if ‘val’ is supplied and ‘var’ is not already bound, initializes it to ‘val’. ‘doc’, if supplied, is taken as a documentation string. In some implementations (e.g. Scieneer), locally rebinding the same name is not permitted; in most, it is permitted but creates a new lexical variable, with no effect on the global one.

Package

lexical-contexts.

Source

contexts.lisp.

Macro: deflex-reinit (var val &optional doc)

Declares ‘var’ as a global lexical variable, and initializes it to ‘val’. ‘doc’, if supplied, is taken as a documentation string. In some implementations (e.g. Scieneer), locally rebinding the same name is not permitted; in most, it is permitted but creates a new lexical variable, with no effect on the global one.

Package

lexical-contexts.

Source

contexts.lisp.

Macro: fn (lambda-list &body body)

A variant of the ‘lambda’ with two features: (a) the name is shorter
and (b) it automatically generates an ‘ignore’ declaration for any parameter whose name begins with an underscore.
Note that
#’(fn ...)
doesn’t work, since CL doesn’t have Zetalisp-style lambda macros; you have to say just
(fn ...)
This is the modern style anyway, I think.

Package

new-let.

Source

fn.lisp.

Macro: gmap (res-spec fn &rest arg-specs)

A generalized mapping macro. Applies ‘fn’ to the successive values generated by the ‘arg-specs’, analagously to ‘mapcar’; that is, on each iteration, each arg-spec yields one value, and ‘fn’ is called with these values as arguments. The values returned by ‘fn’ are accumulated into a result according to ‘res-spec’. The ‘res-spec’ is either a list whose car is a predefined result type, or a list whose car is ‘nil’ and whose cdr has the same form as the value of a result type expander (see ‘def-gmap-res-type’); or, the ‘res-spec’ can be a symbol, which is shorthand for a list of that symbol; or, it can be a list whose car is ‘:values’ and whose cdr is a list of result-specs. Similarly, each of the ‘arg-specs’ is either a list whose car is a predefined arg type, or a list whose car is ‘nil’ and whose cdr has the same form as the value of an arg type expander (see ‘def-gmap-arg-type’).

Package

gmap.

Source

gmap.lisp.

Macro: isetq (var val)

"Interactive ‘setq’": can be used on previously-undeclared variables without getting ugly warnings or causing the variable to be declared special. Not to be used in code!!!

Package

lexical-contexts.

Source

contexts.lisp.

Macro: let (clauses &body body)

A generalization of CL:LET that better supports nested bindings and multiple values. Syntax: (let (<clause>*) <body>). The <clause> syntax is more general than for CL:LET:
<clause> ::= <symbol> ; binds to NIL
| ( <symbol> ) ; likewise
| <clause1>
<clause1> ::= ( <symbol>+ <form> ) ; binding
| ( <clause1>+ ) ; nesting
When a clause begins with more than one variable name, they are to be bound to successive values of the form. The nesting of clauses indicates sequencing of bindings; more deeply nested clauses may reference bindings of shallower clauses. All bindings at a given depth are done in parallel. This allows arbitrary combinations of parallel and sequential binding. Standard declarations at the head of BODY are handled correctly, though nonstandard ones may not be. If two variables of the same name are bound at different levels, any declaration applies to the inner one.

Package

new-let.

Source

new-let.lisp.

Macro: nlet (clauses &body body)

A generalization of CL:LET that better supports nested bindings and multiple values. Syntax: (let (<clause>*) <body>). The <clause> syntax is more general than for CL:LET:
<clause> ::= <symbol> ; binds to NIL
| ( <symbol> ) ; likewise
| <clause1>
<clause1> ::= ( <symbol>+ <form> ) ; binding
| ( <clause1>+ ) ; nesting
When a clause begins with more than one variable name, they are to be bound to successive values of the form. The nesting of clauses indicates sequencing of bindings; more deeply nested clauses may reference bindings of shallower clauses. All bindings at a given depth are done in parallel. This allows arbitrary combinations of parallel and sequential binding. Standard declarations at the head of BODY are handled correctly, though nonstandard ones may not be. If two variables of the same name are bound at different levels, any declaration applies to the inner one.

Package

new-let.

Source

new-let.lisp.

Macro: rflet (value-form &body clauses)

Just like ‘flet’ except that the first subform is the form that computes the value, and the remaining subforms are the binding clauses.

Package

rev-fun-bind.

Source

rev-fun-bind.lisp.

Macro: rlabels (value-form &body clauses)

Just like ‘labels’ except that the first subform is the form that computes the value, and the remaining subforms are the binding clauses.

Package

rev-fun-bind.

Source

rev-fun-bind.lisp.

Macro: rmacrolet (value-form &body clauses)

Just like ‘macrolet’ except that the first subform is the form that computes the value, and the remaining subforms are the binding clauses.

Package

rev-fun-bind.

Source

rev-fun-bind.lisp.

Macro: with-context (context-invocation &body body)
Package

lexical-contexts.

Source

contexts.lisp.

Macro: with-contexts (context-invocations &body body)
Package

lexical-contexts.

Source

contexts.lisp.


5.1.2 Standalone methods

Method: make-load-form ((ctxt context) &optional environment)
Source

contexts.lisp.


5.2 Internals


5.2.1 Constants

Constant: context-instance-default-element

An attempt to give the user a clue if they run into this.

Package

lexical-contexts.

Source

contexts.lisp.


5.2.2 Special variables

Special Variable: *gmap-arg-type-list*

A list of all GMAP arg types that have been defined.

Package

gmap.

Source

gmap.lisp.

Special Variable: *gmap-res-type-list*

A list of all GMAP result types that have been defined.

Package

gmap.

Source

gmap.lisp.


5.2.3 Ordinary functions

Function: analyze-decls (clauses body)

Returns two values. The first value is a cons of: (a) for the bound declarations at the head of ‘body’, an alist from variable name to a list of declarations affecting that variable; (b) a list of the remaining (free) declarations. The second value is ‘body’ with the declarations stripped off.

Package

new-let.

Source

new-let.lisp.

Function: bcond-build-clause (let-sym let-clauses pred consequents block-nm)
Package

new-let.

Source

new-let.lisp.

Function: bcond-clause (clause block-nm)
Package

new-let.

Source

new-let.lisp.

Function: bound-decls (decls vars)
Package

new-let.

Source

new-let.lisp.

Reader: context-all-fns (instance)
Writer: (setf context-all-fns) (instance)
Package

lexical-contexts.

Source

contexts.lisp.

Target Slot

all-fns.

Reader: context-all-vars (instance)
Writer: (setf context-all-vars) (instance)
Package

lexical-contexts.

Source

contexts.lisp.

Target Slot

all-vars.

Reader: context-bind-fns (instance)
Writer: (setf context-bind-fns) (instance)
Package

lexical-contexts.

Source

contexts.lisp.

Target Slot

bind-fns.

Reader: context-bind-vars (instance)
Writer: (setf context-bind-vars) (instance)
Package

lexical-contexts.

Source

contexts.lisp.

Target Slot

bind-vars.

Reader: context-constructor (instance)
Writer: (setf context-constructor) (instance)
Package

lexical-contexts.

Source

contexts.lisp.

Target Slot

constructor.

Reader: context-macros (instance)
Writer: (setf context-macros) (instance)
Package

lexical-contexts.

Source

contexts.lisp.

Target Slot

macros.

Reader: context-name (instance)
Writer: (setf context-name) (instance)
Package

lexical-contexts.

Source

contexts.lisp.

Target Slot

name.

Function: context-p (object)
Package

lexical-contexts.

Source

contexts.lisp.

Reader: context-parameter-list (instance)
Writer: (setf context-parameter-list) (instance)
Package

lexical-contexts.

Source

contexts.lisp.

Target Slot

parameter-list.

Function: copy-context (instance)
Package

lexical-contexts.

Source

contexts.lisp.

Function: expand-new-let (clauses body decls)
Package

new-let.

Source

new-let.lisp.

Function: gmap>arg-spec-lookup (raw-arg-spec)
Package

gmap.

Source

gmap.lisp.

Function: gmap>expand (fn res-specs arg-specs)
Package

gmap.

Source

gmap.lisp.

Function: gmap>funcall (function &rest args)
Package

gmap.

Source

gmap.lisp.

Function: gmap>let-specs (arg-specs res-specs)
Package

gmap.

Source

gmap.lisp.

Function: gmap>param (arg-spec)
Package

gmap.

Source

gmap.lisp.

Function: gmap>param>arg (param arg-spec multi-vars)
Package

gmap.

Source

gmap.lisp.

Function: gmap>param>exit-test (param arg-spec)
Package

gmap.

Source

gmap.lisp.

Function: gmap>param>multi-let-specs (param arg-spec multi-vars)
Package

gmap.

Source

gmap.lisp.

Function: gmap>param>multi-vars (arg-spec)
Package

gmap.

Source

gmap.lisp.

Function: gmap>res-spec-lookup (raw-res-spec)
Package

gmap.

Source

gmap.lisp.

Function: gmap>res-spec-lookup-1 (raw-res-spec)
Package

gmap.

Source

gmap.lisp.

Function: gmap>res>cleanup (res-specs result-list one-value-p)
Package

gmap.

Source

gmap.lisp.

Function: gmap>res>init-clauses (res-specs)
Package

gmap.

Source

gmap.lisp.

Function: gmap>res>next (res-spec result fnvals)
Package

gmap.

Source

gmap.lisp.

Function: make-context (name parameter-list constructor &optional bind-vars bind-fns all-vars all-fns macros)
Package

lexical-contexts.

Source

contexts.lisp.

Function: new-let-bound-vars (clauses)
Package

new-let.

Source

new-let.lisp.

Function: prune-decls (decls vars)
Package

new-let.

Source

new-let.lisp.

Function: split-level (clauses this-level-single this-level-multiple next-level)
Package

new-let.

Source

new-let.lisp.

Function: test-context-0 ()
Package

lexical-contexts.

Source

context-tests.lisp.

Function: test-context-1 ()
Package

lexical-contexts.

Source

context-tests.lisp.

Function: test-context-2 ()
Package

lexical-contexts.

Source

context-tests.lisp.

Function: type-specifier-name? (x)
Package

new-let.

Source

new-let.lisp.


5.2.4 Structures

Structure: context
Package

lexical-contexts.

Source

contexts.lisp.

Direct superclasses

structure-object.

Direct methods

make-load-form.

Direct slots
Slot: name
Readers

context-name.

Writers

(setf context-name).

Slot: parameter-list
Readers

context-parameter-list.

Writers

(setf context-parameter-list).

Slot: constructor
Readers

context-constructor.

Writers

(setf context-constructor).

Slot: bind-vars
Readers

context-bind-vars.

Writers

(setf context-bind-vars).

Slot: bind-fns
Readers

context-bind-fns.

Writers

(setf context-bind-fns).

Slot: all-vars
Readers

context-all-vars.

Writers

(setf context-all-vars).

Slot: all-fns
Readers

context-all-fns.

Writers

(setf context-all-fns).

Slot: macros
Readers

context-macros.

Writers

(setf context-macros).


Appendix A Indexes


A.1 Concepts


A.2 Functions

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

(
(setf context-all-fns): Private ordinary functions
(setf context-all-vars): Private ordinary functions
(setf context-bind-fns): Private ordinary functions
(setf context-bind-vars): Private ordinary functions
(setf context-constructor): Private ordinary functions
(setf context-macros): Private ordinary functions
(setf context-name): Private ordinary functions
(setf context-parameter-list): Private ordinary functions

A
analyze-decls: Private ordinary functions

B
bcond: Public macros
bcond-build-clause: Private ordinary functions
bcond-clause: Private ordinary functions
bound-decls: Private ordinary functions

C
cond: Public macros
context-all-fns: Private ordinary functions
context-all-vars: Private ordinary functions
context-bind-fns: Private ordinary functions
context-bind-vars: Private ordinary functions
context-constructor: Private ordinary functions
context-macros: Private ordinary functions
context-name: Private ordinary functions
context-p: Private ordinary functions
context-parameter-list: Private ordinary functions
copy-context: Private ordinary functions

D
def-gmap-arg-type: Public macros
def-gmap-res-type: Public macros
defcontext: Public macros
deflex: Public macros
deflex-reinit: Public macros

E
expand-new-let: Private ordinary functions

F
fn: Public macros
Function, (setf context-all-fns): Private ordinary functions
Function, (setf context-all-vars): Private ordinary functions
Function, (setf context-bind-fns): Private ordinary functions
Function, (setf context-bind-vars): Private ordinary functions
Function, (setf context-constructor): Private ordinary functions
Function, (setf context-macros): Private ordinary functions
Function, (setf context-name): Private ordinary functions
Function, (setf context-parameter-list): Private ordinary functions
Function, analyze-decls: Private ordinary functions
Function, bcond-build-clause: Private ordinary functions
Function, bcond-clause: Private ordinary functions
Function, bound-decls: Private ordinary functions
Function, context-all-fns: Private ordinary functions
Function, context-all-vars: Private ordinary functions
Function, context-bind-fns: Private ordinary functions
Function, context-bind-vars: Private ordinary functions
Function, context-constructor: Private ordinary functions
Function, context-macros: Private ordinary functions
Function, context-name: Private ordinary functions
Function, context-p: Private ordinary functions
Function, context-parameter-list: Private ordinary functions
Function, copy-context: Private ordinary functions
Function, expand-new-let: Private ordinary functions
Function, gmap>arg-spec-lookup: Private ordinary functions
Function, gmap>expand: Private ordinary functions
Function, gmap>funcall: Private ordinary functions
Function, gmap>let-specs: Private ordinary functions
Function, gmap>param: Private ordinary functions
Function, gmap>param>arg: Private ordinary functions
Function, gmap>param>exit-test: Private ordinary functions
Function, gmap>param>multi-let-specs: Private ordinary functions
Function, gmap>param>multi-vars: Private ordinary functions
Function, gmap>res-spec-lookup: Private ordinary functions
Function, gmap>res-spec-lookup-1: Private ordinary functions
Function, gmap>res>cleanup: Private ordinary functions
Function, gmap>res>init-clauses: Private ordinary functions
Function, gmap>res>next: Private ordinary functions
Function, make-context: Private ordinary functions
Function, new-let-bound-vars: Private ordinary functions
Function, prune-decls: Private ordinary functions
Function, split-level: Private ordinary functions
Function, test-context-0: Private ordinary functions
Function, test-context-1: Private ordinary functions
Function, test-context-2: Private ordinary functions
Function, type-specifier-name?: Private ordinary functions

G
gmap: Public macros
gmap>arg-spec-lookup: Private ordinary functions
gmap>expand: Private ordinary functions
gmap>funcall: Private ordinary functions
gmap>let-specs: Private ordinary functions
gmap>param: Private ordinary functions
gmap>param>arg: Private ordinary functions
gmap>param>exit-test: Private ordinary functions
gmap>param>multi-let-specs: Private ordinary functions
gmap>param>multi-vars: Private ordinary functions
gmap>res-spec-lookup: Private ordinary functions
gmap>res-spec-lookup-1: Private ordinary functions
gmap>res>cleanup: Private ordinary functions
gmap>res>init-clauses: Private ordinary functions
gmap>res>next: Private ordinary functions

I
isetq: Public macros

L
let: Public macros

M
Macro, bcond: Public macros
Macro, cond: Public macros
Macro, def-gmap-arg-type: Public macros
Macro, def-gmap-res-type: Public macros
Macro, defcontext: Public macros
Macro, deflex: Public macros
Macro, deflex-reinit: Public macros
Macro, fn: Public macros
Macro, gmap: Public macros
Macro, isetq: Public macros
Macro, let: Public macros
Macro, nlet: Public macros
Macro, rflet: Public macros
Macro, rlabels: Public macros
Macro, rmacrolet: Public macros
Macro, with-context: Public macros
Macro, with-contexts: Public macros
make-context: Private ordinary functions
make-load-form: Public standalone methods
Method, make-load-form: Public standalone methods

N
new-let-bound-vars: Private ordinary functions
nlet: Public macros

P
prune-decls: Private ordinary functions

R
rflet: Public macros
rlabels: Public macros
rmacrolet: Public macros

S
split-level: Private ordinary functions

T
test-context-0: Private ordinary functions
test-context-1: Private ordinary functions
test-context-2: Private ordinary functions
type-specifier-name?: Private ordinary functions

W
with-context: Public macros
with-contexts: Public macros


A.4 Data types

Jump to:   C   D   F   G   L   M   N   P   R   S   T  
Index Entry  Section

C
context: Private structures
context-tests.lisp: The misc-extensions/src/context-tests․lisp file
contexts.lisp: The misc-extensions/src/contexts․lisp file

D
defs.lisp: The misc-extensions/src/defs․lisp file

F
File, context-tests.lisp: The misc-extensions/src/context-tests․lisp file
File, contexts.lisp: The misc-extensions/src/contexts․lisp file
File, defs.lisp: The misc-extensions/src/defs․lisp file
File, fn.lisp: The misc-extensions/src/fn․lisp file
File, gmap.lisp: The misc-extensions/src/gmap․lisp file
File, misc-extensions.asd: The misc-extensions/misc-extensions․asd file
File, new-let.lisp: The misc-extensions/src/new-let․lisp file
File, rev-fun-bind.lisp: The misc-extensions/src/rev-fun-bind․lisp file
File, tests.lisp: The misc-extensions/src/tests․lisp file
fn.lisp: The misc-extensions/src/fn․lisp file

G
gmap: The gmap package
gmap.lisp: The misc-extensions/src/gmap․lisp file

L
lexical-contexts: The lexical-contexts package

M
misc-extensions: The misc-extensions system
misc-extensions.asd: The misc-extensions/misc-extensions․asd file
Module, src: The misc-extensions/src module

N
new-let: The new-let package
new-let.lisp: The misc-extensions/src/new-let․lisp file

P
Package, gmap: The gmap package
Package, lexical-contexts: The lexical-contexts package
Package, new-let: The new-let package
Package, rev-fun-bind: The rev-fun-bind package

R
rev-fun-bind: The rev-fun-bind package
rev-fun-bind.lisp: The misc-extensions/src/rev-fun-bind․lisp file

S
src: The misc-extensions/src module
Structure, context: Private structures
System, misc-extensions: The misc-extensions system

T
tests.lisp: The misc-extensions/src/tests․lisp file