Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the colliflower Reference Manual, version 0.2.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 13:08:58 2020 GMT+0.
• Introduction | What colliflower is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
Colliflower is a set of generic interfaces for lisp collections.
The full documentation can be found here.
Colliflower has four components:
Each of these components are described below.
Liter provides an abstraction and tools for iterators.
A liter iterator is simply a function which returns the next value with
each invocation and signals and end of iteration with an ITERATION-ENDED
condition.
A liter iterable is any object for which there is a method defined for the
GET-ITERATOR
generic function. An iterator (or more generally a function)
is an iterable whose iterator is itself. The LITER
package provides GET-ITERATOR
methods for lists, vectors, hash-tables, streams, and arrays, as well as functions to
get iterators over those structures in different ways (such as treating lists as plists
or alists, or iterating over the lines of a character stream).
Liter also provides:
ITERATE
libraryITER-OBJECT
class that can be used for iterators with complex state.Garten provides a generic abstraction for building new data structures. It
is a more generic form of the COLLECTING
macro.
The core of garten is the concept of a "grower". A grower is an object that stores the state of a collection while it is being built. The grower itself may or may not be the final result. For example: the grower for a list may keep handles for both the head and tail of the list to efficiently append elements, or the grower for an immutable data structure may itself be mutable.
The basic interface for garten consists of three generic functions:
MAKE-GROWER
creates a new grower for some type. Note that the TYPE
argument is
the type of the final data structure, not the type of the grower.FEED
adds an item to the grower, which will eventually be part of the final
structure.FRUIT
retrieves the final result of the grower. In general it is not safe to call
FRUIT
, FEED
, or RESET-GROWER
after FRUIT
has been called for a grower, as doing so
may mutate the result returned by previous calls to FRUIT
.Garten defines the above interface for lists, plists, vectors, hash-tables, strings, etc.
Garten also provides WITH-GROWER
which is similar to the oft-implemented COLLECTING
macro, and a GROWING
directive for the iterate library.
Silo provides a generic way to access and set values of data structures by a key. The key may be a normal key, or an index.
Colliflower is brings the four above components together. The colliflower
package exports
all of the public symbols from liter
, garten
, and silo
and provides a few additional tools that combine functionality from the packages.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Next: The colliflower/interface system, Previous: Systems, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com>
MIT
Generic interfaces for collections and iterators.
0.2.1
asdf-package-system
colliflower.asd (file)
Next: The colliflower/ext system, Previous: The colliflower system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com>
MIT
colliflower.asd (file)
lisp.lisp (file)
Next: The liter system, Previous: The colliflower/interface system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com>
MIT
colliflower.asd (file)
lisp.lisp (file)
Next: The liter/interface system, Previous: The colliflower/ext system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com>
MIT
Collection of tools for basic iterators
0.2.0
liter/interface (system)
liter.asd (file)
Next: The liter/tools system, Previous: The liter system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com>
MIT
liter.asd (file)
lisp.lisp (file)
Next: The liter/generate system, Previous: The liter/interface system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com>
MIT
liter.asd (file)
lisp.lisp (file)
Next: The liter/file system, Previous: The liter/tools system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com>
MIT
liter.asd (file)
lisp.lisp (file)
Next: The liter/iter-object system, Previous: The liter/generate system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com>
MIT
liter.asd (file)
lisp.lisp (file)
Next: The silo system, Previous: The liter/file system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com>
MIT
closer-mop
liter.asd (file)
lisp.lisp (file)
Next: The silo/interface system, Previous: The liter/iter-object system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com
MIT
Generic getters and setters for data structures.
0.2.0
silo/interface (system)
silo.asd (file)
Next: The silo/base system, Previous: The silo system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com
MIT
silo.asd (file)
lisp.lisp (file)
Next: The silo/protocol system, Previous: The silo/interface system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com
MIT
silo/protocol (system)
silo.asd (file)
lisp.lisp (file)
Next: The garten system, Previous: The silo/base system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com
MIT
silo.asd (file)
lisp.lisp (file)
Next: The garten/interface system, Previous: The silo/protocol system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com
Generic interface for "growing" data structures/collections.
0.1.0
garten/interface (system)
garten.asd (file)
Next: The garten/base system, Previous: The garten system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com
garten.asd (file)
lisp.lisp (file)
Next: The garten/list system, Previous: The garten/interface system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com
garten.asd (file)
lisp.lisp (file)
Next: The garten/tools system, Previous: The garten/base system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com
garten.asd (file)
lisp.lisp (file)
Next: The garten/grower system, Previous: The garten/list system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com
garten.asd (file)
lisp.lisp (file)
Next: The liter/base system, Previous: The garten/tools system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com
garten.asd (file)
lisp.lisp (file)
Previous: The garten/grower system, Up: Systems [Contents][Index]
Thayne McCombs <bytecurry.software@gmail.com>
MIT
liter.asd (file)
lisp.lisp (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
Next: The silo․asd file, Previous: Lisp files, Up: Lisp files [Contents][Index]
colliflower.asd
Next: The garten․asd file, Previous: The colliflower․asd file, Up: Lisp files [Contents][Index]
silo/silo.asd
Next: The liter․asd file, Previous: The silo․asd file, Up: Lisp files [Contents][Index]
garten/garten.asd
Next: The colliflower/interface/lisp․lisp file, Previous: The garten․asd file, Up: Lisp files [Contents][Index]
liter/liter.asd
Next: The colliflower/ext/lisp․lisp file, Previous: The liter․asd file, Up: Lisp files [Contents][Index]
colliflower/interface (system)
interface.lisp
Next: The liter/interface/lisp․lisp file, Previous: The colliflower/interface/lisp․lisp file, Up: Lisp files [Contents][Index]
colliflower/ext (system)
ext.lisp
grow-from-iterable (function)
Next: The liter/tools/lisp․lisp file, Previous: The colliflower/ext/lisp․lisp file, Up: Lisp files [Contents][Index]
liter/interface (system)
liter/interface.lisp
Next: The liter/generate/lisp․lisp file, Previous: The liter/interface/lisp․lisp file, Up: Lisp files [Contents][Index]
liter/tools (system)
liter/tools.lisp
Next: The liter/file/lisp․lisp file, Previous: The liter/tools/lisp․lisp file, Up: Lisp files [Contents][Index]
liter/generate (system)
liter/generate.lisp
ilist (function)
Next: The liter/iter-object/lisp․lisp file, Previous: The liter/generate/lisp․lisp file, Up: Lisp files [Contents][Index]
liter/file (system)
liter/file.lisp
Next: The silo/interface/lisp․lisp file, Previous: The liter/file/lisp․lisp file, Up: Lisp files [Contents][Index]
liter/iter-object (system)
liter/iter-object.lisp
Next: The silo/base/lisp․lisp file, Previous: The liter/iter-object/lisp․lisp file, Up: Lisp files [Contents][Index]
silo/interface (system)
silo/interface.lisp
Next: The silo/protocol/lisp․lisp file, Previous: The silo/interface/lisp․lisp file, Up: Lisp files [Contents][Index]
silo/base (system)
silo/base.lisp
Next: The garten/interface/lisp․lisp file, Previous: The silo/base/lisp․lisp file, Up: Lisp files [Contents][Index]
silo/protocol (system)
silo/protocol.lisp
Next: The garten/base/lisp․lisp file, Previous: The silo/protocol/lisp․lisp file, Up: Lisp files [Contents][Index]
garten/interface (system)
garten/interface.lisp
Next: The garten/list/lisp․lisp file, Previous: The garten/interface/lisp․lisp file, Up: Lisp files [Contents][Index]
garten/base (system)
garten/base.lisp
*default-grower-size* (special variable)
Next: The garten/tools/lisp․lisp file, Previous: The garten/base/lisp․lisp file, Up: Lisp files [Contents][Index]
garten/list (system)
garten/list.lisp
Next: The garten/grower/lisp․lisp file, Previous: The garten/list/lisp․lisp file, Up: Lisp files [Contents][Index]
garten/tools (system)
garten/tools.lisp
with-grower (macro)
clause-growing-from-3 (macro)
Next: The liter/base/lisp․lisp file, Previous: The garten/tools/lisp․lisp file, Up: Lisp files [Contents][Index]
garten/grower (system)
garten/grower.lisp
Previous: The garten/grower/lisp․lisp file, Up: Lisp files [Contents][Index]
liter/base (system)
liter/base.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
Next: The colliflower/ext package, Previous: Packages, Up: Packages [Contents][Index]
Combination of the LITER, SILO, and GARTEN packages.
lisp.lisp (file)
Next: The liter/interface package, Previous: The colliflower/interface package, Up: Packages [Contents][Index]
Extra utitilies that combine liter, garten, and/or silo
lisp.lisp (file)
grow-from-iterable (function)
Next: The liter/tools package, Previous: The colliflower/ext package, Up: Packages [Contents][Index]
Liter is a collection of tools to work with basic iterators.
An iterator in Liter is just a function (usually a closure) which returns
the next value in the iterable, and signals a ITERATION-ENDED condition
if there are no more values. It should follow the following rules:
* An iterator MAY be called with optional, keyword, or rest arguments, but MUST function
correctly if called with no arguments.
* If an iterator has completed, it SHOULD signal an ITERATION-ENDED condition, typically using
END-ITERATION.
* Once an iterator signals an ITERATION-ENDED condition, it SHOULD signal an ITERATION-ENDED
condition on each future call, unless something changes the state of the iterator so that it
can continue iterating.
* Client code SHOULD handle any ITERATION-ENDED condition, or use a function or macro that does
(such as the iterate drivers, DO-ITERATOR, etc).
* Additional return values may be ignored by the caller of an iterator.
* By convention, key-value pairs SHOULD be represented as a cons pair. (as in alists)
* An iterator MAY be infinite, but not all liter functions can be safely used with such
iterators. Functions such as ITAKE can be used to convert an infinite iterator to a finite one.
An iterable is any object for which there is a method defined for GET-ITERATOR.
Most liter function accept an iterable, and will get an iterator using GET-ITERATOR.
There is a GET-ITERATOR method defined for iterators that is equivalent to the identity
function, so iterators can be passed to these functions.
lisp.lisp (file)
Next: The liter/generate package, Previous: The liter/interface package, Up: Packages [Contents][Index]
lisp.lisp (file)
Next: The liter/file package, Previous: The liter/tools package, Up: Packages [Contents][Index]
lisp.lisp (file)
ilist (function)
Next: The liter/iter-object package, Previous: The liter/generate package, Up: Packages [Contents][Index]
lisp.lisp (file)
Next: The silo/interface package, Previous: The liter/file package, Up: Packages [Contents][Index]
lisp.lisp (file)
liter-object
common-lisp
Next: The silo/base package, Previous: The liter/iter-object package, Up: Packages [Contents][Index]
lisp.lisp (file)
Next: The silo/protocol package, Previous: The silo/interface package, Up: Packages [Contents][Index]
lisp.lisp (file)
Next: The garten/interface package, Previous: The silo/base package, Up: Packages [Contents][Index]
lisp.lisp (file)
common-lisp
Next: The garten/base package, Previous: The silo/protocol package, Up: Packages [Contents][Index]
Garten is a library that provides a generic interface to build collections.
lisp.lisp (file)
Next: The garten/list package, Previous: The garten/interface package, Up: Packages [Contents][Index]
lisp.lisp (file)
*default-grower-size* (special variable)
Next: The garten/tools package, Previous: The garten/base package, Up: Packages [Contents][Index]
lisp.lisp (file)
Next: The garten/grower package, Previous: The garten/list package, Up: Packages [Contents][Index]
lisp.lisp (file)
with-grower (macro)
clause-growing-from-3 (macro)
Next: The liter/base package, Previous: The garten/tools package, Up: Packages [Contents][Index]
lisp.lisp (file)
Previous: The garten/grower package, Up: Packages [Contents][Index]
lisp.lisp (file)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported macros | ||
• Exported compiler macros | ||
• Exported functions | ||
• Exported generic functions | ||
• Exported conditions | ||
• Exported classes |
Next: Exported compiler macros, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Define SGET and (SETF SGET) for a place to use sget with.
lisp.lisp (file)
Loop over all items in the iterable ITERABLE, in a manner similar to dolist.
lisp.lisp (file)
A DO macro in the style of dolist that executes body for each item in ITERATOR.
lisp.lisp (file)
Create an iterator that executes BODY each time.
Basically a simple wrapper for LAMBDA. Iteration can be ended by calling END-ITERATION.
lisp.lisp (file)
Macro form of MAKE-STATE-ITERATOR. Note that in this form INITIAL-STATE is required.
lisp.lisp (file)
Recursive get. Calls sget for each key in turn from left to right.
As long as (SETF SGET) is defined for the final result, RGET is setfable.
lisp.lisp (file)
Modify macro that sets a place equal to the result of SUPDATE.
lisp.lisp (file)
Macro similar to WITH-OPEN-FILE, but VAR is bound to a file iterator instead of a STREAM. The result is guaranteed to be an actual iterator, even if closer-mop isn’t enabled.
lisp.lisp (file)
Execute BODY where FEEDER is a function that takes a single argument, which is added
to the resulting data structure.
TYPE is the type of the structure to create. And ARGS are passed through to MAKE-GROWER.
WITH-GROWER returns the result (fruit) of the grower.
lisp.lisp (file)
Next: Exported functions, Previous: Exported macros, Up: Exported definitions [Contents][Index]
lisp.lisp (file)
Next: Exported generic functions, Previous: Exported compiler macros, Up: Exported definitions [Contents][Index]
Create a key to access values in alists with sget
Convenience function to return values for an iterator that has reached the end.
lisp.lisp (file)
Var-arg form of feed. Add multiple items at once.
lisp.lisp (file)
Create a growable of type TYPE from an iterable.
TYPE-ARGS are additional arguments to pass to MAKE-GROWER after the type.
lisp.lisp (file)
Return an iterator that accumulates the results of appling OP to the previous
result and the current item.
IACCUMULATE is like IFOLD that keeps track of intermediary results.
lisp.lisp (file)
Return a new iterator that iterates through each of the iterables passed to it in series.
lisp.lisp (file)
Create an iterator that just counts up from FROM by amount BY forever.
The returned iterator takes an optional argument which resets the counter if true.
If a TO parameter is provided, then the counter will stop when the value returned would equal the TO parameter. Note that if using a BY parameter it is possible to step over the TO end-point, but a >= comparison is undesirable because it wouldn’t work for a negative step.
lisp.lisp (file)
Create an iterator that iterates through ITERABLE, and then cycles through
the values again.
This stores the results of iterating over ITERABLE.
lisp.lisp (file)
Create an iterator that cycles through the arguments passed to it.
lisp.lisp (file)
Return an iterator over the elements of iterable after dropping the first n.
lisp.lisp (file)
Return an iterator over the elements of iterable that drops the initial elements while PRED returns false for them. This is the inverse of ITAKE-WHILE.
lisp.lisp (file)
Return a new iterator that iterates over the values of ITERABLE for which PREDICATE is true.
lisp.lisp (file)
Fold over an iterable.
ITERABLE is the iterable to fold over.
OP is a binary operation that takes the accumulated result, and an iterated item
and returns a new accumulated result.
INITIAL is the initial accumulated state.
lisp.lisp (file)
Return the next value of an iterator and whether or not an actual value was
retrieved as values.
Any additional arguments are passed through to the iterator function.
lisp.lisp (file)
Create an iterator that returns the value V N times.
If N is negative (the default) iterate forever.
Note that CONSTANTLY is equivalent to IREPEAT with a negative N,
and in fact there is a compiler macro that compiles IREPEAT as CONSTANTLY
in that case.
lisp.lisp (file)
Take the first N elements of iterable. Returns an iterator.
lisp.lisp (file)
Return an iterator that returns elements from ITERABLE as long as PRED returns true when passed the value. Not that this will consume the first item where PRED returns nil and not return it.
lisp.lisp (file)
Split a single iterable into N iterators.
The iterators are returned as values.
Note that ITEE depends on the iterator of iterable signaling an END-ITERATION
if the iterator has ended, even if an END-ITERATION has already been signaled.
lisp.lisp (file)
Create a list from an iterator. Note that this will only work if the iterator terminates.
lisp.lisp (file)
Return an iterator that iterates over transformed values of an iterable.
ITERABLE is on object for which GET-ITERATOR is defined.
MAP-FUN is a function which is called with each value returned by the iterator
and returns the value that the new iterator should return.
lisp.lisp (file)
Zip iterables together.
This returns an iterator that returns a list of the results of getting the next value from each iterable. The iterator ends when the shortest of the iterables ends.
lisp.lisp (file)
Like IZIP but stops on the longest iterable.
When a shorter iterable ends, it will continually return MISSING-VALUE until
the whole iterator ends.
lisp.lisp (file)
Zip an iterable with an index.
Each element of the new iterator is a list of the index (starting with 0) and the next element of ITERABLE.
lisp.lisp (file)
Get an iterator for a binary input stream.
lisp.lisp (file)
Get an iterator for a character input stream
lisp.lisp (file)
Create a FILE-ITERATOR using the same arguments as OPEN. In fact this is basically like OPEN, but
returns a FILE-ITERATOR instead of a stream.
If a reader function is supplied, then that function is used to read elements from the file. So for example,
#’read-line can be used for the iterator to return lines at a time. The reader function takes an input stream
as an argument.
By default READ-CHAR is used for a character stream and READ-BYTE is used for binary streams.
lisp.lisp (file)
Get an iterator over the keys of H.
lisp.lisp (file)
Get an iterator over the values of H.
lisp.lisp (file)
Get an iterator that iterates over lines in a character stream.
lisp.lisp (file)
Create an iterator that starts with an initial state INITIAL and on each call to the iterator STATE-MACHINE is called with the previous state as the first argument followed by any arguments passed to the iterator function. The return value is then stored and used for the next iteration.
Note that STATE-MACHINE will be called on the first iteration with INITIAL as the state.
This can be used to create simple state machines.
lisp.lisp (file)
Create a key to access an item in a plist
A combination of RGET and APPLY. It repeatedly calls SGET on successive results for each key, and the last argument is a list of keys to use.
lisp.lisp (file)
Create an iterator that returns element on the first iteration, and
ends on the second.
Equivalent to ‘(irepeat element 1)‘.
lisp.lisp (file)
Next: Exported conditions, Previous: Exported functions, Up: Exported definitions [Contents][Index]
Test if a container contains an element or key.
The exact semantics of whether or not a container contains an
element depend on the container.
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
Add an item to the collection. If the collection needs a key-value
pair, ITEM should be a CONS cell with the key as the CAR and the value as the CDR.
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
This is a shorthand for (nconc grower (list item))
It is defined for consistancy, but using a LIST-GROWER is more efficient for building lists.
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
Add all items from ITERABLE into GROWER. The default method
just iterates over iterable and calls FEED with each item.
The function is generic so that GROWERs can use more efficient methods if desired.
lisp.lisp (file)
lisp.lisp (file)
More efficient way to append a list to a list-grower.
Note that the list passed in may be destructively modified. If you want a copy of the list to be appended, you can use a liter iterator over the list instead of the list itself.
lisp.lisp (file)
The stream that the file-iterator is backed by.
lisp.lisp (file)
Return the final result of a grower.
A grower doesn’t necessarily need this to be defined if there is another way to access the result,
but in most cases it should be supplied.
It is undefined what happens if this is called more than once for the same grower. Or more specifically, the behavior depends on the grower implementation.
lisp.lisp (file)
If we got the result of a stream, then we should close it.
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
Default method for fruit for a GROWER. Just returns GROWER-STATE.
Default implementation is to just return the grower itself.
Get an iterator for some iterable object. Implementations are provided for builtin iterable types.
lisp.lisp (file)
The iterator for a function is just the function
The nil iterator is always empty
Iterator for the items of a list, or pairs of an alist.
Iterate over the items of a vector respecting the fill-counter if extant.
Iterate over elements of array in row-major order.
Iterate over elements of a hash-table. Returns a cons of the key and value.
Since a clousre over a the form from a HASH-TABLE-ITERATOR is undefiend, at the time
of creation a list of keys is created and the iterator closes over that.
If you know of a better way of doing this, please let me know.
Iterate over the elements of a stream. I.e. the characters of a character stream or the bytes of a byte stream.
Alias for FRUIT.
lisp.lisp (file)
If we got the result of a stream, then we should close it.
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
Default method for fruit for a GROWER. Just returns GROWER-STATE.
Default implementation is to just return the grower itself.
The state of the grower. By default this is what is returned by FRUIT.
lisp.lisp (file)
Predicate to test if the iterator has ended.
Get the next object in the iter-object iterator.
Get the previous object in the iter-object iterator.
This is optional for iter-object implementations.
lisp.lisp (file)
Make a grower object that can be used to "grow"
a collection. The returned object must define the FEED method and in most
cases should define the FRUIT method and RESET-GROWER methods.
The TYPE argument is an object for which a MAKE-GROWER method is specialized, usually a symbol.
lisp.lisp (file)
Create a grower for a hash-table. Any additional arguments will be passed through to MAKE-HASH-TABLE.
lisp.lisp (file)
Create a grower for a string. @cl:param(element-type) is the element type of the resulting string.
lisp.lisp (file)
Create a growable vector. @cl:param(size) is the initial size of the vector to grow,
@cl:param(element-type) is the element-type of the vector. And if @cl:param(adjustable)
is false, then the vector cannot be grown beyond SIZE.
The resulting vector will have a fill pointer.
lisp.lisp (file)
Create a grower for an alist. Items should be added as cons cells.
This is basically just a shortcut for a list grower with prepend set to true.
lisp.lisp (file)
Create a grower that create a plist. Items should be added as a cons cell
with the key and value as the car and cdr respectively.
If an item is passed to FEED that isn’t a cons, then the output will use the item as a key and the default passed as DEFAULT as the value.
lisp.lisp (file)
Create a grower that creates a list.
By default items are added to the end of the list, and the list is built using a LIST-GROWER.
However, if PREPEND is true, then items are pushed onto the front of the list.
lisp.lisp (file)
Reset a grower to an empty collection.
This can be used to recycle data structures if the result is no longer used.
But it is undefined whether it is safe to use the result of FRUIT after RESET-GROWER
has been called on the grower that generated it.
It also may not be defined for all growers.
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
Generic delete function. Companion to sget and sset.
Like SSET it MUST return the object with changes.
Generic get function. Provides a uniform way to
access properties of an object. The s stands for super, simple, or standard.
It is setfable as long as @c((setf sget)) is defined as well, which it should be for mutable objects.
lisp.lisp (file)
(setf sget) (generic function)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
Generic set function. companion to sget.
SSET should mutate OBJECT.
Note that for some data types (ex lists, objects) this can’t be used to set new values.
You may be able to use SUPDATE in those cases.
lisp.lisp (file)
sget (generic function)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
lisp.lisp (file)
SREMOVE is to SDEL what SUPDATE is to (SETF SGET):
It returns a collection with the item for KEY removed which may or may not be
the same object as OBJECT, and which may or may not mutate OBJECT.
lisp.lisp (file)
Generic update function. Unlike (SETF SGET) it may or may not mutate
OBJECT. Data structures should define one or both of (SETF SGET) and SUPDATE.
SUPDATE MUST return the updated object.
For immutable data structures, SUPDATE can be used to create updated data structures. It also works for prepending to lists such as plists or alists.
lisp.lisp (file)
For an ALIST supdate will either replace an existing value, or add a new cons pair to the front of the list if the associated key isn’t already in the list.
lisp.lisp (file)
lisp.lisp (file)
Default implementation just calls SSET and returns OBJECT.
Next: Exported classes, Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
Condition signaled when an iterator has reached the end.
lisp.lisp (file)
simple-condition (condition)
unhandled-iteration-end (condition)
Previous: Exported conditions, Up: Exported definitions [Contents][Index]
An iterator object that represents the iteration state of iterating over a file stream.
lisp.lisp (file)
iter-object (class)
The stream that the file-iterator is backed by.
file-stream
:file-stream
file-iterator-stream (generic function)
(setf file-iterator-stream) (generic function)
The function to use to read from the stream. The results of calling this function will be the elements of the iterator.
(function (stream) t)
:reader
file-iterator-reader (generic function)
(setf file-iterator-reader) (generic function)
Base class for specialized growers.
Note that not all grower’s will be subclasses of GROWER.
lisp.lisp (file)
standard-object (class)
The state of the grower. By default this is what is returned by FRUIT.
:init-state
grower-state (generic function)
(setf grower-state) (generic function)
A class to represent an iterator object.
It is a funcallable object that calls ITER-OBJECT-NEXT when called.
Subclasses should use a metaclass of CLOSER-MOP:FUNCALLABLE-STANDARD-CLASS.
lisp.lisp (file)
funcallable-standard-object (class)
file-iterator (class)
initialize-instance (method)
A grower for a list that allows appending elements in constant time.
lisp.lisp (file)
grower (class)
A queue of items added. This makes insertion at the end a constant time operation.
(serapeum:queue)
A grower that creates a plist. Items added should be cons cells
of the key and value. If an item isn’t a cons cell it is treated as a key, with a value
of DEFAULT-VALUE.
lisp.lisp (file)
grower (class)
The default value to store in the plist if the fed item isn’t a cons cell.
:default
plist-grower-default (generic function)
A List grower that prepends values rather than appending them.
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal macros | ||
• Internal functions | ||
• Internal generic functions | ||
• Internal conditions | ||
• Internal classes |
Next: Internal macros, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
The default initial size to use when creating a grower that needs an initial size, such as a vector.
lisp.lisp (file)
Next: Internal functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
Iterate over all items in an iterable.
lisp.lisp (file)
Iterate over all items in an iterator.
lisp.lisp (file)
Iterate clause similar to COLLECT but can grow any growable structure.
TYPE is the type of growable to create. If TYPE is a symbol it doesn’t need to be quoted.
If provided, GROWER-ARGS should be a plist of arguments to pass to MAKE-GROWER
after the TYPE parameter.
Note that VAR will contain the grower object, not the end result. If you store
the grower in a variable it is up to you to call FRUIT on the grower when needed.
EXPR is the actual expression to store in the grower.
lisp.lisp (file)
Next: Internal generic functions, Previous: Internal macros, Up: Internal definitions [Contents][Index]
lisp.lisp (file)
lisp.lisp (file)
Iterate over the arguments passed in. Then terminate.
lisp.lisp (file)
Next: Internal conditions, Previous: Internal functions, Up: Internal definitions [Contents][Index]
The function to use to read from the stream. The results of calling this function will be the elements of the iterator.
lisp.lisp (file)
The default value to store in the plist if the fed item isn’t a cons cell.
lisp.lisp (file)
Next: Internal classes, Previous: Internal generic functions, Up: Internal definitions [Contents][Index]
Error signaled if an iterator is ended and the ITERATION-ENDED condition isn’t handled in some way.
lisp.lisp (file)
Previous: Internal conditions, Up: Internal definitions [Contents][Index]
lisp.lisp (file)
standard-object (class)
:item
(or function symbol)
:key
(or function symbol)
:test
(quote eql)
lisp.lisp (file)
standard-object (class)
:key-item
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F G L S |
---|
Jump to: | C F G L S |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | %
(
A C D E F G I M P R S W |
---|
Jump to: | %
(
A C D E F G I M P R S W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
D G I K R S T |
---|
Jump to: | *
D G I K R S T |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | %
C F G I L P S U |
---|
Jump to: | %
C F G I L P S U |
---|