This is the cl-form-types Reference Manual, version 0.3.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 04:54:30 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-form-types
Library for determining types of Common Lisp forms.
Alexander Gutev
MIT
0.3.2
cl-environments
(system).
agutil
(system).
alexandria
(system).
anaphora
(system).
optima
(system).
arrows
(system).
introspect-environment
(system).
src
(module).
Modules are listed depth-first from the system components tree.
cl-form-types/src
cl-form-types
(system).
package.lisp
(file).
form-types.lisp
(file).
walker.lisp
(file).
block-types.lisp
(file).
cl-functions.lisp
(file).
blacklist.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-form-types/cl-form-types.asd
cl-form-types/src/package.lisp
cl-form-types/src/form-types.lisp
cl-form-types/src/walker.lisp
cl-form-types/src/block-types.lisp
cl-form-types/src/cl-functions.lisp
cl-form-types/src/blacklist.lisp
cl-form-types/src/form-types.lisp
package.lisp
(file).
src
(module).
*expand-compiler-macros-blacklist*
(special variable).
*handle-sb-lvars*
(special variable).
custom-form-type
(generic function).
form-type
(function).
form-types
(function).
malformed-form-error
(condition).
nth-form-type
(function).
nth-value-type
(function).
return-default-type
(function).
unknown-special-operator
(condition).
*constant-eql-types*
(special variable).
*expand-compiler-macros*
(special variable).
*use-local-declared-types*
(special variable).
combine-values-types
(function).
constant-form-value
(function).
constant-type
(function).
copy-values-type-spec
(function).
expand-compiler-macros
(function).
expand-form-type
(function).
flet-form-type
(function).
form
(reader method).
form-type%
(function).
function-name
(type).
lambda-expression-type
(function).
let-form-type
(function).
list-form-type
(function).
make-values-type-spec
(function).
match-form
(macro).
operands
(reader method).
operator
(reader method).
parse-values-type
(function).
special-form-type
(generic function).
values-type-spec
(structure).
values-type-spec-allow-other-keys
(reader).
(setf values-type-spec-allow-other-keys)
(writer).
values-type-spec-optional-start
(reader).
(setf values-type-spec-optional-start)
(writer).
values-type-spec-other
(reader).
(setf values-type-spec-other)
(writer).
values-type-spec-p
(function).
values-type-spec-rest-p
(reader).
(setf values-type-spec-rest-p)
(writer).
values-type-spec-rest-type
(reader).
(setf values-type-spec-rest-type)
(writer).
values-type-spec-types
(reader).
(setf values-type-spec-types)
(writer).
variable-type
(function).
with-default-type-restart
(macro).
cl-form-types/src/walker.lisp
form-types.lisp
(file).
src
(module).
*walk-fn*
(special variable).
*walk-result-type*
(special variable).
+cl-special-forms+
(constant).
vars-and-funs-from-decl
(function).
walk-body
(function).
walk-fn-def
(function).
walk-form
(function).
walk-form%
(function).
walk-forms
(function).
walk-lambda-list
(function).
walk-list-form
(generic function).
walk-local-fn
(function).
walk-new-form
(function).
with-result
(macro).
cl-form-types/src/block-types.lisp
walker.lisp
(file).
src
(module).
*block-name*
(special variable).
*block-types*
(special variable).
*in-block*
(special variable).
*local-fns*
(special variable).
block-type-walk-form
(function).
block-type-walk-list-form
(generic function).
block-type-walk-local-fn
(function).
extract-return-from-types
(function).
local-function-type
(function).
local-function-types
(function).
special-form-type
(method).
subst-local-function-types
(function).
cl-form-types/src/cl-functions.lisp
block-types.lisp
(file).
src
(module).
custom-form-type
(method).
custom-form-type
(method).
custom-form-type
(method).
custom-form-type
(method).
custom-form-type
(method).
custom-form-type
(method).
custom-form-type
(method).
lm
(macro).
maybe-constant-form-value
(function).
cl-form-types/src/blacklist.lisp
cl-functions.lisp
(file).
src
(module).
Packages are listed by definition order.
cl-form-types
Exports utilities for determining the types of common lisp forms, based on information found in the environment.
agutil
.
alexandria
.
anaphora
.
arrows
.
cl-environments-cl
.
optima
.
*expand-compiler-macros-blacklist*
(special variable).
*handle-sb-lvars*
(special variable).
custom-form-type
(generic function).
form-type
(function).
form-types
(function).
malformed-form-error
(condition).
nth-form-type
(function).
nth-value-type
(function).
return-default-type
(function).
unknown-special-operator
(condition).
*block-name*
(special variable).
*block-types*
(special variable).
*constant-eql-types*
(special variable).
*expand-compiler-macros*
(special variable).
*in-block*
(special variable).
*local-fns*
(special variable).
*use-local-declared-types*
(special variable).
*walk-fn*
(special variable).
*walk-result-type*
(special variable).
+cl-special-forms+
(constant).
block-type-walk-form
(function).
block-type-walk-list-form
(generic function).
block-type-walk-local-fn
(function).
combine-values-types
(function).
constant-form-value
(function).
constant-type
(function).
copy-values-type-spec
(function).
expand-compiler-macros
(function).
expand-form-type
(function).
extract-return-from-types
(function).
flet-form-type
(function).
form
(generic reader).
form-type%
(function).
function-name
(type).
lambda-expression-type
(function).
let-form-type
(function).
list-form-type
(function).
lm
(macro).
local-function-type
(function).
local-function-types
(function).
make-values-type-spec
(function).
match-form
(macro).
maybe-constant-form-value
(function).
operands
(generic reader).
operator
(generic reader).
parse-values-type
(function).
special-form-type
(generic function).
subst-local-function-types
(function).
values-type-spec
(structure).
values-type-spec-allow-other-keys
(reader).
(setf values-type-spec-allow-other-keys)
(writer).
values-type-spec-optional-start
(reader).
(setf values-type-spec-optional-start)
(writer).
values-type-spec-other
(reader).
(setf values-type-spec-other)
(writer).
values-type-spec-p
(function).
values-type-spec-rest-p
(reader).
(setf values-type-spec-rest-p)
(writer).
values-type-spec-rest-type
(reader).
(setf values-type-spec-rest-type)
(writer).
values-type-spec-types
(reader).
(setf values-type-spec-types)
(writer).
variable-type
(function).
vars-and-funs-from-decl
(function).
walk-body
(function).
walk-fn-def
(function).
walk-form
(function).
walk-form%
(function).
walk-forms
(function).
walk-lambda-list
(function).
walk-list-form
(generic function).
walk-local-fn
(function).
walk-new-form
(function).
with-default-type-restart
(macro).
with-result
(macro).
Definitions are sorted by export status, category, package, and then by lexicographic order.
A list of symbols whose compiler macros should not be used for expansion. This may be useful because some implementations provide compiler macros which expand into their parent forms, resulting in infinite expansions.
Flag for whether SBCL ‘SB-C::LVAR’ structures should be recognized.
If true the type of an LVAR is returned if encountered as a
constant.
If NIL LVARS as treated as literal constant and an EQL type or LVAR is returned, depending on the value of*CONSTANT-EQL-TYPES*.
Determines the type of a form in an environment.
FORM is the form of which to determine the type.
ENV is the environment in which the form occurs.
:CONSTANT-EQL-TYPES is a flag for whether EQL type specifiers
should be returned for all constant forms. If NIL EQL types
specifiers are only returned for constants which are comparable
with EQL, that is NUMBERS, CHARACTERS and SYMBOLS.
:EXPAND-COMPILER-MACROS is a flag, which if true, compiler-macros
are expanded prior to determining the type of FORM or a subform of
it.
Returns the type of the value to which FORM evaluates to. Returns a VALUES type if FORM evaluates to multiple values. Returns T if the type could not be determined.
Determines the type of each form in FORMS.
FORMS is a list of forms.
ENV is the environment in which the forms occur.
:CONSTANT-EQL-TYPES if a flag for whether EQL type specifiers
should be returned for all constant forms. If NIL EQL types
specifiers are only returned for constants which are comparable
with EQL, that is NUMBERS, CHARACTERS and SYMBOLS.
:EXPAND-COMPILER-MACROS is a flag, which if true, compiler-macros
are expanded prior to determining the type of FORM or a subform of
it.
Returns a list where each element is the type to which the corresponding form in FORMS evaluates to
Determines the type of the N’th value of a form.
The difference between this and FORM-TYPE is that, FORM-TYPE
returns a VALUES type if the form evaluates to multiple values,
whereas this function returns only the type of the N’th value.
FORM is the form of which to determine the type.
ENV is the environment in which the form occurs.
N is the index of the return value of which to return the type.
CONSTANT-EQL-TYPES if a flag for whether EQL type specifiers
should be returned for all constant forms. If NIL EQL types
specifiers are only returned for constants which are comparable
with EQL, that is NUMBERS, CHARACTERS and SYMBOLS.
EXPAND-COMPILER-MACROS is a flag, which if true, compiler-macros
are expanded prior to determining the type of FORM or a subform of
it.
Returns the type of the N’th return value of FORM. If there is no type information for the N’th value, that is FORM does not evaluate to multiple values or evaluates to less values than N, NIL is returned.
Extract the type of the N’th return value.
If TYPE is a VALUES type specifier, returns the type of the N’th
value, otherwise TYPE is treated as a VALUES type specifier with a
single value type.
TYPE is the type specifier.
N is the index of the return value of which to return the type.
Returns the N’th value type or NIL if there is no information about the N’th return value.
Invoke the RETURN-DEFAULT-TYPE restart for ‘MALFORMED-FORM-ERROR’ conditions.
This restart returns the type TYPE for the type of the malformed form.
Method for determining form types of custom forms.
This is useful for adding special type deduction logic for your
own functions, or for non-standard special forms.
OPERATOR is the form operator.
ARGUMENTS is the list of argument forms.
ENV is the environment in which the form is found. This might not be a native environment but an augmented environment from cl-environments.
(eql coerce)
) arguments env) ¶(eql values)
) args env) ¶(eql row-major-aref)
) args env) ¶(eql aref)
) args env) ¶(eql make-string)
) form env) ¶(eql make-array)
) form env) ¶(eql make-instance)
) form env) ¶Condition signalling that a form passed to FORM-TYPE is malformed.
program-error
.
form
.
Condition representing that an special operator was encountered which this library does not know how to process.
program-error
.
List of standard common lisp special forms
The name of the BLOCK of which the type is currently being determined.
List containing the list of value types returned by the current BLOCK form.
Flag for whether EQL type specifiers should be returned for all constant forms.
If NIL EQL types are only returned if a form evaluates to a
constant which is comparable with EQL, such as NUMBERS, CHARACTERS
and SYMBOLS. If T, an EQL type is returned for every form which
evaluates to a constant value.
Flag for whether compiler-macros should be expanded prior to determining form types.
Flag for whether RETURN-FROM forms to the block name *BLOCK-NAME* are treated as returning from the block, of which the type is currently being determined, (true) or they are treated as returning from a block nested in it (false).
Association list of the types of values returned from the current block by RETURN-FROM forms located within functions defined locally within the block.
Flag for whether the declared types, in the local environment, should be used.
If NIL the declared types in the global NIL environment are used.
The purpose of this is to support LOAD-TIME-VALUE, in which the
form is macroexpanded in the local environment but is actually
evaluated in the global environment, therefore it does not have
access to local variables.
The walk function to call on each form.
The type of result which should be returned by the walk function.
Like MATCH but with a default clause which signals a ‘MALFORMED-FORM-ERROR’ condition.
Evaluate forms in a RESTART-CASE with the RETURN-DEFAULT-TYPE restart established.
Evaluate FORMS returning the correct result type per *WALK-RESULT-TYPE*
RESULT is a symbol naming the symbol-macro introduced to FORMS, by
SYMBOL-MACROLET, which expands to FORM.
If *WALK-RESULT-TYPE* is LIST, FORMS are evaluated in an implicit
PROGN. These may reference the binding to the symbol-macro named by
RESULT.
If *WALK-RESULT-TYPE* is NIL, FORM is returned directly.
Walk a subform of a BLOCK form and extract the value types returned from the block by RETURN-FROM.
Extract RETURN-FROM value types from a local named function definition.
DEF is the list containing the function definition, with the first
element being the function name.
ENV is the environment in which the form is found.
Returns the list of value types which may be returned when the function is called.
Combine two type specifier using a combinator keyword.
If both types are a VALUES types, each corresponding value type is
combined into a list with the first element being COMBINATOR and
the next two elements being the type specifiers. If only one of the
types is a VALUES type, the other is treated as a VALUES type with
one value type.
If neither types are values types the result ‘(,COMBINATOR ,TYPE1
,TYPE2) is returned.
COMBINATOR is the symbol naming the combinator.
TYPES1 and TYPES2 are the types to combine.
DEFAULT-TYPE is the type used when combining the values type
specifier with more value types. When the all the value types in
the specifier with less values, are combined with value types from
the specifier with more values, the remaining extra values are
combined with DEFAULT-TYPE, unless the shorter values type
specifier also specifies a &REST type.
Returns the combined type specifier.
Determine the value of a constant form.
FORM is the form of which to determine the value. Must be a form
for which CONSTANTP returns true.
ENV is the environment in which FORM is found.
Return the type specifier of a constant value.
If the value is a CHARACTER, NUMBER or SYMBOL an EQL type specifier
is returned. Otherwise the type specifier returned by TYPE-OF is
returned.
VALUE is the constant value.
Expand compiler-macros in a function call expression.
Only expands compiler macros if *EXPAND-COMPILER-MACROS is set.
OPERATOR is the form operator.
ARGUMENTS is the argument list of the form.
ENV is the environment in which the form is found.
Returns the compiler-macro-expanded form or NIL if there is no compiler-macro for OPERATOR.
Determines the type of a form, in an environment, after macroexpand.
FORM is the form of which to determine the type.
ENV is the environment in which the form occurs.
Extract the list of value types returned by a BLOCK form.
*BLOCK-NAME* is the label naming the block.
FORM is a PROGN form representing the block body.
ENV is the environment in which the BLOCK form is contained.
Returns the list of value types which may be returned from the BLOCK form by an explicit RETURN-FROM form.
Determine the type of a FLET/LABELS form.
OPERANDS is the list of operands to the form.
ENV is the environment in which the form is found.
Determine the function type of a lambda expression.
LAMBDA-LIST is the lambda-list of the lambda expression.
BODY is the body of the lambda expression (the remainder of the
expression following the lambda-list).
ENV is the environment in which the form containing the lambda
expression is found.
Returns a (FUNCTION ...) specifier.
Determine the type of a LET/LET* form.
OPERANDS is the list of operands to the form.
ENV is the environment in which the form is found.
Determine the type of a list form.
OPERATOR is the list form operator.
ARGUMENTS is the list of arguments following the operator.
ENV is the environment in which the form occurs.
Determine the types of the RETURN-FROM forms in lexical functions.
NAMES is the list of the function names.
FUNCTIONS is the list of the function definitions as they appear in
the FLET or LABELS form.
ENV is the environment in which the lexical function definitions occur.
Parse a VALUES type specifier into its components.
SPEC is the VALUES type specifier list following the VALUES
keyword.
Returns a ‘VALUES-TYPE-SPEC’ object.
Substitute (CALL ...) types with actual types returned by the function.
In the types of the RETURN-FROM forms, located within a function,
types which reference the types of the RETURN-FROM forms in another
function ‘(CALL ...)‘ are replaced with the actual list of the
types of the RETURN-FROM forms in that function.
FTYPES is an association list with each entry of the form (FN
. TYPES) where FN is the function name and TYPES is the list of
type specifiers.
Returns the association list with the new RETURN-FORM form type lists.
Determine the type of a variable.
VARIABLE is the symbol naming the variable. This may name a
constant as well.
ENV is the environment in which the variable is found.
Walk the body of a form which modifies the lexical environment.
BODY is the list containing the form’s body. The first element of
the list may be a DECLARE expression.
ENV is the environment of the form body. This excludes declaration
information in DECLARE expressions located in BODY.
DOCUMENTATION is a flag for whether BODY may contain documentation
strings (true).
The remaining keyword arguments are additional arguments to pass to
AUGMENT-ENVIRONMENT on environment ENV.
Returns the new form body.
Walk a function definition.
DEF the function definition starting from the LAMBDA-LIST.
ENV the environment in which to walk the definition.
Apply a function on each subform in a form.
FN:
A function of two arguments that is called for each subform in
FORM, with two arguments: the form and the environment in which
it occurs.
It should return the following return values:
1. The new form. The subforms of this form are walked and it is
substituted in place of the old form, in the result returned
by WALK-FORM.
2. A Boolean flag. If true the subforms of the form returned
in (1) are not walked, and it is substituted as it is in the
result. Otherwise the subforms are walked.
FORM:
The form to walk. The function is first applied on FORM itself,
then on its subforms.
ENV:
The environment in which FORM is found.
RESULT-TYPE:
A symbol indicating the type of result that should be returned
from WALK-FORM:
LIST - The new form, built out of the subforms returned by FN, is
returned. This is the default.
NIL - No new form is constructed, meaning the return value of FN
is used only to determine which forms to walk next.
Returns the new transformed form, if RESULT-TYPE is LIST.
Internal code-walker function, that calls the current walk function (*WALK-FN*).
Walk each form in FORMS as if by WALK-FORM.
FORMS is a list of FORMS.
ENV is the environment in which to walk the forms.
Returns a list containing the results of walking each form, if *WALK-RESULT-TYPE* is LIST. Otherwise returns NIL.
Walk an ordinary lambda-list.
LIST is the lambda-list.
ENV is the environment in which the correspondign function
definition is found.
Returns two values:
1. The new lambda-list.
2. List of variables introduced by the lambda-list.
Walk a local function definition as by FLET or LABELS.
DEF the local function definition.
ENV the environment in which to walk the definition.
Walk the subforms in a new form returned by the walk function.
Extract RETURN-FROM types from a function call expression form appearing within a BLOCK form.
(eql labels)
) operands env) ¶(eql flet)
) operands env) ¶(eql function)
) operands env) ¶(eql load-time-value)
) operands env) ¶(eql return-from)
) operands env) ¶Method for RETURN-FROM forms.
If the block name is equal to *BLOCK-NAME* and *IN-BLOCK* is true, the type of the result form as if by FORM-TYPE% is returned, as well as the types of any nested RETURN-FROM forms.
(eql block)
) operands env) ¶malformed-form-error
)) ¶form
.
unknown-special-operator
)) ¶unknown-special-operator
)) ¶Determine the type of a special form.
OPERATOR is the form operator, which must name a special operator.
OPERANDS is the for argument list.
ENV is the environment in which the form is found.
(eql block)
) operands env) ¶(eql labels)
) operands env) ¶(eql flet)
) operands env) ¶(eql let*)
) operands env) ¶(eql let)
) operands env) ¶(eql symbol-macrolet)
) operands env) ¶(eql macrolet)
) operands env) ¶(eql return-from)
) operands env) ¶(eql throw)
) operands env) ¶(eql go)
) operands env) ¶(eql tagbody)
) operands env) ¶(eql locally)
) operands env) ¶(eql unwind-protect)
) operands env) ¶(eql eval-when)
) operands env) ¶(eql progv)
) operands env) ¶(eql progn)
) operands env) ¶(eql multiple-value-prog1)
) operands env) ¶(eql multiple-value-call)
) operands env) ¶(eql if)
) operands env) ¶(eql setq)
) operands env) ¶(eql load-time-value)
) operands env) ¶(eql the)
) operands env) ¶(eql function)
) operands env) ¶(eql quote)
) operands env) ¶Determine the type of a function call expression.
OPERATOR is the expression operator, which may be a special
operator.
ARGUMENTS is the list of arguments following the operator.
ENV is the environment in which the expression is found.
Walk a list form.
OPERATOR is the form operator.
OPERANDS is the form’s operand list.
ENV is the environment in which to walk the form.
(eql sb-int:named-lambda)
) operands env) ¶(eql sb-kernel:the*)
) operands env) ¶(eql truly-the)
) operands env) ¶(eql symbol-macrolet)
) operands env) ¶(eql macrolet)
) operands env) ¶(eql let*)
) operands env) ¶(eql let)
) operands env) ¶(eql labels)
) operands env) ¶(eql flet)
) operands env) ¶(eql function)
) operands env) ¶(eql the)
) operands env) ¶(eql setq)
) operands env) ¶(eql quote)
) operands env) ¶(eql load-time-value)
) operands env) ¶(eql tagbody)
) operands env) ¶(eql return-from)
) operands env) ¶(eql go)
) operands env) ¶(eql locally)
) operands env) ¶(eql eval-when)
) operands env) ¶(eql block)
) operands env) ¶Parse VALUES type specifier.
TYPES is the list of all type specifiers in the order in which they
appear. Lambda list keywords are removed from this list.
OPTIONAL-START is the index at which the &OPTIONAL keyword is found in the type specifier list. NIL if there is no &OPTIONAL keyword.
REST-P is true if the type specifier list contains an &REST keyword.
REST-TYPE is the &REST type specifier
ALLOW-OTHER-KEYS is true if the type specifier list contains the
keyword &ALLOW-OTHER-KEYS.
OTHER is a list of the elements following the last applicable valid component of the VALUES type specifier list. If non-NIL, this indicates a malformed VALUES type specifier.
Jump to: | (
B C E F G L M N O P R S V W |
---|
Jump to: | (
B C E F G L M N O P R S V W |
---|
Jump to: | *
+
A C F O R S T |
---|
Jump to: | *
+
A C F O R S T |
---|
Jump to: | B C F M P S T U V W |
---|
Jump to: | B C F M P S T U V W |
---|