Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the generic-sequences Reference Manual, version 0.1.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 04:41:07 2022 GMT+0.
Next: Systems, Previous: The generic-sequences Reference Manual, Up: The generic-sequences Reference Manual [Contents][Index]
GENERIC-SEQUENCES -- Generic sequences for Common Lisp GENERIC-SEQUENCES-CONT -- Generic sequence comprehension for Common Lisp GENERIC-SEQUENCES-ITERATE -- Generic sequence iteration for Common Lisp GENERIC-SEQUENCES-STREAM -- Lazy streams for Common Lisp GENERIC-SEQUENCES-TEST -- Unit tests for the generic sequences Generic Sequences is a library for Common Lisp. It introduces the generic sequences, which are a hybrid between the ordinary lists, lazy streams and iterable sequences that can be found in other programming languages such as C#, F#, Java and Scala. Each sequence returns an enumerator or NIL. The NIL value means that the sequence is empty. The enumerator is a cons cell, which CAR part has the ordinary meaning for Common Lisp, i.e. it returns the current element, while the CDR-part is different. That part is already a function that returns either the next enumerator or NIL in case of reaching the end of the sequence. In other words, there is a delay before receiving the next element of the sequence, which actually makes many sequences lazy. Unlike the lazy streams, the enumerator always returns a new continuation of the sequence through the CDR part. It recalculates the next element anew, while the stream would memoize it. When iterating, this makes the enumerator more efficient computationally as the memoization would require some kind of locking in the multi-threaded environment. At the same time, unlike the C# enumerators, our enumerator is like a list cell, which allows defining the sequence in a more easy and declarative way as if we defined an ordinary list. Macros introduced below simplify this process. There exists even the sequence comprehension similar to the F# sequence expression syntax and the yield construction from C#. Unfortunately, the approach has a drawback. When iterating the sequence, it allocates a lot of small short-term objects on the heap. But the tests show that the modern List-machines have efficient garbage collectors and sometimes the consing is relatively fast, at least in comparison with calling the generic functions. Along with simplicity of defining the sequences, it was the second reason why I decided to apply the described representation to the enumerators. They are not just as slow as they might seem! Please read the Generic Sequences Manual in the doc directory for more information.
Next: Modules, Previous: Introduction, Up: The generic-sequences Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Next: Files, Previous: Systems, Up: The generic-sequences Reference Manual [Contents][Index]
Modules are listed depth-first from the system components tree.
generic-sequences (system).
Next: Packages, Previous: Modules, Up: The generic-sequences Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: generic-sequences/src/generic-seq-pkg.lisp, Previous: Lisp, Up: Lisp [Contents][Index]
generic-sequences (system).
Next: generic-sequences/src/generic-seq.lisp, Previous: generic-sequences/generic-sequences.asd, Up: Lisp [Contents][Index]
src (module).
Previous: generic-sequences/src/generic-seq-pkg.lisp, Up: Lisp [Contents][Index]
generic-seq-pkg.lisp (file).
src (module).
Next: generic-sequences/src/LICENSE, Previous: Static, Up: Static [Contents][Index]
generic-seq.lisp (file).
src (module).
Next: Definitions, Previous: Files, Up: The generic-sequences Reference Manual [Contents][Index]
Packages are listed by definition order.
gen-seq
common-lisp.
Next: Indexes, Previous: Packages, Up: The generic-sequences Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Next: Ordinary functions, Previous: Public Interface, Up: Public Interface [Contents][Index]
Delay the sequence.
Append the specified enumerators.
Return the CAR part.
Return the CDR part.
Construct a new enumerator.
Create a sequence by specifying its enumerator.
Next: Generic functions, Previous: Macros, Up: Public Interface [Contents][Index]
Convert the sequence to a list.
Convert the sequence to a vector.
Append the specified sequences.
Return the head of sequence.
Return the tail of sequence.
Compare two sequences where the test function for items must return <0, >0 or 0.
Construct a new sequence that begins with the specified item and ends with the sequence.
Count and return the number of elements in the sequence that satisfy the test.
Count and return the number of elements in the sequence that satisfy the test.
Count and return the number of elements in the sequence that satisfy the test.
It returns a lazy infinite sequence obtained by successively repeating the values in the supplied sequence.
Drop the first N elements of the sequence and return the rest.
SEQ-DROP-WHILE takes a predicate function taking a single argument
and a sequence. It returns a sequence of all items in the original sequence, starting
from the first item for which the predicate function returns NIL.
SEQ-DROP-WHILE-NOT takes a predicate function taking a single argument
and a sequence. It returns a sequence of all items in the original sequence, starting
from the first item for which the predicate function returns T.
Access the element of the sequence specified by index.
Test two sequences for equality.
Like the EVERY function but applied to generic sequences.
Search a sequence for an item and return this element; otherwise NIL is returned.
Search a sequence for an item for which the predicate returns T and return this element; otherwise NIL is returned.
Search a sequence for an item for which the predicate returns NIL and return this element; otherwise NIL is returned.
Apply the specified function to the sequences.
SEQ-INTERPOSE takes two arguments, a value and a sequence. It returns
a lazy sequence obtained by inserting the supplied value between the values
in the sequence.
It returns an infinite lazy sequence obtained by starting with the supplied value, and then by calling the supplied function passing the previous item in the sequence as its argument.
Return the length of the specified sequence.
Like the MAPCAR function but applied to generic sequences.
Like SEQ-MAP but the specified function must return a sequence.
Search a sequence for an item and return the tail of the sequence beginning with this element; otherwise NIL is returned.
Search a sequence for a top-level item for which the predicate returns T and
return the tail of the sequence beginning with this element; otherwise NIL is returned.
Search a sequence for a top-level item for which the predicate returns NIL and return the tail of the sequence beginning with this element; otherwise NIL is returned.
Like the NOTANY function but applied to generic sequences.
Like the NOTEVERY function but applied to generic sequences.
Test whether the sequence is empty.
Search a sequence for an element and return the index within the sequence; otherwise, NIL is returned.
Search a sequence for an element for which the predicate returns T and return the index within the sequence; otherwise, NIL is returned.
Search a sequence for an element for which the predicate returns NIL and return the index within the sequence; otherwise, NIL is returned.
SEQ-RANGE returns a lazy sequence of numbers from the start (inclusive, 0 by default) to the end (exclusive, nil by default) incremented by the step (1 by default).
Like REDUCE but applied to the generic sequences.
Like the REMOVE function but applied to the generic sequence.
Like the REMOVE-IF function but applied to the generic sequence.
Like the REMOVE-IF-NOT function but applied to the generic sequence.
It returns an infinite lazy sequence consisting of the argument value repeated endlessly.
Return an infinite lazy sequence obtained by calling the function repeatedly.
Like the SOME function but applied to generic sequences.
Split the sequence at the N-th element and return the both parts as a list.
SEQ-SPLIT-IF takes a predicate function taking a single argument
and a sequence. It splits the sequence at the first item for which the predicate
function returns T and and then SEQ-SPLIT-IF returns the both parts as a list.
SEQ-SPLIT-IF-NOT takes a predicate function taking a single argument
and a sequence. It splits the sequence at the first item for which the predicate
function returns NIL and then SEQ-SPLIT-IF-NOT returns the both parts as a list.
Take the first N elements of the sequence.
TAKE-NTH takes two arguments, a number and a sequence. It returns a sequence of items from the supplied sequence, taking the first item and every Nth item, where N is the supplied number.
SEQ-TAKE-WHILE takes a predicate function taking a single argument
and a sequence. It returns a sequence of all items in the original sequence, up until
the first item for which the predicate function returns NIL.
SEQ-TAKE-WHILE-NOT takes two arguments, a predicate function taking a single argument and a sequence. It returns a sequence of all items in the original sequence, up until the first item for which the predicate function returns T.
Return a sequence that returns lists of items from the provided sequences.
Next: Types, Previous: Ordinary functions, Up: Public Interface [Contents][Index]
Returns either NIL or an enumerator.
Test whether this is a sequence.
Previous: Generic functions, Up: Public Interface [Contents][Index]
The generic sequence type.
Previous: Public Interface, Up: Definitions [Contents][Index]
Next: Structures, Previous: Internals, Up: Internals [Contents][Index]
Append two enumerators.
Like REDUCE but applied to the enumerators.
Like EVERY but applied to one generic sequence.
Apply the specified function to the sequence.
Like the MAPCAR function but applied to a single generic sequence.
Like SEQ-MAP-1 but the specified function must return a sequence. In other words, this is a monadic bind function.
Like NOTANY but applied to one generic sequence.
Like NOTEVERY but applied to one generic sequence.
Like SOME but applied to one generic sequence.
Previous: Ordinary functions, Up: Internals [Contents][Index]
Represents the basic sequence that is defined only by its enumerator.
structure-object.
The delayed sequence.
structure-object.
Previous: Definitions, Up: The generic-sequences Reference Manual [Contents][Index]
Jump to: | (
B C D E F G M S |
---|
Jump to: | (
B C D E F G M S |
---|
Next: Data types, Previous: Functions, Up: Indexes [Contents][Index]
Jump to: | D S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
D | |||
delayed-enum : | Private structures | ||
delayed-seq : | Private structures | ||
| |||
S | |||
Slot, delayed-enum : | Private structures | ||
Slot, delayed-seq : | Private structures | ||
|
Jump to: | D S |
---|
Jump to: | B D F G L M P R S T |
---|
Jump to: | B D F G L M P R S T |
---|