This is the misc-extensions Reference Manual, version 4.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:04:39 2024 GMT+0.
misc-extensions/misc-extensions.asd
misc-extensions/src/defs.lisp
misc-extensions/src/new-let.lisp
misc-extensions/src/gmap.lisp
misc-extensions/src/fn.lisp
misc-extensions/src/tests.lisp
misc-extensions/src/rev-fun-bind.lisp
misc-extensions/src/contexts.lisp
misc-extensions/src/context-tests.lisp
The main system appears first, followed by any subsystem dependency.
misc-extensions
The GMap iteration macro, plus a few other useful macros.
Scott L. Burson <Scott@sympoiesis.com>
Public domain
4.0.1
src
(module).
Modules are listed depth-first from the system components tree.
misc-extensions/src
misc-extensions
(system).
defs.lisp
(file).
new-let.lisp
(file).
gmap.lisp
(file).
fn.lisp
(file).
tests.lisp
(file).
rev-fun-bind.lisp
(file).
contexts.lisp
(file).
context-tests.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
misc-extensions/misc-extensions.asd
misc-extensions/src/defs.lisp
misc-extensions/src/new-let.lisp
misc-extensions/src/gmap.lisp
misc-extensions/src/fn.lisp
misc-extensions/src/tests.lisp
misc-extensions/src/rev-fun-bind.lisp
misc-extensions/src/contexts.lisp
misc-extensions/src/context-tests.lisp
misc-extensions/misc-extensions.asd
misc-extensions
(system).
misc-extensions/src/new-let.lisp
defs.lisp
(file).
src
(module).
analyze-decls
(function).
bcond-build-clause
(function).
bcond-clause
(function).
bound-decls
(function).
expand-new-let
(function).
new-let-bound-vars
(function).
prune-decls
(function).
split-level
(function).
type-specifier-name?
(function).
misc-extensions/src/gmap.lisp
new-let.lisp
(file).
src
(module).
def-arg-type
(macro).
def-gmap-arg-type
(macro).
def-gmap-res-type
(macro).
def-result-type
(macro).
gmap
(macro).
*gmap-arg-type-list*
(special variable).
*gmap-result-type-list*
(special variable).
gmap>arg-spec-lookup
(function).
gmap>expand
(function).
gmap>funcall
(function).
gmap>let-specs
(function).
gmap>param
(function).
gmap>param>arg
(function).
gmap>param>exit-test
(function).
gmap>param>multi-let-specs
(function).
gmap>param>multi-vars
(function).
gmap>res-spec-lookup
(function).
gmap>res-spec-lookup-1
(function).
gmap>res>cleanup
(function).
gmap>res>init-clauses
(function).
gmap>res>next
(function).
keyword-name-deprecated
(condition).
kind
(reader method).
name
(reader method).
misc-extensions/src/fn.lisp
misc-extensions/src/tests.lisp
fn.lisp
(file).
src
(module).
test-new-syntax
(function).
test-old-syntax
(function).
misc-extensions/src/rev-fun-bind.lisp
tests.lisp
(file).
src
(module).
misc-extensions/src/contexts.lisp
rev-fun-bind.lisp
(file).
src
(module).
defcontext
(macro).
deflex
(macro).
deflex-reinit
(macro).
isetq
(macro).
make-load-form
(method).
with-context
(macro).
with-contexts
(macro).
context
(structure).
context-all-fns
(reader).
(setf context-all-fns)
(writer).
context-all-vars
(reader).
(setf context-all-vars)
(writer).
context-bind-fns
(reader).
(setf context-bind-fns)
(writer).
context-bind-vars
(reader).
(setf context-bind-vars)
(writer).
context-constructor
(reader).
(setf context-constructor)
(writer).
context-instance-default-element
(constant).
context-macros
(reader).
(setf context-macros)
(writer).
context-name
(reader).
(setf context-name)
(writer).
context-p
(function).
context-parameter-list
(reader).
(setf context-parameter-list)
(writer).
copy-context
(function).
make-context
(function).
misc-extensions/src/context-tests.lisp
contexts.lisp
(file).
src
(module).
test-context-0
(function).
test-context-1
(function).
test-context-2
(function).
test-contexts
(function).
Packages are listed by definition order.
new-let
common-lisp
.
analyze-decls
(function).
bcond-build-clause
(function).
bcond-clause
(function).
bound-decls
(function).
expand-new-let
(function).
new-let-bound-vars
(function).
prune-decls
(function).
split-level
(function).
type-specifier-name?
(function).
lexical-contexts
common-lisp
.
defcontext
(macro).
deflex
(macro).
deflex-reinit
(macro).
isetq
(macro).
with-context
(macro).
with-contexts
(macro).
context
(structure).
context-all-fns
(reader).
(setf context-all-fns)
(writer).
context-all-vars
(reader).
(setf context-all-vars)
(writer).
context-bind-fns
(reader).
(setf context-bind-fns)
(writer).
context-bind-vars
(reader).
(setf context-bind-vars)
(writer).
context-constructor
(reader).
(setf context-constructor)
(writer).
context-instance-default-element
(constant).
context-macros
(reader).
(setf context-macros)
(writer).
context-name
(reader).
(setf context-name)
(writer).
context-p
(function).
context-parameter-list
(reader).
(setf context-parameter-list)
(writer).
copy-context
(function).
make-context
(function).
test-context-0
(function).
test-context-1
(function).
test-context-2
(function).
test-contexts
(function).
gmap
common-lisp
.
def-arg-type
(macro).
def-gmap-arg-type
(macro).
def-gmap-res-type
(macro).
def-result-type
(macro).
gmap
(macro).
*gmap-arg-type-list*
(special variable).
*gmap-result-type-list*
(special variable).
gmap>arg-spec-lookup
(function).
gmap>expand
(function).
gmap>funcall
(function).
gmap>let-specs
(function).
gmap>param
(function).
gmap>param>arg
(function).
gmap>param>exit-test
(function).
gmap>param>multi-let-specs
(function).
gmap>param>multi-vars
(function).
gmap>res-spec-lookup
(function).
gmap>res-spec-lookup-1
(function).
gmap>res>cleanup
(function).
gmap>res>init-clauses
(function).
gmap>res>next
(function).
keyword-name-deprecated
(condition).
kind
(generic reader).
name
(generic reader).
test-new-syntax
(function).
test-old-syntax
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
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).
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).
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 be 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.
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 be 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.
This is the backward-compatibility version of this macro; when ‘name’ is not in the keyword package, it also tries to identically define the keyword symbol of the same name, though it checks for collisions first. If a collision does occur, you can resolve it by changing at least one of the ‘def-gmap-arg-type’ forms to ‘def-arg-type’, which does not attempt to define the keyword version of the name. Of course, you will also need to update any references in the old syntax ‘(:name ...)’ to the new syntax ‘(:arg name ...)’.
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 be 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.
This is the backward-compatibility version of this macro; when ‘name’ is not in the keyword package, it also tries to identically define the keyword symbol of the same name, though it checks for collisions first. If a collision does occur, you can resolve it by changing at least one of the ‘def-gmap-res-type’ forms to ‘def-res-type’, which does not attempt to define the keyword version of the name. Of course, you will also need to update any references in the old syntax ‘(:name ...)’ to the new syntax ‘(:result name ...)’.
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 be 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.
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.
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.
A variant of ‘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. If the parameter’s name is just ‘_’,
renames it to a gensym, so as to avoid duplicate-parameter errors (this
applies to any symbol named ‘_’, regardless of package).
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.
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’).
"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!!!
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.
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.
Just like ‘flet’ except that the first subform is the form that computes the value, and the remaining subforms are the binding clauses.
Just like ‘labels’ except that the first subform is the form that computes the value, and the remaining subforms are the binding clauses.
Just like ‘macrolet’ except that the first subform is the form that computes the value, and the remaining subforms are the binding clauses.
An attempt to give the user a clue if they run into this.
A list of all GMAP arg types that have been defined.
A list of all GMAP result types that have been defined.
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.
name
.
gmap
.
keyword-name-deprecated
)) ¶gmap
.
keyword-name-deprecated
)) ¶structure-object
.
Jump to: | (
A B C D E F G I K L M N P R S T W |
---|
Jump to: | (
A B C D E F G I K L M N P R S T W |
---|
Jump to: | *
A B C K M N P S |
---|
Jump to: | *
A B C K M N P S |
---|
Jump to: | C D F G K L M N P R S T |
---|
Jump to: | C D F G K L M N P R S T |
---|