DSL for array and data-frame slices

Upstream URL


Steve Nunez <>, Steven Nunez



Contributors Forks Stargazers Issues MS-PL License LinkedIn



Selecting subsets of data from arrays, vectors and data-frames
Explore the docs »

Report Bug · Request Feature · Reference Manual

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Resources
  6. Contributing
  7. License
  8. Contact

About the Project

This library provides:

  1. An API for taking slices (elements selected by the Cartesian product of vectors of subscripts for each axis) of array-like objects. The most important function is select. Unless you want to define additional methods for select, this is pretty much all you need from this library. See the documentation for a tutorial.
  2. An extensible DSL for selecting a subset of valid subscripts. This is useful if, for example, you want to resolve column names in a data frame in your implementation of select.
  3. A set of utility functions for traversing selections in array-like objects.

Built With

Getting Started

To get a local copy up and running follow these steps:


An ANSI Common Lisp implementation. Developed and tested with SBCL and CCL.


  1. Clone the repository
    cd ~/quicklisp/local-projects &&
    git clone
  2. Reset the ASDF source-registry to find the new system (from the REPL)
  3. Load the system
    (ql:quickload :select)


The API documentation is in the docs/ directory and is available in emacs info format, PDF and HTML. You can also view the documentation online.


The most frequently used form is:

(select object selection1 selection2 ...)

where each selection specifies a set of subscripts along the corresponding axis. The selection specifications are found in the documentation.

For more examples, please refer to the Reference Manual


See the open issues for a list of proposed features (and known issues).

Known Issues

Select is known to pass all tests on SBCL and ACL (Allegro Common Lisp), and fails two tests on CCL related to vector/array representations. The specifics are described in issue #3. I suspect this to be a bug somewhere in CCL. Version 1.12 of CCL doesn't run on MS Windows, so the obvious next step is not available (install 1.12 and try). It could also be specific to MS Windows. If someone successfully gets this to run on another platform, I'd appreciate hearing about it.

Changes from cl-slice

Documentation Improvements

  • Move to HTML based documentation system
  • Reference docs now on
  • Documented selection iteration
  • Improved examples and explanations

Test Improvements

  • Ported to FiveAM and refactored
  • Improved test coverage
  • Added failure messages to aid debugging
  • Added tests for selection iteration


  • Renamed 'cons' to 'range'
  • Range now handles (range x x) => nil
  • Selections work identically on sequences; previously differed between lists and vectors
  • Vector selections may be specified using a list; previously could only be a vector. See also issue #2
  • Sequence selections now honor fill-pointer (fixes first issue on Papp's issue 3)

Bug Fixes

  • Range now handles END = (length SEQUENCE)
  • Selecting from a list no longer drops dimension


This system is part of the Lisp-Stat project; that should be your first stop for information. Also see the resources and community pages for more information.


Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated. Please see for details on our code of conduct, and the process for submitting pull requests.


Distributed under the MS-PL License. See LICENSE for more information.


Project Link:

Dependencies (4)

  • alexandria
  • anaphora
  • fiveam
  • let-plus
  • GitHub
  • Quicklisp