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 1.4.1, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 04:37:01 2018 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:

SPLIT-SEQUENCE> (split-sequence #\Space "A stitch in time saves nine.")
⇒ ("A" "stitch" "in" "time" "saves" "nine.")
⇒ 28

SPLIT-SEQUENCE> (split-sequence #\, "foo,bar ,baz, foobar , barbaz,")
⇒ ("foo" "bar " "baz" " foobar " " barbaz" "")




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

public domain

Description

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

Version

1.4.1

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)


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

3.1.2 split-sequence/split-sequence.lisp

Parent

split-sequence (system)

Location

split-sequence.lisp

Packages

split-sequence

Exported Definitions
Internal Definitions

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

3.2 Other


Previous: , Up: Other 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

split-sequence.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. 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

split-sequence.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. 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

split-sequence.lisp (file)

Function: split-sequence-if-not PREDICATE SEQUENCE &key COUNT REMOVE-EMPTY-SUBSEQS FROM-END START END 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. 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

split-sequence.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Functions

Function: split-from-end ()
Package

split-sequence

Source

split-sequence.lisp (file)

Function: split-from-start ()
Package

split-sequence

Source

split-sequence.lisp (file)


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

5.2.2 Types

Type: array-index &optional LENGTH
Package

split-sequence

Source

split-sequence.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   O   S  
Index Entry  Section

F
File, Lisp, split-sequence.asd: The split-sequence<dot>asd file
File, Lisp, split-sequence/split-sequence.lisp: The split-sequence/split-sequence<dot>lisp file
File, other, split-sequence/version.sexp: The split-sequence/version<dot>sexp file

L
Lisp File, split-sequence.asd: The split-sequence<dot>asd file
Lisp File, split-sequence/split-sequence.lisp: The split-sequence/split-sequence<dot>lisp file

O
Other File, split-sequence/version.sexp: The split-sequence/version<dot>sexp file

S
split-sequence.asd: The split-sequence<dot>asd file
split-sequence/split-sequence.lisp: The split-sequence/split-sequence<dot>lisp file
split-sequence/version.sexp: The split-sequence/version<dot>sexp file

Jump to:   F   L   O   S  

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

A.2 Functions

Jump to:   F   S  
Index Entry  Section

F
Function, split-from-end: Internal functions
Function, split-from-start: Internal functions
Function, split-sequence: Exported functions
Function, split-sequence-if: Exported functions
Function, split-sequence-if-not: Exported functions

S
split-from-end: Internal functions
split-from-start: Internal functions
split-sequence: Exported functions
split-sequence-if: Exported functions
split-sequence-if-not: Exported functions

Jump to:   F   S  

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

A.3 Variables


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

A.4 Data types

Jump to:   A   P   S   T  
Index Entry  Section

A
array-index: Internal types

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

S
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

Jump to:   A   P   S   T