cl-slice

API Reference

cl-slice

DSL for array slices in Common Lisp.

CL-SLICE-DEV

  • Function CANONICAL-SINGLETON (index)
    Canonical representation of a singleton index (a nonnegative integer, which is a valid array index).
  • Struct CANONICAL-RANGE
    Canonical representation of a contiguous set of array indices from START (inclusive) to END (exclusive).
    START
    END
  • Function CANONICAL-RANGE (start end)
    Canonical representation of a contiguous set of array indices from START (inclusive) to END (exclusive).
  • Struct CANONICAL-SEQUENCE
    Canonical representation of a sequence of array indexes.
    VECTOR
  • 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.
  • Generic-Function AXIS-DIMENSION (axis)
    Return the dimension of axis. Needs to be defined for non-integer axes.
  • Function SLICE-RESERVED-SYMBOL? (symbol)
    Test if SYMBOL has special semantics for SLICE.
  • 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.
  • Method CANONICAL-REPRESENTATION (axis (slice bit-vector))
  • Method CANONICAL-REPRESENTATION (axis (slice bit-vector))
  • Method CANONICAL-REPRESENTATION (axis (slice bit-vector))
  • Method CANONICAL-REPRESENTATION ((axis integer) (slice (eql t)))
  • Method CANONICAL-REPRESENTATION ((axis integer) (slice (eql t)))
  • Method CANONICAL-REPRESENTATION ((axis integer) (slice (eql t)))
  • Method CANONICAL-REPRESENTATION (axis (slice vector))
  • Method CANONICAL-REPRESENTATION (axis (slice vector))
  • Method CANONICAL-REPRESENTATION (axis (slice vector))
  • Method CANONICAL-REPRESENTATION (axis (slice cons))
  • Method CANONICAL-REPRESENTATION (axis (slice cons))
  • Method CANONICAL-REPRESENTATION (axis (slice cons))
  • Method CANONICAL-REPRESENTATION ((axis integer) (slice integer))
  • Method CANONICAL-REPRESENTATION ((axis integer) (slice integer))
  • Method CANONICAL-REPRESENTATION ((axis integer) (slice integer))
  • Method CANONICAL-REPRESENTATION ((axis integer) (slice null))
  • Method CANONICAL-REPRESENTATION ((axis integer) (slice null))
  • Method CANONICAL-REPRESENTATION ((axis integer) (slice null))
  • Method CANONICAL-REPRESENTATION (axis slice)
  • Method CANONICAL-REPRESENTATION (axis slice)
  • Method CANONICAL-REPRESENTATION (axis slice)
  • Function CANONICAL-REPRESENTATIONS (axes slices)
    Return the canonical representations of SLICES given the corresponding AXES, checking for matching length.
  • Function SINGLETON-REPRESENTATION? (representation)
    Test if a canonical REPRESENTATION is a singleton.
  • Function ALL-SINGLETON-REPRESENTATIONS? (representations)
    Test if all canonical representations are singletons.
  • Function REPRESENTATION-DIMENSIONS (representations)
    Return a list for the dimensions of canonical representations, dropping singletons.
  • 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.
  • Macro TRAVERSE-REPRESENTATIONS ((subscripts representations &key index (setup 'row-major-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.
  • Method CANONICAL-REPRESENTATION (axis (slice including))
  • Method CANONICAL-REPRESENTATION (axis (slice nodrop))

CL-SLICE

  • Generic-Function REF (object &rest subscripts)
    Return the element of OBJECT specified by SUBSCRIPTS.
  • Generic-Function (setf REF) (value object &rest subscripts)
  • Generic-Function SLICE (object &rest slices)
    Return the slice of OBJECT specified by SLICES.
  • Generic-Function (setf SLICE) (value object &rest slices)
  • Macro ASLICE (object &rest subscripts)
    Anaphoric macro version of SLICE that binds the first argument to IT.
  • Struct INCLUDING
    Range, including both ends.
    START
    END
  • Function INCLUDING (start end)
    Range, including both ends.
  • Struct NODROP
    Select a single index, but don't drop a dimension.
    INDEX
  • Function NODROP (index)
    Slice a single index, but don't drop a dimension.
  • Function HEAD (count)
    First COUNT indexes.
  • Function TAIL (count)
    Last COUNT indexes.
  • Method SLICE ((array array) &rest slices)
  • Method (setf SLICE) ((value array) (array array) &rest slices)
  • Method (setf SLICE) (value (array array) &rest slices)
  • Method REF ((array array) &rest subscripts)
  • Method (setf REF) (value (array array) &rest subscripts)
  • Method SLICE ((list list) &rest slices)
  • Generic-Function MASK (predicate sequence)
    Map sequence into a simple-bit-vector, using 1 when PREDICATE yields true, 0 otherwise.
  • Method MASK (predicate (sequence sequence))
  • Method MASK (predicate (sequence sequence))
  • Method MASK (predicate (sequence sequence))
  • Generic-Function WHICH (predicate sequence)
    Return an index of the positions in SEQUENCE which satisfy PREDICATE.
  • Method WHICH (predicate (sequence sequence))
  • Method WHICH (predicate (sequence sequence))
  • Method WHICH (predicate (sequence sequence))