The cl-utilities Reference Manual

This is the cl-utilities Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 04:34:13 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cl-utilities

Author

Maintained by Peter Scott

Source

cl-utilities.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 cl-utilities/cl-utilities.asd

Source

cl-utilities.asd.

Parent Component

cl-utilities (system).

ASDF Systems

cl-utilities.

Packages

cl-utilities-system.


3.1.2 cl-utilities/package.lisp

Source

cl-utilities.asd.

Parent Component

cl-utilities (system).

Packages

cl-utilities.


3.1.3 cl-utilities/split-sequence.lisp

Dependency

package.lisp (file).

Source

cl-utilities.asd.

Parent Component

cl-utilities (system).

Public Interface

3.1.4 cl-utilities/extremum.lisp

Dependencies
Source

cl-utilities.asd.

Parent Component

cl-utilities (system).

Public Interface
Internals

3.1.5 cl-utilities/read-delimited.lisp

Dependency

package.lisp (file).

Source

cl-utilities.asd.

Parent Component

cl-utilities (system).

Public Interface
Internals

3.1.6 cl-utilities/expt-mod.lisp

Dependency

package.lisp (file).

Source

cl-utilities.asd.

Parent Component

cl-utilities (system).

Public Interface

3.1.7 cl-utilities/with-unique-names.lisp

Dependency

package.lisp (file).

Source

cl-utilities.asd.

Parent Component

cl-utilities (system).

Public Interface
Internals

%with-unique-names-binding-parts (function).


3.1.8 cl-utilities/collecting.lisp

Dependencies
Source

cl-utilities.asd.

Parent Component

cl-utilities (system).

Public Interface
Internals

3.1.9 cl-utilities/once-only.lisp

Dependency

package.lisp (file).

Source

cl-utilities.asd.

Parent Component

cl-utilities (system).

Public Interface

once-only (macro).

Internals

%check-once-only-names (function).


3.1.10 cl-utilities/rotate-byte.lisp

Dependency

package.lisp (file).

Source

cl-utilities.asd.

Parent Component

cl-utilities (system).

Public Interface

rotate-byte (function).


3.1.11 cl-utilities/copy-array.lisp

Dependency

package.lisp (file).

Source

cl-utilities.asd.

Parent Component

cl-utilities (system).

Public Interface

copy-array (function).

Internals

%make-array-with-same-properties (function).


3.1.12 cl-utilities/compose.lisp

Dependency

package.lisp (file).

Source

cl-utilities.asd.

Parent Component

cl-utilities (system).

Public Interface

4 Packages

Packages are listed by definition order.


4.1 cl-utilities-system

Source

cl-utilities.asd.

Use List
  • asdf/interface.
  • common-lisp.

4.2 cl-utilities

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Macros

Macro: collecting (&body body)

Collect things into a list forwards. Within the body of this macro, the COLLECT function will collect its argument into the list returned by COLLECTING.

Package

cl-utilities.

Source

collecting.lisp.

Macro: once-only (names &body body)
Package

cl-utilities.

Source

once-only.lisp.

Macro: with-collectors ((&rest collectors) &body body)

Collect some things into lists forwards. The names in COLLECTORS are defined as local functions which each collect into a separate list. Returns as many values as there are collectors, in the order they were given.

Package

cl-utilities.

Source

collecting.lisp.

Macro: with-gensyms ((&rest bindings) &body body)

Synonym for WITH-UNIQUE-NAMES, but BINDINGS should only consist of atoms; lists are not supported. If you try to give list bindings, a LIST-BINDING-NOT-SUPPORTED warning will be signalled, but it will work the same way as WITH-UNIQUE-NAMES. Don’t do it, though.

Package

cl-utilities.

Source

with-unique-names.lisp.

Macro: with-unique-names ((&rest bindings) &body body)

Executes a series of forms with each var bound to a fresh, uninterned symbol. See http://www.cliki.net/WITH-UNIQUE-NAMES

Package

cl-utilities.

Source

with-unique-names.lisp.


5.1.2 Compiler macros

Compiler Macro: compose (&rest functions)
Package

cl-utilities.

Source

compose.lisp.

Compiler Macro: expt-mod (n exponent modulus)
Package

cl-utilities.

Source

expt-mod.lisp.

Compiler Macro: extremum (sequence predicate &key key start end)
Package

cl-utilities.

Source

extremum.lisp.

Compiler Macro: partition (&rest args)
Package

cl-utilities.

Source

split-sequence.lisp.

Compiler Macro: partition-if (&rest args)
Package

cl-utilities.

Source

split-sequence.lisp.

Compiler Macro: partition-if-not (&rest args)
Package

cl-utilities.

Source

split-sequence.lisp.


5.1.3 Ordinary functions

Function: collect (thing)

Collect THING in the context established by the COLLECTING macro

Package

cl-utilities.

Source

collecting.lisp.

Function: compose (&rest functions)

Compose FUNCTIONS right-associatively, returning a function

Package

cl-utilities.

Source

compose.lisp.

Function: copy-array (array &key undisplace)

Shallow copies the contents of any array into another array with equivalent properties. If array is displaced, then this function will normally create another displaced array with similar properties, unless UNDISPLACE is non-NIL, in which case the contents of the array will be copied into a completely new, not displaced, array.

Package

cl-utilities.

Source

copy-array.lisp.

Function: expt-mod (n exponent modulus)

As (mod (expt n exponent) modulus), but more efficient.

Package

cl-utilities.

Source

expt-mod.lisp.

Function: extrema (sequence predicate &key key start end)
Package

cl-utilities.

Source

extremum.lisp.

Function: extremum (sequence predicate &key key start end)

Returns the element of SEQUENCE that would appear first if the sequence were ordered according to SORT using PREDICATE and KEY using an unstable sorting algorithm. See http://www.cliki.net/EXTREMUM for the full specification.

Package

cl-utilities.

Source

extremum.lisp.

Function: extremum-fastkey (sequence predicate &key key start end)

EXTREMUM implemented so that it calls KEY less. This is only faster if the KEY function is so slow that calling it less often would be a significant improvement; ordinarily it’s slower.

Package

cl-utilities.

Source

extremum.lisp.

Function: n-most-extreme (n sequence predicate &key key start end)

Returns a list of the N elements of SEQUENCE that would appear first if the sequence were ordered according to SORT using PREDICATE and KEY with a stable sorting algorithm. If there are less than N elements in the relevant part of the sequence, this will return all the elements it can and signal the warning N-MOST-EXTREME-NOT-ENOUGH-ELEMENTS

Package

cl-utilities.

Source

extremum.lisp.

Function: partition (&rest args)
Package

cl-utilities.

Source

split-sequence.lisp.

Function: partition-if (&rest args)
Package

cl-utilities.

Source

split-sequence.lisp.

Function: partition-if-not (&rest args)
Package

cl-utilities.

Source

split-sequence.lisp.

Function: read-delimited (sequence stream &key start end delimiter test key)
Package

cl-utilities.

Source

read-delimited.lisp.

Function: rotate-byte (count bytespec integer)

Rotates a field of bits within INTEGER; specifically, returns an integer that contains the bits of INTEGER rotated COUNT times leftwards within the byte specified by BYTESPEC, and elsewhere contains the bits of INTEGER. See http://www.cliki.net/ROTATE-BYTE

Package

cl-utilities.

Source

rotate-byte.lisp.

Function: split-sequence (delimiter seq &key count remove-empty-subseqs from-end start end 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

cl-utilities.

Source

split-sequence.lisp.

Function: split-sequence-if (predicate seq &key count remove-empty-subseqs from-end start end 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

cl-utilities.

Source

split-sequence.lisp.

Function: split-sequence-if-not (predicate seq &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

cl-utilities.

Source

split-sequence.lisp.


5.1.4 Generic functions

Generic Reader: list-binding-not-supported-binding (condition)
Package

cl-utilities.

Methods
Reader Method: list-binding-not-supported-binding ((condition list-binding-not-supported))
Source

with-unique-names.lisp.

Target Slot

binding.

Generic Reader: n-most-extreme-not-enough-elements-n (condition)
Package

cl-utilities.

Methods
Reader Method: n-most-extreme-not-enough-elements-n ((condition n-most-extreme-not-enough-elements))
Source

extremum.lisp.

Target Slot

n.

Generic Reader: n-most-extreme-not-enough-elements-subsequence (condition)
Package

cl-utilities.

Methods
Reader Method: n-most-extreme-not-enough-elements-subsequence ((condition n-most-extreme-not-enough-elements))
Source

extremum.lisp.

Target Slot

subsequence.

Generic Reader: read-delimited-bounds-error-end (condition)
Package

cl-utilities.

Methods
Reader Method: read-delimited-bounds-error-end ((condition read-delimited-bounds-error))
Source

read-delimited.lisp.

Target Slot

end.

Generic Reader: read-delimited-bounds-error-sequence (condition)
Package

cl-utilities.

Methods
Reader Method: read-delimited-bounds-error-sequence ((condition read-delimited-bounds-error))
Source

read-delimited.lisp.

Target Slot

sequence.

Generic Reader: read-delimited-bounds-error-start (condition)
Package

cl-utilities.

Methods
Reader Method: read-delimited-bounds-error-start ((condition read-delimited-bounds-error))
Source

read-delimited.lisp.

Target Slot

start.


5.1.5 Conditions

Condition: list-binding-not-supported

List bindings aren’t supported by WITH-GENSYMS, and
if you want to use them you should use WITH-UNIQUE-NAMES instead. That said, they will work; they’ll just signal this warning to complain about it.

Package

cl-utilities.

Source

with-unique-names.lisp.

Direct superclasses

warning.

Direct methods

list-binding-not-supported-binding.

Direct slots
Slot: binding
Initargs

:binding

Readers

list-binding-not-supported-binding.

Writers

This slot is read-only.

Condition: n-most-extreme-not-enough-elements

There are not enough elements in the sequence given to N-MOST-EXTREME to return the N most extreme elements.

Package

cl-utilities.

Source

extremum.lisp.

Direct superclasses

warning.

Direct methods
Direct slots
Slot: n

The number of elements that need to be returned

Initargs

:n

Readers

n-most-extreme-not-enough-elements-n.

Writers

This slot is read-only.

Slot: subsequence

The subsequence from which elements
must be taken. This is determined by the sequence and the :start and :end arguments to N-MOST-EXTREME.

Initargs

:subsequence

Readers

n-most-extreme-not-enough-elements-subsequence.

Writers

This slot is read-only.

Condition: no-extremum

Raised when EXTREMUM is called on an empty sequence, since there is no morally smallest element

Package

cl-utilities.

Source

extremum.lisp.

Direct superclasses

error.

Condition: read-delimited-bounds-error

There’s a problem with the indices START and END
for SEQUENCE. See CLHS SUBSEQ-OUT-OF-BOUNDS:IS-AN-ERROR issue.

Package

cl-utilities.

Source

read-delimited.lisp.

Direct superclasses

error.

Direct methods
Direct slots
Slot: start
Initargs

:start

Readers

read-delimited-bounds-error-start.

Writers

This slot is read-only.

Slot: end
Initargs

:end

Readers

read-delimited-bounds-error-end.

Writers

This slot is read-only.

Slot: sequence
Package

common-lisp.

Initargs

:sequence

Readers

read-delimited-bounds-error-sequence.

Writers

This slot is read-only.


5.2 Internals


5.2.1 Macros

Macro: with-check-length ((sequence start end) &body body)
Package

cl-utilities.

Source

extremum.lisp.


5.2.2 Compiler macros

Compiler Macro: comparator (test &optional key)
Package

cl-utilities.

Source

extremum.lisp.


5.2.3 Ordinary functions

Function: %check-once-only-names (names)

Check that all of the NAMES are symbols. If not, raise an error.

Package

cl-utilities.

Source

once-only.lisp.

Function: %make-array-with-same-properties (array undisplace)

Make an array with the same properties (size, adjustability, etc.) as another array, optionally undisplacing the array.

Package

cl-utilities.

Source

copy-array.lisp.

Function: %read-delimited-bounds-check (sequence start end)

Check to make sure START and END are in bounds when calling READ-DELIMITED with SEQUENCE

Package

cl-utilities.

Source

read-delimited.lisp.

Function: %read-delimited-bounds-check-end (sequence start end)

Check to make sure END is in bounds when calling READ-DELIMITED with SEQUENCE

Package

cl-utilities.

Source

read-delimited.lisp.

Function: %read-delimited-bounds-check-order (sequence start end)

Check the order of START and END bounds, and return them in the correct order.

Package

cl-utilities.

Source

read-delimited.lisp.

Function: %read-delimited-bounds-check-start (sequence start end)

Check to make sure START is in bounds when calling READ-DELIMITED with SEQUENCE

Package

cl-utilities.

Source

read-delimited.lisp.

Function: %with-collectors-check-collectors (collectors)

Check that all of the COLLECTORS are symbols. If not, raise an error.

Package

cl-utilities.

Source

collecting.lisp.

Function: %with-collectors-gensyms-alist (collectors)

Return an alist mapping the symbols in COLLECTORS to gensyms

Package

cl-utilities.

Source

collecting.lisp.

Function: %with-unique-names-binding-parts (binding)

Return (values var prefix) from a WITH-UNIQUE-NAMES binding form. If PREFIX is not given in the binding, NIL is returned to indicate that the default should be used.

Package

cl-utilities.

Source

with-unique-names.lisp.

Function: comparator (test &optional key)

Comparison operator: auxilliary function used by EXTREMUM

Package

cl-utilities.

Source

extremum.lisp.

Function: zero-length-p (sequence)

Is the length of SEQUENCE equal to zero?

Package

cl-utilities.

Source

extremum.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %  
C   E   F   G   L   M   N   O   P   R   S   W   Z  
Index Entry  Section

%
%check-once-only-names: Private ordinary functions
%make-array-with-same-properties: Private ordinary functions
%read-delimited-bounds-check: Private ordinary functions
%read-delimited-bounds-check-end: Private ordinary functions
%read-delimited-bounds-check-order: Private ordinary functions
%read-delimited-bounds-check-start: Private ordinary functions
%with-collectors-check-collectors: Private ordinary functions
%with-collectors-gensyms-alist: Private ordinary functions
%with-unique-names-binding-parts: Private ordinary functions

C
collect: Public ordinary functions
collecting: Public macros
comparator: Private compiler macros
comparator: Private ordinary functions
Compiler Macro, comparator: Private compiler macros
Compiler Macro, compose: Public compiler macros
Compiler Macro, expt-mod: Public compiler macros
Compiler Macro, extremum: Public compiler macros
Compiler Macro, partition: Public compiler macros
Compiler Macro, partition-if: Public compiler macros
Compiler Macro, partition-if-not: Public compiler macros
compose: Public compiler macros
compose: Public ordinary functions
copy-array: Public ordinary functions

E
expt-mod: Public compiler macros
expt-mod: Public ordinary functions
extrema: Public ordinary functions
extremum: Public compiler macros
extremum: Public ordinary functions
extremum-fastkey: Public ordinary functions

F
Function, %check-once-only-names: Private ordinary functions
Function, %make-array-with-same-properties: Private ordinary functions
Function, %read-delimited-bounds-check: Private ordinary functions
Function, %read-delimited-bounds-check-end: Private ordinary functions
Function, %read-delimited-bounds-check-order: Private ordinary functions
Function, %read-delimited-bounds-check-start: Private ordinary functions
Function, %with-collectors-check-collectors: Private ordinary functions
Function, %with-collectors-gensyms-alist: Private ordinary functions
Function, %with-unique-names-binding-parts: Private ordinary functions
Function, collect: Public ordinary functions
Function, comparator: Private ordinary functions
Function, compose: Public ordinary functions
Function, copy-array: Public ordinary functions
Function, expt-mod: Public ordinary functions
Function, extrema: Public ordinary functions
Function, extremum: Public ordinary functions
Function, extremum-fastkey: Public ordinary functions
Function, n-most-extreme: Public ordinary functions
Function, partition: Public ordinary functions
Function, partition-if: Public ordinary functions
Function, partition-if-not: Public ordinary functions
Function, read-delimited: Public ordinary functions
Function, rotate-byte: Public ordinary functions
Function, split-sequence: Public ordinary functions
Function, split-sequence-if: Public ordinary functions
Function, split-sequence-if-not: Public ordinary functions
Function, zero-length-p: Private ordinary functions

G
Generic Function, list-binding-not-supported-binding: Public generic functions
Generic Function, n-most-extreme-not-enough-elements-n: Public generic functions
Generic Function, n-most-extreme-not-enough-elements-subsequence: Public generic functions
Generic Function, read-delimited-bounds-error-end: Public generic functions
Generic Function, read-delimited-bounds-error-sequence: Public generic functions
Generic Function, read-delimited-bounds-error-start: Public generic functions

L
list-binding-not-supported-binding: Public generic functions
list-binding-not-supported-binding: Public generic functions

M
Macro, collecting: Public macros
Macro, once-only: Public macros
Macro, with-check-length: Private macros
Macro, with-collectors: Public macros
Macro, with-gensyms: Public macros
Macro, with-unique-names: Public macros
Method, list-binding-not-supported-binding: Public generic functions
Method, n-most-extreme-not-enough-elements-n: Public generic functions
Method, n-most-extreme-not-enough-elements-subsequence: Public generic functions
Method, read-delimited-bounds-error-end: Public generic functions
Method, read-delimited-bounds-error-sequence: Public generic functions
Method, read-delimited-bounds-error-start: Public generic functions

N
n-most-extreme: Public ordinary functions
n-most-extreme-not-enough-elements-n: Public generic functions
n-most-extreme-not-enough-elements-n: Public generic functions
n-most-extreme-not-enough-elements-subsequence: Public generic functions
n-most-extreme-not-enough-elements-subsequence: Public generic functions

O
once-only: Public macros

P
partition: Public compiler macros
partition: Public ordinary functions
partition-if: Public compiler macros
partition-if: Public ordinary functions
partition-if-not: Public compiler macros
partition-if-not: Public ordinary functions

R
read-delimited: Public ordinary functions
read-delimited-bounds-error-end: Public generic functions
read-delimited-bounds-error-end: Public generic functions
read-delimited-bounds-error-sequence: Public generic functions
read-delimited-bounds-error-sequence: Public generic functions
read-delimited-bounds-error-start: Public generic functions
read-delimited-bounds-error-start: Public generic functions
rotate-byte: Public ordinary functions

S
split-sequence: Public ordinary functions
split-sequence-if: Public ordinary functions
split-sequence-if-not: Public ordinary functions

W
with-check-length: Private macros
with-collectors: Public macros
with-gensyms: Public macros
with-unique-names: Public macros

Z
zero-length-p: Private ordinary functions


A.4 Data types

Jump to:   C   E   F   L   N   O   P   R   S   W  
Index Entry  Section

C
cl-utilities: The cl-utilities system
cl-utilities: The cl-utilities package
cl-utilities-system: The cl-utilities-system package
cl-utilities.asd: The cl-utilities/cl-utilities․asd file
collecting.lisp: The cl-utilities/collecting․lisp file
compose.lisp: The cl-utilities/compose․lisp file
Condition, list-binding-not-supported: Public conditions
Condition, n-most-extreme-not-enough-elements: Public conditions
Condition, no-extremum: Public conditions
Condition, read-delimited-bounds-error: Public conditions
copy-array.lisp: The cl-utilities/copy-array․lisp file

E
expt-mod.lisp: The cl-utilities/expt-mod․lisp file
extremum.lisp: The cl-utilities/extremum․lisp file

F
File, cl-utilities.asd: The cl-utilities/cl-utilities․asd file
File, collecting.lisp: The cl-utilities/collecting․lisp file
File, compose.lisp: The cl-utilities/compose․lisp file
File, copy-array.lisp: The cl-utilities/copy-array․lisp file
File, expt-mod.lisp: The cl-utilities/expt-mod․lisp file
File, extremum.lisp: The cl-utilities/extremum․lisp file
File, once-only.lisp: The cl-utilities/once-only․lisp file
File, package.lisp: The cl-utilities/package․lisp file
File, read-delimited.lisp: The cl-utilities/read-delimited․lisp file
File, rotate-byte.lisp: The cl-utilities/rotate-byte․lisp file
File, split-sequence.lisp: The cl-utilities/split-sequence․lisp file
File, with-unique-names.lisp: The cl-utilities/with-unique-names․lisp file

L
list-binding-not-supported: Public conditions

N
n-most-extreme-not-enough-elements: Public conditions
no-extremum: Public conditions

O
once-only.lisp: The cl-utilities/once-only․lisp file

P
Package, cl-utilities: The cl-utilities package
Package, cl-utilities-system: The cl-utilities-system package
package.lisp: The cl-utilities/package․lisp file

R
read-delimited-bounds-error: Public conditions
read-delimited.lisp: The cl-utilities/read-delimited․lisp file
rotate-byte.lisp: The cl-utilities/rotate-byte․lisp file

S
split-sequence.lisp: The cl-utilities/split-sequence․lisp file
System, cl-utilities: The cl-utilities system

W
with-unique-names.lisp: The cl-utilities/with-unique-names․lisp file