Introduce a
deflist introduces fixtypes of lists of arbitrary lengths.
Given such a fixtype, the macro
The lists may be true or dotted, depending on
the
Future versions of this macro could support richer constraints on list length than equality with a certain value, e.g. introduce fixtypes of lists of lengths below a certain value.
(deflist-of-len type :list-type ... :length ... :pred ... :fix ... :equiv ... :parents ... :short ... :long ... )
A symbol that specifies the name of the fixtype.
A symbol that names a fixtype previously introduced via deflist. This is the fixtype of the lists of arbitrary lengths, which are a superset of the lists of the generated fixtype.
The recognizer, fixer, and equivalence of the list fixtype must be all guard-verified. Let
list-pred ,list-fix andlist-equiv be their names.This input must be supplied; there is no default.
A non-negative integer that specifies the length of the lists.
This input must be supplied; there is no default.
A symbol that specifies the name of the recognizer for
type . If this isnil (the default), the name of the recognizer istype followed by-p .
A symbol that specifies the name of the fixer for
type . If this isnil (the default), the name of the fixer istype followed by-fix .
A symbol that specifies the name of the equivalence for
type . If this isnil (the default), the name of the equivalence istype followed by-equiv .
These, if present, are added to the XDOC topic generated for the fixtype.
The recognizer for the fixtype, guard-verified.
A rewrite rule saying that
pred is boolean-valued.
A rewrite rule and a forward chaining rule saying that a value satisfies
list-pred when it satisfiespred .
A tau system rule saying that if a value satisfies
pred then its length is the one specified by:length .
The fixer for the fixtype, guard-verified.
It fixes values outside of
pred by applying first take with the number specified by:length and thenlist-fix to the result.
A rewrite rule saying that
fix always returns a value that satisfiespred .
A rewrite rule saying that
fix disappears when its argument satisfiespred .
The fixtype, via a call of deffixtype that also introduces the equivalence
equiv .
The above items are generated with XDOC documentation.