This is the validate-list Reference Manual, version 1.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 08:01:21 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
validate-list
Allows you to validate the contents and structure of a list based off of a template
K1D77A
MIT
1.0.1
arithmetic-operators-as-words
(system).
lisp-unit
(system).
alexandria
(system).
src
(module).
Modules are listed depth-first from the system components tree.
validate-list/src
validate-list
(system).
package.lisp
(file).
conditions.lisp
(file).
validate-list.lisp
(file).
compile-template.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
validate-list/validate-list.asd
validate-list/src/package.lisp
validate-list/src/conditions.lisp
validate-list/src/validate-list.lisp
validate-list/src/compile-template.lisp
validate-list/src/conditions.lisp
package.lisp
(file).
src
(module).
bad-template-format
(condition).
bad-template-format-message
(reader method).
(setf bad-template-format-message)
(writer method).
bad-template-format-signaller
(reader method).
(setf bad-template-format-signaller)
(writer method).
bad-template-format-template
(reader method).
(setf bad-template-format-template)
(writer method).
failed-to-validate
(condition).
failed-to-validate-arg
(reader method).
(setf failed-to-validate-arg)
(writer method).
failed-to-validate-entry
(reader method).
(setf failed-to-validate-entry)
(writer method).
failed-to-validate-key
(reader method).
(setf failed-to-validate-key)
(writer method).
failed-to-validate-message
(reader method).
(setf failed-to-validate-message)
(writer method).
print-object
(method).
print-object
(method).
print-object
(method).
unknown-keyword
(condition).
unknown-keyword-keyword
(reader method).
(setf unknown-keyword-keyword)
(writer method).
unknown-keyword-message
(reader method).
(setf unknown-keyword-message)
(writer method).
signal-bad-template-format
(function).
signal-failed-to-validate
(function).
signal-unknown-keyword
(function).
validate-list/src/validate-list.lisp
conditions.lisp
(file).
src
(module).
current-keys
(function).
define-key
(function).
is-valid-template
(function).
repeat-pattern
(function).
repeat-test
(function).
same-structures-p
(function).
validate-list
(compiler macro).
validate-list
(function).
*compiled-hash*
(special variable).
*functions*
(special variable).
*validate-list-p-err-message*
(special variable).
handle-between
(function).
handle-contents
(function).
handle-equal
(function).
handle-greater-than
(function).
handle-length
(function).
handle-less-than
(function).
handle-maxlen
(function).
handle-minlen
(function).
handle-or
(function).
handle-satisfies
(function).
handle-type
(function).
keyword->function
(function).
map-plist
(function).
process-template-entry
(function).
quoted-p
(function).
validate-list/src/compile-template.lisp
validate-list.lisp
(file).
src
(module).
compile-template
(function).
argument
(function).
call-fun-check-true
(function).
compile-template-entry
(function).
fun
(function).
process-template-funs
(function).
Packages are listed by definition order.
validate-list
common-lisp
.
bad-template-format
(condition).
bad-template-format-message
(generic reader).
(setf bad-template-format-message)
(generic writer).
bad-template-format-signaller
(generic reader).
(setf bad-template-format-signaller)
(generic writer).
bad-template-format-template
(generic reader).
(setf bad-template-format-template)
(generic writer).
compile-template
(function).
current-keys
(function).
define-key
(function).
failed-to-validate
(condition).
failed-to-validate-arg
(generic reader).
(setf failed-to-validate-arg)
(generic writer).
failed-to-validate-entry
(generic reader).
(setf failed-to-validate-entry)
(generic writer).
failed-to-validate-key
(generic reader).
(setf failed-to-validate-key)
(generic writer).
failed-to-validate-message
(generic reader).
(setf failed-to-validate-message)
(generic writer).
is-valid-template
(function).
repeat-pattern
(function).
repeat-test
(function).
same-structures-p
(function).
unknown-keyword
(condition).
unknown-keyword-keyword
(generic reader).
(setf unknown-keyword-keyword)
(generic writer).
unknown-keyword-message
(generic reader).
(setf unknown-keyword-message)
(generic writer).
validate-list
(compiler macro).
validate-list
(function).
*compiled-hash*
(special variable).
*functions*
(special variable).
*validate-list-p-err-message*
(special variable).
argument
(function).
call-fun-check-true
(function).
compile-template-entry
(function).
fun
(function).
handle-between
(function).
handle-contents
(function).
handle-equal
(function).
handle-greater-than
(function).
handle-length
(function).
handle-less-than
(function).
handle-maxlen
(function).
handle-minlen
(function).
handle-or
(function).
handle-satisfies
(function).
handle-type
(function).
keyword->function
(function).
map-plist
(function).
process-template-entry
(function).
process-template-funs
(function).
quoted-p
(function).
signal-bad-template-format
(function).
signal-failed-to-validate
(function).
signal-unknown-keyword
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Takes in a valid TEMPLATE and returns a compiled 1 argument function. This function is called
with a list, ie the one you wish to validate. This function will signal a BAD-TEMPLATE-FORMAT condition if the template is bad.
Takes in a keyword and associates the keyword with the function. The function must accept two
arguments, the first an entry ie a value in a list wanting to be validated and the second an object
see any of the other uses of DEFINE-KEY in src/validate-list.lisp to get an idea what your lambda should look like. Here is
an example (define-key :n=
(lambda (entry arg)
(check-type entry number)
(check-type arg number)
(= entry arg)))
Now with the new keyword :n= defined this can be used in a template like so where list is ’(100)
and the template is ’((:n= 100)).
Takes in a TEMPLATE and attempts to make sure it has a valid structure. If it does not then signals condition BAD-TEMPLATE-FORMAT
Given a length and a list this will return a list of LENGTH with PATTERN-LIST repeated LENGTH times
Returns a list of length LENGTH which simply repeats VALIDATION-LIST
Given LIST and TEMPLATE of arbitrary depth, return t if they have the same structure or nil if not. In the event of any error this function returns nil, as the assumption is that the structures are not the same.
Takes in a LIST that you want to validate, and a TEMPLATE, the TEMPLATE is a list of lists,
each list contains keywords and their values (a full list of keys can be found by calling CURRENT-KEYS), if TEMPLATE is ’invalid’ then the condition BAD-TEMPLATE-FORM is signalled. Each list
within the template represents 1 element in the LIST and is a ’description’ of its contents.
For example given the template ’((:equal "key") (:type string :maxlen 40)) this could be used
to validate the list ’("key" "abcdeegadfgfsdf") because as the template says, the first item in
list is "key" and the second according to the template should be of type ’string and no longer
than 40 characters long, which it is not, so this is valid and will return t, if a list fails when
checked against the template then this func signals the condition FAILED-TO-VALIDATE, which
will contain information about where validation failed. For a list of examples see src/tests.lisp, the invalid templates are marked.
In the interests of speed no checks are done to validate the structure of your template
before validation happens,
you can use ’is-valid-template’ as a precursory check to make sure that the template is
constructed with valid plists and valid keywords. There is also the possibility that when you try
to validate a list where you expect a certain structure and get something else you will get a
BAD-TEMPLATE-FORM condition where the template is fine but the list is not, just treat this like
the validation failed.
bad-template-format
)) ¶bad-template-format
)) ¶bad-template-format
)) ¶bad-template-format
)) ¶bad-template-format
)) ¶bad-template-format
)) ¶failed-to-validate
)) ¶failed-to-validate
)) ¶failed-to-validate
)) ¶failed-to-validate
)) ¶failed-to-validate
)) ¶failed-to-validate
)) ¶failed-to-validate
)) ¶failed-to-validate
)) ¶unknown-keyword
)) ¶unknown-keyword
)) ¶unknown-keyword
)) ¶unknown-keyword
)) ¶bad-template-format
) stream) ¶failed-to-validate
) stream) ¶unknown-keyword
) stream) ¶error
.
:bad-template-format-template
Contains the condition which was called that caused this condition to be signalled
:bad-template-format-signaller
Message indicating what when wrong
:bad-template-format-message
error
.
:failed-to-validate-key
:failed-to-validate-arg
:failed-to-validate-entry
Message indicating what when wrong
:failed-to-validate-message
Given a keyword in KEYWORD, this function looks for the associated function in *functions* if found then the function is returned, otherwise a UNKNOWN-KEYWORD condition is signalled.
Maps a PLIST and calls FUNC that accepts two arguments. returns a list of funcall-result
Takes in a TEMPLATE and converts all the key args within each plist into the associated functions ready to be called
Jump to: | (
A B C D F G H I K M P Q R S U V |
---|
Jump to: | (
A B C D F G H I K M P Q R S U V |
---|
Jump to: | *
F K M S T |
---|
Jump to: | *
F K M S T |
---|
Jump to: | B C F M P S U V |
---|
Jump to: | B C F M P S U V |
---|