The cl-slice Reference Manual

This is the cl-slice Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:23:41 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cl-slice

DSL for array slices in Common Lisp.

Author

Tamas K Papp <>

License

MIT

Version

0.1

Dependencies
  • alexandria (system).
  • anaphora (system).
  • let-plus (system).
Source

cl-slice.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-slice/cl-slice.asd

Source

cl-slice.asd.

Parent Component

cl-slice (system).

ASDF Systems

cl-slice.


3.1.2 cl-slice/cl-slice-dev.lisp

Source

cl-slice.asd.

Parent Component

cl-slice (system).

Packages

cl-slice-dev.

Public Interface
Internals

3.1.3 cl-slice/cl-slice.lisp

Dependency

cl-slice-dev.lisp (file).

Source

cl-slice.asd.

Parent Component

cl-slice (system).

Packages

cl-slice.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cl-slice

Source

cl-slice.lisp.

Use List
  • alexandria.
  • anaphora.
  • cl-slice-dev.
  • common-lisp.
  • let-plus.
Public Interface
Internals

4.2 cl-slice-dev

Source

cl-slice-dev.lisp.

Use List
  • alexandria.
  • anaphora.
  • common-lisp.
  • let-plus.
Used By List

cl-slice.

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: aslice (object &rest subscripts)

Anaphoric macro version of SLICE that binds the first argument to IT.

Package

cl-slice.

Source

cl-slice.lisp.

Macro: traverse-representations ((subscripts representations &key index setup) &body body)

A macro for traversing representations. Loops over all possible subscripts in REPRESENTAITONS, making them available in SUBSCRIPS during the execution of BODY. The iterator is constructed using the function SETUP (see for example ROW-MAJOR-SETUP). When INDEX is given, a variable with that name is provided, containing an index that counts iterations.

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.


5.1.2 Ordinary functions

Function: all-singleton-representations? (representations)

Test if all canonical representations are singletons.

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: canonical-range (start end)

Canonical representation of a contiguous set of array indices from START (inclusive) to END (exclusive).

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: canonical-representations (axes slices)

Return the canonical representations of SLICES given the corresponding AXES, checking for matching length.

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: canonical-sequence (sequence)

Canonical representation of array indexes from sequence. May share structure. Vectors of the upgraded type of (SIMPLE-ARRAY ARRAY-INDEX (*)) are preferred for efficiency, otherwise they are coerced.

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: canonical-singleton (index)

Canonical representation of a singleton index (a nonnegative integer, which is a valid array index).

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: head (count)

First COUNT indexes.

Package

cl-slice.

Source

cl-slice.lisp.

Function: including (start end)

Range, including both ends.

Package

cl-slice.

Source

cl-slice.lisp.

Function: nodrop (index)

Slice a single index, but don’t drop a dimension.

Package

cl-slice.

Source

cl-slice.lisp.

Function: representation-dimensions (representations)

Return a list for the dimensions of canonical representations, dropping singletons.

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: row-major-setup (representations terminator)

Return SUBSCRIPTS (a list) and ITERATOR (a closure, no arguments) that increments the contents of SUBSCRIPTS. TERMINATOR is called when all subscripts have been visited.

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: singleton-representation? (representation)

Test if a canonical REPRESENTATION is a singleton.

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: slice-reserved-symbol? (symbol)

Test if SYMBOL has special semantics for SLICE.

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: tail (count)

Last COUNT indexes.

Package

cl-slice.

Source

cl-slice.lisp.


5.1.3 Generic functions

Generic Function: axis-dimension (axis)

Return the dimension of axis. Needs to be defined for non-integer axes.

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Generic Function: canonical-representation (axis slice)

Canonical representation of SLICE, given information in AXIS. The default methods just use dimensions as AXIS.

Each slice needs to be resolved into a canonical representation, which is either a singleton, a range, or a sequence of subscripts. They should only be constructed with the corresponding CANONICAL-SINGLETION, CANONICAL-RANGE and CANONICAL-SEQUENCE functions.

CANONICAL-REPRESENTATION needs to ensure that the represented subscripts are valid for the axis.

Unless a specialized method is found, the dimension of the axis is queried with AXIS-DIMENSION and resolution is attempted using the latter. It recommended that methods that resolve symbols test them with SLICE-RESERVED-SYMBOL? and use CALL-NEXT-METHOD.

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Methods
Method: canonical-representation (axis (slice nodrop))
Source

cl-slice.lisp.

Method: canonical-representation (axis (slice including))
Source

cl-slice.lisp.

Method: canonical-representation (axis slice)
Method: canonical-representation (axis (canonical-range canonical-range))
Method: canonical-representation (axis (canonical-sequence canonical-sequence))
Method: canonical-representation ((axis integer) (slice null))
Method: canonical-representation ((axis integer) (slice integer))
Method: canonical-representation (axis (slice cons))
Method: canonical-representation (axis (slice vector))
Method: canonical-representation ((axis integer) (slice (eql t)))
Method: canonical-representation (axis (slice bit-vector))
Generic Function: mask (predicate sequence)

Map sequence into a simple-bit-vector, using 1 when PREDICATE yields true, 0 otherwise.

Package

cl-slice.

Source

cl-slice.lisp.

Methods
Method: mask (predicate (sequence sequence))
Generic Function: ref (object &rest subscripts)

Return the element of OBJECT specified by SUBSCRIPTS.

Package

cl-slice.

Source

cl-slice.lisp.

Methods
Method: ref ((array array) &rest subscripts)
Generic Function: (setf ref) (object &rest subscripts)
Package

cl-slice.

Source

cl-slice.lisp.

Methods
Method: (setf ref) ((array array) &rest subscripts)
Generic Function: slice (object &rest slices)

Return the slice of OBJECT specified by SLICES.

Package

cl-slice.

Source

cl-slice.lisp.

Methods
Method: slice ((list list) &rest slices)
Method: slice ((array array) &rest slices)
Generic Function: (setf slice) (object &rest slices)
Package

cl-slice.

Source

cl-slice.lisp.

Methods
Method: (setf slice) ((array array) &rest slices)
Method: (setf slice) ((array array) &rest slices)
Generic Function: which (predicate sequence)

Return an index of the positions in SEQUENCE which satisfy PREDICATE.

Package

cl-slice.

Source

cl-slice.lisp.

Methods
Method: which (predicate (sequence sequence))

5.1.4 Structures

Structure: canonical-range

Canonical representation of a contiguous set of array indices from START (inclusive) to END (exclusive).

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Direct superclasses

structure-object.

Direct methods

canonical-representation.

Direct slots
Slot: start
Type

alexandria:array-index

Readers

canonical-range-start.

Writers

(setf canonical-range-start).

Slot: end
Type

alexandria:array-index

Readers

canonical-range-end.

Writers

(setf canonical-range-end).

Structure: canonical-sequence

Canonical representation of a sequence of array indexes.

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Direct superclasses

structure-object.

Direct methods

canonical-representation.

Direct slots
Slot: vector
Package

common-lisp.

Type

(simple-array alexandria:array-index (*))

Readers

canonical-sequence-vector.

Writers

(setf canonical-sequence-vector).

Structure: including

Range, including both ends.

Package

cl-slice.

Source

cl-slice.lisp.

Direct superclasses

structure-object.

Direct methods

canonical-representation.

Direct slots
Slot: start
Readers

including-start.

Writers

(setf including-start).

Slot: end
Readers

including-end.

Writers

(setf including-end).

Structure: nodrop

Select a single index, but don’t drop a dimension.

Package

cl-slice.

Source

cl-slice.lisp.

Direct superclasses

structure-object.

Direct methods

canonical-representation.

Direct slots
Slot: index
Readers

nodrop-index.

Writers

(setf nodrop-index).


5.2 Internals


5.2.1 Ordinary functions

Reader: canonical-range-end (instance)
Writer: (setf canonical-range-end) (instance)
Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Target Slot

end.

Function: canonical-range-p (object)
Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Reader: canonical-range-start (instance)
Writer: (setf canonical-range-start) (instance)
Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Target Slot

start.

Function: canonical-sequence-p (object)
Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Reader: canonical-sequence-vector (instance)
Writer: (setf canonical-sequence-vector) (instance)
Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Target Slot

vector.

Function: copy-canonical-range (instance)
Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: copy-canonical-sequence (instance)
Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: copy-including (instance)
Package

cl-slice.

Source

cl-slice.lisp.

Function: copy-nodrop (instance)
Package

cl-slice.

Source

cl-slice.lisp.

Reader: including-end (instance)
Writer: (setf including-end) (instance)
Package

cl-slice.

Source

cl-slice.lisp.

Target Slot

end.

Function: including-p (object)
Package

cl-slice.

Source

cl-slice.lisp.

Reader: including-start (instance)
Writer: (setf including-start) (instance)
Package

cl-slice.

Source

cl-slice.lisp.

Target Slot

start.

Function: make-canonical-range (&key start end)
Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: make-canonical-sequence (&key vector)
Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: make-including (&key start end)
Package

cl-slice.

Source

cl-slice.lisp.

Function: make-nodrop (&key index)
Package

cl-slice.

Source

cl-slice.lisp.

Reader: nodrop-index (instance)
Writer: (setf nodrop-index) (instance)
Package

cl-slice.

Source

cl-slice.lisp.

Target Slot

index.

Function: nodrop-p (object)
Package

cl-slice.

Source

cl-slice.lisp.

Function: representation-dimension (representation)

Return the dimension of a canonical-representation, or NIL for singleton slices (they are dropped).

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: representation-initial-value (representation)

Initial value for iteration.

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.

Function: representation-iterator (representation carry cons)

Return a closure that sets the car of CONS to the next value each time it is called, resetting and calling CARRY when it reaches the end of its range.

Package

cl-slice-dev.

Source

cl-slice-dev.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   F   G   H   I   M   N   R   S   T   W  
Index Entry  Section

(
(setf canonical-range-end): Private ordinary functions
(setf canonical-range-start): Private ordinary functions
(setf canonical-sequence-vector): Private ordinary functions
(setf including-end): Private ordinary functions
(setf including-start): Private ordinary functions
(setf nodrop-index): Private ordinary functions
(setf ref): Public generic functions
(setf ref): Public generic functions
(setf slice): Public generic functions
(setf slice): Public generic functions
(setf slice): Public generic functions

A
all-singleton-representations?: Public ordinary functions
aslice: Public macros
axis-dimension: Public generic functions

C
canonical-range: Public ordinary functions
canonical-range-end: Private ordinary functions
canonical-range-p: Private ordinary functions
canonical-range-start: Private ordinary functions
canonical-representation: Public generic functions
canonical-representation: Public generic functions
canonical-representation: Public generic functions
canonical-representation: Public generic functions
canonical-representation: Public generic functions
canonical-representation: Public generic functions
canonical-representation: Public generic functions
canonical-representation: Public generic functions
canonical-representation: Public generic functions
canonical-representation: Public generic functions
canonical-representation: Public generic functions
canonical-representation: Public generic functions
canonical-representations: Public ordinary functions
canonical-sequence: Public ordinary functions
canonical-sequence-p: Private ordinary functions
canonical-sequence-vector: Private ordinary functions
canonical-singleton: Public ordinary functions
copy-canonical-range: Private ordinary functions
copy-canonical-sequence: Private ordinary functions
copy-including: Private ordinary functions
copy-nodrop: Private ordinary functions

F
Function, (setf canonical-range-end): Private ordinary functions
Function, (setf canonical-range-start): Private ordinary functions
Function, (setf canonical-sequence-vector): Private ordinary functions
Function, (setf including-end): Private ordinary functions
Function, (setf including-start): Private ordinary functions
Function, (setf nodrop-index): Private ordinary functions
Function, all-singleton-representations?: Public ordinary functions
Function, canonical-range: Public ordinary functions
Function, canonical-range-end: Private ordinary functions
Function, canonical-range-p: Private ordinary functions
Function, canonical-range-start: Private ordinary functions
Function, canonical-representations: Public ordinary functions
Function, canonical-sequence: Public ordinary functions
Function, canonical-sequence-p: Private ordinary functions
Function, canonical-sequence-vector: Private ordinary functions
Function, canonical-singleton: Public ordinary functions
Function, copy-canonical-range: Private ordinary functions
Function, copy-canonical-sequence: Private ordinary functions
Function, copy-including: Private ordinary functions
Function, copy-nodrop: Private ordinary functions
Function, head: Public ordinary functions
Function, including: Public ordinary functions
Function, including-end: Private ordinary functions
Function, including-p: Private ordinary functions
Function, including-start: Private ordinary functions
Function, make-canonical-range: Private ordinary functions
Function, make-canonical-sequence: Private ordinary functions
Function, make-including: Private ordinary functions
Function, make-nodrop: Private ordinary functions
Function, nodrop: Public ordinary functions
Function, nodrop-index: Private ordinary functions
Function, nodrop-p: Private ordinary functions
Function, representation-dimension: Private ordinary functions
Function, representation-dimensions: Public ordinary functions
Function, representation-initial-value: Private ordinary functions
Function, representation-iterator: Private ordinary functions
Function, row-major-setup: Public ordinary functions
Function, singleton-representation?: Public ordinary functions
Function, slice-reserved-symbol?: Public ordinary functions
Function, tail: Public ordinary functions

G
Generic Function, (setf ref): Public generic functions
Generic Function, (setf slice): Public generic functions
Generic Function, axis-dimension: Public generic functions
Generic Function, canonical-representation: Public generic functions
Generic Function, mask: Public generic functions
Generic Function, ref: Public generic functions
Generic Function, slice: Public generic functions
Generic Function, which: Public generic functions

H
head: Public ordinary functions

I
including: Public ordinary functions
including-end: Private ordinary functions
including-p: Private ordinary functions
including-start: Private ordinary functions

M
Macro, aslice: Public macros
Macro, traverse-representations: Public macros
make-canonical-range: Private ordinary functions
make-canonical-sequence: Private ordinary functions
make-including: Private ordinary functions
make-nodrop: Private ordinary functions
mask: Public generic functions
mask: Public generic functions
Method, (setf ref): Public generic functions
Method, (setf slice): Public generic functions
Method, (setf slice): Public generic functions
Method, canonical-representation: Public generic functions
Method, canonical-representation: Public generic functions
Method, canonical-representation: Public generic functions
Method, canonical-representation: Public generic functions
Method, canonical-representation: Public generic functions
Method, canonical-representation: Public generic functions
Method, canonical-representation: Public generic functions
Method, canonical-representation: Public generic functions
Method, canonical-representation: Public generic functions
Method, canonical-representation: Public generic functions
Method, canonical-representation: Public generic functions
Method, mask: Public generic functions
Method, ref: Public generic functions
Method, slice: Public generic functions
Method, slice: Public generic functions
Method, which: Public generic functions

N
nodrop: Public ordinary functions
nodrop-index: Private ordinary functions
nodrop-p: Private ordinary functions

R
ref: Public generic functions
ref: Public generic functions
representation-dimension: Private ordinary functions
representation-dimensions: Public ordinary functions
representation-initial-value: Private ordinary functions
representation-iterator: Private ordinary functions
row-major-setup: Public ordinary functions

S
singleton-representation?: Public ordinary functions
slice: Public generic functions
slice: Public generic functions
slice: Public generic functions
slice-reserved-symbol?: Public ordinary functions

T
tail: Public ordinary functions
traverse-representations: Public macros

W
which: Public generic functions
which: Public generic functions