This is the lineva Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:37:42 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
lineva
Linear evaluation macro system
Li Dzangfan <li-fn@outlook.com>
GPLv3
0.0.1
lineva.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
lineva/lineva.lisp
lineva
(system).
available-instructions
(function).
definst
(macro).
describe-instruction
(function).
leva
(macro).
*expander-document-table*
(special variable).
*expander-table*
(special variable).
*rest-code-name*
(special variable).
always-eval
(macro).
define-instruction
(function).
extract-docstring
(function).
find-expander
(function).
has-docstring-p
(function).
unary-p
(function).
Packages are listed by definition order.
lineva
Package providing linear evaluation feature.
la
common-lisp
.
available-instructions
(function).
definst
(macro).
describe-instruction
(function).
leva
(macro).
*expander-document-table*
(special variable).
*expander-table*
(special variable).
*rest-code-name*
(special variable).
always-eval
(macro).
define-instruction
(function).
extract-docstring
(function).
find-expander
(function).
has-docstring-p
(function).
unary-p
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Define a instruction named KEYWORD. KEYWORD and LAMBDA-LIST
correspond to instruction in ‘leva’:
(KEYWORD LAMBDA-LIST...)
i.e.
(:instruction ...)
the BODY is a code which yield real code that the instruction KEYWORD
defined. Special symbol ‘$rest-code’ represents rest code of linear
evaluation. If the first element of BODY is a ‘string’, it will be
seen as ‘documentation’ of instruction KEYWORD. For example
(definst :println (thing)
"Print THING and newline."
‘(progn (princ ,thing) (terpri)
,$rest-code))
then
(la:leva (:println "Hello world!") (values))
will expand to
(progn (princ "Hello world!") (terpri) (values))
Evaluate every instruction in BODY sequentially. Every instruction
has one of following form:
(:instruction-name ...)
:instruction-name [= (:instruction-name)]
compound-form
where compound-form can be any valid lisp form except the first
two. For example
(la:leva
(:let (x 10) (y 20)) ; Define local variables
:break ; Create breakpoint
(list x y)) ; Any Lisp form
See ‘definst’ for more information about user-defined instruction-name. See ‘available-instructions’ for all defined instructions. Use ‘describe-instruction’ to get document of a instruction.
Documentation table of item in *expander-table*
A table of code transformer, whose keys are symbols and values are
function which has signature
(KEY REST-CODE OTHER-PARAMETERS) -> CODE
KEY is its corresponding symbol in the *evaluator-table*, REST-CODE is expanded code in linear evaluation. Take the following code for example:
((K₁ ...)
(K₂ ...)
(K₃ ...)
(K₄ ...))
the function corresponding to K₂ will receive code expanded from
((K₃ ...)
(K₄ ...))
as its REST-CODE. OTHER-PARAMETERS is a parameter list customized by user, which correspond to ... in the code above.
Equal to
(eval-when (:compile-toplevel :load-toplevel :execute) ...)
Define a new instruction called KEYWORD with FUNCTION. If the instruction has been defined, the old definition will be ignored.
Extract docstring and construct a better docstring by KEYWORD and LAMBDA-LIST.
Find expander in *expander-table* by SYMBOL, signal a error if nothing is found.
Determine whether BODY has docstring.
Return true if LIST is a list containing only one element.
Jump to: | A D E F H L M U |
---|
Jump to: | A D E F H L M U |
---|
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Jump to: | F L P S |
---|
Jump to: | F L P S |
---|