Common Lisp Package: GENERIC-SEQ

README:

FUNCTION

Public

SEQ->LIST (SEQ)

Convert the sequence to a list.

SEQ->VECTOR (SEQ)

Convert the sequence to a vector.

SEQ-APPEND (&REST SEQS)

Append the specified sequences.

SEQ-CAR (SEQ)

Return the head of sequence.

SEQ-CDR (SEQ)

Return the tail of sequence.

SEQ-COMPARE (SEQ-1 SEQ-2 TEST &KEY (KEY #'IDENTITY))

Compare two sequences where the test function for items must return <0, >0 or 0.

SEQ-CONS (ITEM SEQ)

Construct a new sequence that begins with the specified item and ends with the sequence.

SEQ-COUNT (ITEM SEQ &KEY (TEST #'EQL) (KEY #'IDENTITY))

Count and return the number of elements in the sequence that satisfy the test.

SEQ-COUNT-IF (PREDICATE SEQ &KEY (KEY #'IDENTITY))

Count and return the number of elements in the sequence that satisfy the test.

SEQ-COUNT-IF-NOT (PREDICATE SEQ &KEY (KEY #'IDENTITY))

Count and return the number of elements in the sequence that satisfy the test.

SEQ-CYCLE (SEQ)

It returns a lazy infinite sequence obtained by successively repeating the values in the supplied sequence.

SEQ-DROP (N SEQ)

Drop the first N elements of the sequence and return the rest.

SEQ-DROP-WHILE (PREDICATE SEQ &KEY (KEY #'IDENTITY))

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 (PREDICATE SEQ &KEY (KEY #'IDENTITY))

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.

SEQ-ELT (SEQ INDEX)

Access the element of the sequence specified by index.

SEQ-EQUAL (SEQ-1 SEQ-2 &KEY (TEST #'EQL) (KEY #'IDENTITY))

Test two sequences for equality.

SEQ-EVERY (PREDICATE &REST SEQS)

Like the EVERY function but applied to generic sequences.

SEQ-FIND (ITEM SEQ &KEY (TEST #'EQL) (KEY #'IDENTITY))

Search a sequence for an item and return this element; otherwise NIL is returned.

SEQ-FIND-IF (PREDICATE SEQ &KEY (KEY #'IDENTITY))

Search a sequence for an item for which the predicate returns T and return this element; otherwise NIL is returned.

SEQ-FIND-IF-NOT (PREDICATE SEQ &KEY (KEY #'IDENTITY))

Search a sequence for an item for which the predicate returns NIL and return this element; otherwise NIL is returned.

SEQ-FOREACH (FUNCTION &REST SEQS)

Apply the specified function to the sequences.

SEQ-INTERPOSE (VALUE SEQ)

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.

SEQ-ITERATE (FUNCTION INITIAL-VALUE)

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.

SEQ-LENGTH (SEQ)

Return the length of the specified sequence.

SEQ-MAP (FUNCTION &REST SEQS)

Like the MAPCAR function but applied to generic sequences.

SEQ-MAPPEND (FUNCTION &REST SEQS)

Like SEQ-MAP but the specified function must return a sequence.

SEQ-MEMBER (ITEM SEQ &KEY (TEST #'EQL) (KEY #'IDENTITY))

Search a sequence for an item and return the tail of the sequence beginning with this element; otherwise NIL is returned.

SEQ-MEMBER-IF (PREDICATE SEQ &KEY (KEY #'IDENTITY))

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.

SEQ-MEMBER-IF-NOT (PREDICATE SEQ &KEY (KEY #'IDENTITY))

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.

SEQ-NOTANY (PREDICATE &REST SEQS)

Like the NOTANY function but applied to generic sequences.

SEQ-NOTEVERY (PREDICATE &REST SEQS)

Like the NOTEVERY function but applied to generic sequences.

SEQ-NULL (SEQ)

Test whether the sequence is empty.

SEQ-POSITION (ITEM SEQ &KEY (TEST #'EQL) (KEY #'IDENTITY))

Search a sequence for an element and return the index within the sequence; otherwise, NIL is returned.

SEQ-POSITION-IF (PREDICATE SEQ &KEY (KEY #'IDENTITY))

Search a sequence for an element for which the predicate returns T and return the index within the sequence; otherwise, NIL is returned.

SEQ-POSITION-IF-NOT (PREDICATE SEQ &KEY (KEY #'IDENTITY))

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 (&KEY (START 0) (END NIL END-P) (STEP 1))

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).

SEQ-REDUCE (FUNCTION SEQ &KEY (KEY #'IDENTITY) (INITIAL-VALUE NIL INITIAL-VALUE-P))

Like REDUCE but applied to the generic sequences.

SEQ-REMOVE (ITEM SEQ &KEY (TEST #'EQL) (KEY #'IDENTITY))

Like the REMOVE function but applied to the generic sequence.

SEQ-REMOVE-IF (TEST SEQ &KEY (KEY #'IDENTITY))

Like the REMOVE-IF function but applied to the generic sequence.

SEQ-REMOVE-IF-NOT (TEST SEQ &KEY (KEY #'IDENTITY))

Like the REMOVE-IF-NOT function but applied to the generic sequence.

SEQ-REPEAT (VALUE)

It returns an infinite lazy sequence consisting of the argument value repeated endlessly.

SEQ-REPEATEDLY (FUNCTION)

Return an infinite lazy sequence obtained by calling the function repeatedly.

SEQ-SOME (PREDICATE &REST SEQS)

Like the SOME function but applied to generic sequences.

SEQ-SPLIT (N SEQ)

Split the sequence at the N-th element and return the both parts as a list.

SEQ-SPLIT-IF (PREDICATE SEQ &KEY (KEY #'IDENTITY))

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 (PREDICATE SEQ &KEY (KEY #'IDENTITY))

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.

SEQ-TAKE (N SEQ)

Take the first N elements of the sequence.

SEQ-TAKE-NTH (N SEQ)

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 (PREDICATE SEQ &KEY (KEY #'IDENTITY))

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 (PREDICATE SEQ &KEY (KEY #'IDENTITY))

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.

SEQ-ZIP (&REST SEQS)

Return a sequence that returns lists of items from the provided sequences.

Private

BASIC-SEQ-DELAYED-ENUM (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DELAYED-SEQ-DELAYED-SEQ (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

ENUM-APPEND-2 (ENUM-1 DELAYED-ENUM-2)

Append two enumerators.

ENUM-REDUCE (FUNCTION ENUM &KEY KEY INITIAL-VALUE)

Like REDUCE but applied to the enumerators.

SEQ-EVERY-1 (PREDICATE SEQ)

Like EVERY but applied to one generic sequence.

SEQ-FOREACH-1 (FUNCTION SEQ)

Apply the specified function to the sequence.

SEQ-MAP-1 (FUNCTION SEQ)

Like the MAPCAR function but applied to a single generic sequence.

SEQ-MAPPEND-1 (FUNCTION SEQ)

Like SEQ-MAP-1 but the specified function must return a sequence. In other words, this is a monadic bind function.

SEQ-NOTANY-1 (PREDICATE SEQ)

Like NOTANY but applied to one generic sequence.

SEQ-NOTEVERY-1 (PREDICATE SEQ)

Like NOTEVERY but applied to one generic sequence.

SEQ-SOME-1 (PREDICATE SEQ)

Like SOME but applied to one generic sequence.

Undocumented

SETFBASIC-SEQ-DELAYED-ENUM (NEW-VALUE INSTANCE)

BASIC-SEQ-P (OBJECT)

COPY-BASIC-SEQ (INSTANCE)

COPY-DELAYED-SEQ (INSTANCE)

SETFDELAYED-SEQ-DELAYED-SEQ (NEW-VALUE INSTANCE)

DELAYED-SEQ-P (OBJECT)

MAKE-BASIC-SEQ (&KEY ((DELAYED-ENUM DUM38) NIL))

MAKE-DELAYED-SEQ (&KEY ((DELAYED-SEQ DUM94) NIL))

MACRO

Public

DELAY-SEQ (SEQ)

Delay the sequence.

ENUM-APPEND (&REST ENUMS)

Append the specified enumerators.

ENUM-CAR (ENUM)

Return the CAR part.

ENUM-CDR (ENUM)

Return the CDR part.

ENUM-CONS (ITEM ENUM)

Construct a new enumerator.

MAKE-SEQ (&BODY ENUM)

Create a sequence by specifying its enumerator.

GENERIC-FUNCTION

Public

SEQ-ENUM (SEQ)

Returns either NIL or an enumerator.

SEQP (SEQ)

Test whether this is a sequence.

CLASS

Private

BASIC-SEQ

Represents the basic sequence that is defined only by its enumerator.

DELAYED-SEQ

The delayed sequence.