This is the incf-cl Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 08 18:24:21 2024 GMT+0.
incf-cl/incf-cl.asd
incf-cl/package.lisp
incf-cl/function.lisp
incf-cl/lc.lisp
incf-cl/nest.lisp
incf-cl/unfold.lisp
incf-cl/range.lisp
incf-cl/prelude.lisp
incf-cl/unscan.lisp
incf-cl/fixed-point.lisp
incf-cl/hash-table.lisp
incf-cl/iteration.lisp
incf-cl/string.lisp
incf-cl/doctest.lisp
incf-cl/symbol.lisp
The main system appears first, followed by any subsystem dependency.
incf-cl
INCF CL is a library of convenience functions for Common Lisp
Juan M. Bello Rivas <jmbr@superadditive.com>
X11
cl-ppcre
(system).
package.lisp
(file).
function.lisp
(file).
lc.lisp
(file).
nest.lisp
(file).
unfold.lisp
(file).
range.lisp
(file).
prelude.lisp
(file).
unscan.lisp
(file).
fixed-point.lisp
(file).
hash-table.lisp
(file).
iteration.lisp
(file).
string.lisp
(file).
doctest.lisp
(file).
symbol.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
incf-cl/incf-cl.asd
incf-cl/package.lisp
incf-cl/function.lisp
incf-cl/lc.lisp
incf-cl/nest.lisp
incf-cl/unfold.lisp
incf-cl/range.lisp
incf-cl/prelude.lisp
incf-cl/unscan.lisp
incf-cl/fixed-point.lisp
incf-cl/hash-table.lisp
incf-cl/iteration.lisp
incf-cl/string.lisp
incf-cl/doctest.lisp
incf-cl/symbol.lisp
incf-cl/function.lisp
package.lisp
(file).
incf-cl
(system).
$
(function).
canonicalize-test
(function).
incf-cl/lc.lisp
function.lisp
(file).
incf-cl
(system).
lc
(macro).
translate-comprehension
(function).
translate-filter
(function).
translate-generator
(function).
translate-generator-or-filter
(function).
incf-cl/nest.lisp
lc.lisp
(file).
incf-cl
(system).
%nest-list
(function).
ensure-and-copy-list
(function).
incf-cl/unfold.lisp
nest.lisp
(file).
incf-cl
(system).
unfold
(function).
unfold-right
(function).
incf-cl/range.lisp
unfold.lisp
(file).
incf-cl
(system).
range
(function).
incf-cl/prelude.lisp
range.lisp
(file).
incf-cl
(system).
break*
(generic function).
cycle
(generic function).
drop
(generic function).
drop-while
(generic function).
flip
(function).
group
(generic function).
insert
(generic function).
intersperse
(generic function).
ncycle
(generic function).
nintersperse
(generic function).
partition
(generic function).
replicate
(function).
scan*
(generic function).
span
(generic function).
split-at
(generic function).
take
(generic function).
take-while
(generic function).
unzip
(function).
apply-key
(function).
first-with
(function).
function-or-null
(type).
scan-left*
(function).
scan-right*
(function).
incf-cl/unscan.lisp
prelude.lisp
(file).
incf-cl
(system).
unscan
(generic function).
incf-cl/fixed-point.lisp
unscan.lisp
(file).
incf-cl
(system).
fixed-point
(function).
incf-cl/hash-table.lisp
fixed-point.lisp
(file).
incf-cl
(system).
dohash
(macro).
incf-cl/iteration.lisp
hash-table.lisp
(file).
incf-cl
(system).
while
(macro).
incf-cl/string.lisp
iteration.lisp
(file).
incf-cl
(system).
string-join
(function).
incf-cl/doctest.lisp
string.lisp
(file).
incf-cl
(system).
*doctest-show-progress*
(special variable).
doctest
(function).
signals-p
(macro).
actual-values
(reader method).
doctest-failure
(condition).
expected-values
(reader method).
sexpr
(reader method).
test-docstring
(function).
test-function
(function).
incf-cl/symbol.lisp
doctest.lisp
(file).
incf-cl
(system).
list-all-symbols
(function).
list-external-symbols
(function).
Packages are listed by definition order.
incf-cl
common-lisp
.
$
(function).
*doctest-show-progress*
(special variable).
break*
(generic function).
cycle
(generic function).
doctest
(function).
dohash
(macro).
drop
(generic function).
drop-while
(generic function).
fixed-point
(function).
flip
(function).
group
(generic function).
insert
(generic function).
intersperse
(generic function).
lc
(macro).
list-all-symbols
(function).
list-external-symbols
(function).
ncycle
(generic function).
nest
(function).
nest-list
(function).
nintersperse
(generic function).
partition
(generic function).
range
(function).
replicate
(function).
scan*
(generic function).
signals-p
(macro).
span
(generic function).
split-at
(generic function).
string-join
(function).
take
(generic function).
take-while
(generic function).
unfold
(function).
unfold-right
(function).
unscan
(generic function).
unzip
(function).
while
(macro).
%nest-list
(function).
actual-values
(generic reader).
apply-key
(function).
canonicalize-test
(function).
doctest-failure
(condition).
ensure-and-copy-list
(function).
expected-values
(generic reader).
first-with
(function).
function-or-null
(type).
scan-left*
(function).
scan-right*
(function).
sexpr
(generic reader).
test-docstring
(function).
test-function
(function).
translate-comprehension
(function).
translate-filter
(function).
translate-generator
(function).
translate-generator-or-filter
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Determines if a dot will be displayed for each passed test.
DOHASH iterates over the keys and values of HASH-TABLE. It returns NIL or the result of evaluating RESULT-FORM if it was specified.
Assembles a multiset containing the results of evaluating COLLECTION-FORM and subject to QUANTIFIERS.
Returns T if evaluating BODY results in CONDITION being signalled, NIL otherwise.
Executes BODY while PREDICATE-FORM is non NIL.
Returns the composition of FUNCTIONS. Note that FUNCTIONS must
be composable in the order specified.
For example,
INCF-CL> (funcall ($ (lambda (x) (* x x))
(lambda (x) (+ x 2)))
2)
16
INCF-CL> (funcall ($ #’values #’floor #’sqrt (lambda (x) (expt x 2))) -2) 2
If SYMBOL corresponds to a function, then its documentation string
is tested and the results are printed to STREAM. If SYMBOL refers to
a package, then all the functions corresponding to the external
symbols in the package are tested.
DOCTEST returns T if the tests succeed, NIL otherwise.
Returns the fixed point of FUNCTION starting with INITIAL-VALUE.
The keyword argument TEST determines when a fixed point has been
reached. Use MAX-STEPS to stop after a certain (positive) number of
iterations.
For example, the square root of 2 using Newton’s method can be
computed as:
INCF-CL> (fixed-point (lambda (x)
(float (- x (/ (- (expt x 2) 2) (* 2 x)))))
1)
1.4142135
INCF-CL> (sqrt 2)
1.4142135
Applied to a binary function F, returns the same function with the order of the arguments reversed.
Returns a list containing all the symbols in PACKAGE.
Returns a list containing all the exported symbols in PACKAGE.
Returns a list of the results of applying FUNCTION successively to
INITIAL-VALUES and continuing until applying TEST (respectively
TEST-NOT) to the result is non NIL.
If M is specified, then NEST-LIST supplies the M most recent results
as arguments for TEST (respectivelly TEST-NOT) at each step.
If MAX is specified then FUNCTION is applied at most MAX times.
Returns a list contaning N times the value X
Returns a string joining each string in LIST by SEP. If SEP is not specified, the default separator is a space.
Returns a list built following the pattern:
transformer(initial-value), transformer(incrementor(initial-value)), ...
Examples:
1. List of squares: 1^2, ..., 10^2
INCF-CL> (unfold (lambda (x) (> x 10)) (lambda (x) (expt x 2)) #’1+ 1)
(1 4 9 16 25 36 49 64 81 100)
2. Append (3 4 5) onto (1 2)
INCF-CL> (unfold #’endp #’first #’rest (list 1 2) (lambda (x)
(declare (ignore x))
(list 3 4 5)))
(1 2 3 4 5)
See also:
http://srfi.schemers.org/srfi-1/srfi-1.html#unfold
Returns a list built following the pattern:
... transformer(incrementor(initial-value)), transformer(initial-value)
Examples:
1. List of squares: 1^2, ..., 10^2
INCF-CL> (unfold-right #’zerop (lambda (x) (* x x)) #’1- 10)
(1 4 9 16 25 36 49 64 81 100)
2. Reverse a proper list:
INCF-CL> (unfold-right #’endp #’first #’rest (list 1 2 3 4 5))
(5 4 3 2 1)
See also: http://srfi.schemers.org/srfi-1/srfi-1.html#unfold-right
Applied to the association list ALIST, returns two lists (as VALUES) containing the keys and values of each element in ALIST respectively. This function is the inverse of PAIRLIS.
Given a PREDICATE and a LIST, breaks LIST into two
lists (returned as VALUES) at the point where PREDICATE is first
satisfied. If PREDICATE is never satisfied then the first returned
value is the entire LIST and the second element is NIL.
KEY is a designator for a function of one argument, or NIL. If KEY is supplied, it is applied once to each element of LIST before it is passed to PREDICATE. If it is not supplied or is NIL, the element of LIST itself is used.
function
) (list list
) &key key) ¶Returns a circular list containing the elements in LIST (which should be a proper list).
Applied to N (a non-negative integer) and LIST,
returns the list with the specified number of elements removed from
the front of LIST. If LIST has less than N elements then it returns
NIL.
integer
) (list list
)) ¶Applied to PREDICATE and LIST, removes elements
from the front of LIST while PREDICATE is satisfied.
KEY is a designator for a function of one argument, or NIL. If KEY is supplied, it is applied once to each element of LIST before it is passed to PREDICATE. If it is not supplied or is NIL, the element of LIST itself is used.
function
) (list list
) &key key) ¶Returns a list of lists where every item in each
sublist satisfies TEST and the concatenation of the result is equal to
LIST.
KEY is a designator for a function of one argument, or NIL. If KEY
is supplied, it is applied once to each element of LIST before it is
passed to PREDICATE. If it is not supplied or is NIL, the element of
LIST itself is used.
For example,
INCF-CL> (mapcar (lambda (x) (concatenate ’string x))
(group (coerce "Mississippi" ’list)))
("M" "i" "ss" "i" "ss" "i" "pp" "i")
list
) &key key test test-not) ¶Inserts X before the first element in LIST which is
greater than X. The order relation can be specified by either one of
the keyword arguments TEST and TEST-NOT.
KEY is a designator for a function of one argument, or NIL. If KEY is supplied, it is applied once to each element of LIST before it is passed to PREDICATE. If it is not supplied or is NIL, the element of LIST itself is used.
list
) &key key test test-not) ¶Returns a list where ELEMENT is interspersed
between the elements of SEQUENCE.
For example,
INCF-CL> (intersperse ’x (replicate 3 ’z)) (Z X Z X Z)
Destructive version of CYCLE. Again, keep in mind that LIST must be a proper list.
Destructive version of INTERSPERSE.
list
)) ¶Applied to PREDICATE and LIST, returns two values: a list
containing all the elements from LIST that satisfy PREDICATE, and its
complementary list.
KEY is a designator for a function of one argument, or NIL. If KEY is supplied, it is applied once to each element of LIST before it is passed to PREDICATE. If it is not supplied or is NIL, the element of LIST itself is used.
function
) (list list
) &key key) ¶SCAN* is similar to REDUCE, but returns a list of
successive reduced values:
(scan* f (list x1 x2 ...) :initial-value z)
==> (z (funcall f z x1) (funcall f (funcall f z x1) x2) ...)
(scan* f (list x1 x2 ...))
==> (x1 (funcall f x1 x2) (funcall f (funcall f x1 x2) x2) ...)
(scan* f (list x1 ... x_n-1 x_n) :initial-value z :from-end t)
==> (... (funcall f x_n-1 (funcall f x_n z)) (funcall f x_n z) z)
(scan* f (list x1 ... x_n-1 x_n) :from-end t)
==> (... (funcall f x_n-1 (funcall f x_n-1 x_n)) (funcall f x_n-1 x_n) x_n)
Examples:
INCF-CL> (scan* #’/ (list 4 2 4) :initial-value 64)
(64 16 8 2)
INCF-CL> (scan* #’max (range 1 7) :initial-value 5)
(5 5 5 5 5 5 6 7)
INCF-CL> (scan* (lambda (x y) (+ (* 2 x) y)) (list 1 2 3) :initial-value 4)
(4 9 20 43)
INCF-CL> (scan* #’+ (list 1 2 3 4))
(1 3 6 10)
INCF-CL> (scan* #’+ (list 1 2 3 4) :initial-value 5 :from-end t)
(15 14 12 9 5)
INCF-CL> (scan* #’+ (list 1 2 3 4) :from-end t)
(10 9 7 4)
function
) (list list
) &key key from-end initial-value) ¶Splits LIST into two lists (returned as VALUES)
such that elements in the first list are taken from the head of LIST
while PREDICATE is satisfied, and elements in the second list are the
remaining elements from LIST once PREDICATE is not satisfied.
KEY is a designator for a function of one argument, or NIL. If KEY is supplied, it is applied once to each element of LIST before it is passed to PREDICATE. If it is not supplied or is NIL, the element of LIST itself is used.
function
) (list list
) &key key) ¶Given a non-negative integer N and LIST, splits
LIST into two lists (returned as VALUES) at the position corresponding
to the given integer. If N is greater than the length of LIST, it
returns the entire list first and the empty list second in VALUES.
integer
) (list list
)) ¶Applied to the integer N and LIST, returns the specified number of elements from the front of LIST. If LIST has less than N elements, TAKE returns the entire LIST.
integer
) (list list
)) ¶Applied to PREDICATE and LIST, returns a list
containing elements from the front of LIST while PREDICATE is
satisfied.
KEY is a designator for a function of one argument, or NIL. If KEY is supplied, it is applied once to each element of LIST before it is passed to PREDICATE. If it is not supplied or is NIL, the element of LIST itself is used.
function
) (list list
) &key key) ¶Semi-inverse of SCAN*.
INCF-CL> (equal (unscan (flip #’-) (scan* #’+ ’(1 2 3)) :initial-value 0)
’(1 2 3))
T
Returns a validated test function for those functions that use TEST and TEST-NOT keyword arguments.
Returns T if the first doctest found in DOCUMENTATION passes, signals DOCTEST-FAILURE otherwise.
Returns T if every test in FUNCTION’s docstring passes, NIL otherwise.
doctest-failure
)) ¶doctest-failure
)) ¶doctest-failure
)) ¶Jump to: | $
%
A B C D E F G I L M N P R S T U W |
---|
Jump to: | $
%
A B C D E F G I L M N P R S T U W |
---|
Jump to: | *
A E S |
---|
Jump to: | *
A E S |
---|
Jump to: | C D F H I L N P R S T U |
---|
Jump to: | C D F H I L N P R S T U |
---|