The split-sequence Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The split-sequence Reference Manual

This is the split-sequence Reference Manual, version 2.0.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Fri Jun 26 12:17:47 2020 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

SPLIT-SEQUENCE

SPLIT-SEQUENCE is a member of the Common Lisp Utilities family of programs, designed by community consensus.

Function SPLIT-SEQUENCE, SPLIT-SEQUENCE-IF, SPLIT-SEQUENCE-IF-NOT

Syntax:

split-sequence delimiter sequence &key count remove-empty-subseqs from-end start end test test-not key ⇒ list, index

split-sequence-if predicate sequence &key count remove-empty-subseqs from-end start end key ⇒ list, index

split-sequence-if-not predicate sequence &key count remove-empty-subseqs from-end start end key ⇒ list, index

Arguments and Values:

delimiter—an object.

predicate—a designator for a function of one argument that returns a generalized boolean.

sequence—a proper sequence.

count—an integer or nil. The default is nil.

remove-empty-subseqs—a generalized boolean. The default is false.

from-end—a generalized boolean. The default is false.

start, endbounding index designators of sequence. The defaults for start and end are 0 and nil, respectively.

test—a designator for a function of two arguments that returns a generalized boolean.

test-not—a designator for a function of two arguments that returns a generalized boolean.

key—a designator for a function of one argument, or nil.

list—a proper sequence.

index—an integer greater than or equal to zero, and less than or equal to the length of the sequence.

Description:

Splits sequence into a list of subsequences delimited by objects satisfying the test.

List is a list of sequences of the same kind as sequence that has elements consisting of subsequences of sequence that were delimited in the argument by elements satisfying the test. Index is an index into sequence indicating the unprocessed region, suitable as an argument to subseq to continue processing in the same manner if desired.

The count argument, if supplied, limits the number of subsequences in the first return value; if more than count delimited subsequences exist in sequence, the count leftmost delimited subsequences will be in order in the first return value, and the second return value will be the index into sequence at which processing stopped.

If from-end is non-null, sequence is conceptually processed from right to left, accumulating the subsequences in reverse order; from-end only makes a difference in the case of a non-null count argument. In the presence of from-end, the count rightmost delimited subsequences will be in the order that they are in sequence in the first return value, and the second is the index indicating the end of the unprocessed region.

The start and end keyword arguments permit a certain subsequence of the sequence to be processed without the need for a copying stage; their use is conceptually equivalent to partitioning the subsequence delimited by start and end, only without the need for copying.

If remove-empty-subseqs is null (the default), then empty subsequences will be included in the result.

In all cases, the subsequences in the first return value will be in the order that they appeared in sequence.

Examples:


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 split-sequence

Maintainer

Sharp Lispers <sharplispers@googlegroups.com>

Author

Arthur Lemmens <alemmens@xs4all.nl>

License

MIT

Description

Splits a sequence into a list of subsequences delimited by objects satisfying a test.

Version

2.0.0

Source

split-sequence.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Next: , Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 split-sequence.asd

Location

split-sequence.asd

Systems

split-sequence (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 split-sequence/package.lisp

Parent

split-sequence (system)

Location

package.lisp

Packages

split-sequence


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 split-sequence/vector.lisp

Parent

split-sequence (system)

Location

vector.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.4 split-sequence/list.lisp

Parent

split-sequence (system)

Location

list.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.5 split-sequence/extended-sequence.lisp

If Feature

(or sbcl abcl)

Parent

split-sequence (system)

Location

extended-sequence.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.6 split-sequence/api.lisp

Parent

split-sequence (system)

Location

api.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.7 split-sequence/documentation.lisp

Parent

split-sequence (system)

Location

documentation.lisp


Previous: , Up: Files   [Contents][Index]

3.2 Static


Previous: , Up: Static files   [Contents][Index]

3.2.1 split-sequence/version.sexp

Parent

split-sequence (system)

Location

version.sexp


Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 split-sequence

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: split-sequence DELIMITER SEQUENCE &key START END FROM-END COUNT REMOVE-EMPTY-SUBSEQS TEST TEST-NOT KEY

Return a list of subsequences in seq delimited by delimiter.
If :remove-empty-subseqs is NIL, empty subsequences will be included in the result; otherwise they will be discarded. All other keywords work analogously to those for CL:SUBSTITUTE. In particular, the behaviour of :from-end is possibly different from other versions of this function; :from-end values of NIL and T are equivalent unless :count is supplied. :count limits the number of subseqs in the main resulting list. The second return value is an index suitable as an argument to CL:SUBSEQ into the sequence indicating where processing stopped.

Package

split-sequence

Source

api.lisp (file)

Function: split-sequence-if PREDICATE SEQUENCE &key START END FROM-END COUNT REMOVE-EMPTY-SUBSEQS KEY

Return a list of subsequences in seq delimited by items satisfying predicate.
If :remove-empty-subseqs is NIL, empty subsequences will be included in the result; otherwise they will be discarded. All other keywords work analogously to those for CL:SUBSTITUTE-IF. In particular, the behaviour of :from-end is possibly different from other versions of this function; :from-end values of NIL and T are equivalent unless :count is supplied. :count limits the number of subseqs in the main resulting list. The second return value is an index suitable as an argument to CL:SUBSEQ into the sequence indicating where processing stopped.

Package

split-sequence

Source

api.lisp (file)

Function: split-sequence-if-not PREDICATE SEQUENCE &key START END FROM-END COUNT REMOVE-EMPTY-SUBSEQS KEY

Return a list of subsequences in seq delimited by items satisfying (CL:COMPLEMENT predicate).
If :remove-empty-subseqs is NIL, empty subsequences will be included in the result; otherwise they will be discarded. All other keywords work analogously to those for CL:SUBSTITUTE-IF-NOT. In particular, the behaviour of :from-end is possibly different from other versions of this function; :from-end values of NIL and T are equivalent unless :count is supplied. :count limits the number of subseqs in the main resulting list. The second return value is an index suitable as an argument to CL:SUBSEQ into the sequence indicating where processing stopped.

Package

split-sequence

Source

api.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Macros

Macro: check-tests TEST TEST-P TEST-NOT TEST-NOT-P
Package

split-sequence

Source

api.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: check-bounds SEQUENCE START END
Package

split-sequence

Source

api.lisp (file)

Function: collect-until PREDICATE LIST END

Collect elements from LIST until one that satisfies PREDICATE is found.

At most END elements will be examined. If END is null, all elements will be examined.

Returns four values:

* The collected items.
* The remaining items.
* The number of elements examined.
* Whether the search ended by running off the end, instead of by finding a delimiter.

Package

split-sequence

Source

list.lisp (file)

Function: count-while PREDICATE LIST END

Count the number of elements satisfying PREDICATE at the beginning of LIST.

At most END elements will be counted. If END is null, all elements will be examined.

Package

split-sequence

Source

list.lisp (file)

Function: list-long-enough-p LIST LENGTH
Package

split-sequence

Source

api.lisp (file)

Function: split-extended-sequence DELIMITER SEQUENCE START END FROM-END COUNT REMOVE-EMPTY-SUBSEQS TEST TEST-NOT KEY
Package

split-sequence

Source

extended-sequence.lisp (file)

Function: split-extended-sequence-from-end ()
Package

split-sequence

Source

extended-sequence.lisp (file)

Function: split-extended-sequence-from-start ()
Package

split-sequence

Source

extended-sequence.lisp (file)

Function: split-extended-sequence-if PREDICATE SEQUENCE START END FROM-END COUNT REMOVE-EMPTY-SUBSEQS KEY
Package

split-sequence

Source

extended-sequence.lisp (file)

Function: split-extended-sequence-if-not PREDICATE SEQUENCE START END FROM-END COUNT REMOVE-EMPTY-SUBSEQS KEY
Package

split-sequence

Source

extended-sequence.lisp (file)

Function: split-list DELIMITER LIST START END FROM-END COUNT REMOVE-EMPTY-SUBSEQS TEST TEST-NOT KEY
Package

split-sequence

Source

list.lisp (file)

Function: split-list-from-end PREDICATE LIST START END COUNT REMOVE-EMPTY-SUBSEQS
Package

split-sequence

Source

list.lisp (file)

Function: split-list-from-start PREDICATE LIST START END COUNT REMOVE-EMPTY-SUBSEQS
Package

split-sequence

Source

list.lisp (file)

Function: split-list-if PREDICATE LIST START END FROM-END COUNT REMOVE-EMPTY-SUBSEQS KEY
Package

split-sequence

Source

list.lisp (file)

Function: split-list-if-not PREDICATE LIST START END FROM-END COUNT REMOVE-EMPTY-SUBSEQS KEY
Package

split-sequence

Source

list.lisp (file)

Function: split-list-internal PREDICATE LIST START END COUNT REMOVE-EMPTY-SUBSEQS
Package

split-sequence

Source

list.lisp (file)

Function: split-vector DELIMITER VECTOR START END FROM-END COUNT REMOVE-EMPTY-SUBSEQS TEST TEST-NOT KEY
Package

split-sequence

Source

vector.lisp (file)

Function: split-vector-from-end ()
Package

split-sequence

Source

vector.lisp (file)

Function: split-vector-from-start ()
Package

split-sequence

Source

vector.lisp (file)

Function: split-vector-if PREDICATE VECTOR START END FROM-END COUNT REMOVE-EMPTY-SUBSEQS KEY
Package

split-sequence

Source

vector.lisp (file)

Function: split-vector-if-not PREDICATE VECTOR START END FROM-END COUNT REMOVE-EMPTY-SUBSEQS KEY
Package

split-sequence

Source

vector.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Conditions

Condition: simple-program-error ()
Package

split-sequence

Source

api.lisp (file)

Direct superclasses
  • simple-condition (condition)
  • program-error (condition)

Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Types

Type: array-index &optional LENGTH
Package

split-sequence

Source

vector.lisp (file)

Type: extended-sequence ()
Package

split-sequence

Source

extended-sequence.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   S  
Index Entry  Section

F
File, Lisp, split-sequence.asd: The split-sequence․asd file
File, Lisp, split-sequence/api.lisp: The split-sequence/api․lisp file
File, Lisp, split-sequence/documentation.lisp: The split-sequence/documentation․lisp file
File, Lisp, split-sequence/extended-sequence.lisp: The split-sequence/extended-sequence․lisp file
File, Lisp, split-sequence/list.lisp: The split-sequence/list․lisp file
File, Lisp, split-sequence/package.lisp: The split-sequence/package․lisp file
File, Lisp, split-sequence/vector.lisp: The split-sequence/vector․lisp file
File, static, split-sequence/version.sexp: The split-sequence/version․sexp file

L
Lisp File, split-sequence.asd: The split-sequence․asd file
Lisp File, split-sequence/api.lisp: The split-sequence/api․lisp file
Lisp File, split-sequence/documentation.lisp: The split-sequence/documentation․lisp file
Lisp File, split-sequence/extended-sequence.lisp: The split-sequence/extended-sequence․lisp file
Lisp File, split-sequence/list.lisp: The split-sequence/list․lisp file
Lisp File, split-sequence/package.lisp: The split-sequence/package․lisp file
Lisp File, split-sequence/vector.lisp: The split-sequence/vector․lisp file

S
split-sequence.asd: The split-sequence․asd file
split-sequence/api.lisp: The split-sequence/api․lisp file
split-sequence/documentation.lisp: The split-sequence/documentation․lisp file
split-sequence/extended-sequence.lisp: The split-sequence/extended-sequence․lisp file
split-sequence/list.lisp: The split-sequence/list․lisp file
split-sequence/package.lisp: The split-sequence/package․lisp file
split-sequence/vector.lisp: The split-sequence/vector․lisp file
split-sequence/version.sexp: The split-sequence/version․sexp file
Static File, split-sequence/version.sexp: The split-sequence/version․sexp file

Jump to:   F   L   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   F   L   M   S  
Index Entry  Section

C
check-bounds: Internal functions
check-tests: Internal macros
collect-until: Internal functions
count-while: Internal functions

F
Function, check-bounds: Internal functions
Function, collect-until: Internal functions
Function, count-while: Internal functions
Function, list-long-enough-p: Internal functions
Function, split-extended-sequence: Internal functions
Function, split-extended-sequence-from-end: Internal functions
Function, split-extended-sequence-from-start: Internal functions
Function, split-extended-sequence-if: Internal functions
Function, split-extended-sequence-if-not: Internal functions
Function, split-list: Internal functions
Function, split-list-from-end: Internal functions
Function, split-list-from-start: Internal functions
Function, split-list-if: Internal functions
Function, split-list-if-not: Internal functions
Function, split-list-internal: Internal functions
Function, split-sequence: Exported functions
Function, split-sequence-if: Exported functions
Function, split-sequence-if-not: Exported functions
Function, split-vector: Internal functions
Function, split-vector-from-end: Internal functions
Function, split-vector-from-start: Internal functions
Function, split-vector-if: Internal functions
Function, split-vector-if-not: Internal functions

L
list-long-enough-p: Internal functions

M
Macro, check-tests: Internal macros

S
split-extended-sequence: Internal functions
split-extended-sequence-from-end: Internal functions
split-extended-sequence-from-start: Internal functions
split-extended-sequence-if: Internal functions
split-extended-sequence-if-not: Internal functions
split-list: Internal functions
split-list-from-end: Internal functions
split-list-from-start: Internal functions
split-list-if: Internal functions
split-list-if-not: Internal functions
split-list-internal: Internal functions
split-sequence: Exported functions
split-sequence-if: Exported functions
split-sequence-if-not: Exported functions
split-vector: Internal functions
split-vector-from-end: Internal functions
split-vector-from-start: Internal functions
split-vector-if: Internal functions
split-vector-if-not: Internal functions

Jump to:   C   F   L   M   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables


Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   A   C   E   P   S   T  
Index Entry  Section

A
array-index: Internal types

C
Condition, simple-program-error: Internal conditions

E
extended-sequence: Internal types

P
Package, split-sequence: The split-sequence package

S
simple-program-error: Internal conditions
split-sequence: The split-sequence system
split-sequence: The split-sequence package
System, split-sequence: The split-sequence system

T
Type, array-index: Internal types
Type, extended-sequence: Internal types

Jump to:   A   C   E   P   S   T