The cl-simple-table Reference Manual

This is the cl-simple-table Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 15:42:58 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cl-simple-table

Simple in-memory tabular data structure and utility methods.

Author

Francisco Soto <>

License

BSD

Version

1.0.0

Source

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

Source

cl-simple-table.asd.

Parent Component

cl-simple-table (system).

ASDF Systems

cl-simple-table.

Packages

cl-simple-table-asd.


3.1.2 cl-simple-table/packages.lisp

Source

cl-simple-table.asd.

Parent Component

cl-simple-table (system).

Packages

cl-simple-table.


3.1.3 cl-simple-table/utils.lisp

Dependency

packages.lisp (file).

Source

cl-simple-table.asd.

Parent Component

cl-simple-table (system).

Internals

split-string (function).


3.1.4 cl-simple-table/table.lisp

Dependency

packages.lisp (file).

Source

cl-simple-table.asd.

Parent Component

cl-simple-table (system).

Public Interface
Internals

3.1.5 cl-simple-table/query.lisp

Dependencies
Source

cl-simple-table.asd.

Parent Component

cl-simple-table (system).

Public Interface

3.1.6 cl-simple-table/importers.lisp

Dependencies
Source

cl-simple-table.asd.

Parent Component

cl-simple-table (system).

Public Interface

4 Packages

Packages are listed by definition order.


4.1 cl-simple-table-asd

Source

cl-simple-table.asd.

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

4.2 cl-simple-table

Source

packages.lisp.

Nickname

simple-table

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: with-rows ((table row-var &optional return-expression) &body body)

Iterates the rows in the given table, row-var is the current row, returning return-expression.

Package

cl-simple-table.

Source

table.lisp.


5.1.2 Ordinary functions

Function: add-to-row (value row)

Append a column to row and set it to the given value.

Package

cl-simple-table.

Source

table.lisp.

Function: add-to-table (row table)

Appends a row to the table.

Package

cl-simple-table.

Source

table.lisp.

Function: distinct (table column)

Returns the unique elements from the given column in the given table as a new table.

Package

cl-simple-table.

Source

query.lisp.

Function: get-row (index table)

Returns the row in the given index inside the table.

Package

cl-simple-table.

Source

table.lisp.

Function: get-row-column (column row)

Gets the value in the given column inside row.

Package

cl-simple-table.

Source

table.lisp.

Function: make-row ()

Create a row.

Package

cl-simple-table.

Source

table.lisp.

Function: make-table ()

Creates a table.

Package

cl-simple-table.

Source

table.lisp.

Function: num-cols (row)

Returns the number of elements in this row.

Package

cl-simple-table.

Source

table.lisp.

Function: num-rows (table)

Returns the number of rows in the table.

Package

cl-simple-table.

Source

table.lisp.

Function: order-by (table col op)

Returns a new table sorted by the value in the given column and table using op.

Package

cl-simple-table.

Source

query.lisp.

Function: read-csv (filename &optional parse-elements)

Creates a table from a comma-separated values file.

Package

cl-simple-table.

Source

importers.lisp.

Function: read-tsv (filename &optional parse-elements)

Creates a table from a tab-separated values file.

Package

cl-simple-table.

Source

importers.lisp.

Function: rectangular-table-p (table)

Returns true if all the rows in the table have the same number of elements.

Package

cl-simple-table.

Source

table.lisp.

Function: row-sequence->table (rows)

Converts a sequence of rows into a table.

Package

cl-simple-table.

Source

table.lisp.

Function: select (table &rest columns)

Selects the given columns from the table and returns them as a new table.

Package

cl-simple-table.

Source

query.lisp.

Function: sequence->row (elements)

Converts a sequence of elements into a table row.

Package

cl-simple-table.

Source

table.lisp.

Function: set-row-column (column value row)

Sets the value of the given column inside the row.

Package

cl-simple-table.

Source

table.lisp.

Function: table-from-file (filename &key separator parse-elements)

Reads the tabular data file and returns the contents. Separator is TAB by default.
If parse-elements is other than NIL elements from the table will be READ into Lisp objects, otherwise only strings will be created.

Package

cl-simple-table.

Source

importers.lisp.

Function: top (table n)

Returns a new table with the top n rows from the given table.

Package

cl-simple-table.

Source

query.lisp.

Function: where (table filter)

Filters the result of the table using the given filter, returns a new table. Filters the result of the table using the given filter, returns a new table. Filter should be a predicate that takes a row and decides whether to include it in the result or not. Although the filter can be created by hand it is easier to use where-filter, where-and and where-or.

Package

cl-simple-table.

Source

query.lisp.

Function: where-and (&rest filters)

Given a list of filters created by where-filter this returns true if all of them are true.

Package

cl-simple-table.

Source

query.lisp.

Function: where-filter (op column value)

Returns a filter applicable for where, it calls op to compare the given value and the value stored in column for every row. Besides calling op the filter returned will also check the type of the values are the same before being compared.

Package

cl-simple-table.

Source

query.lisp.

Function: where-or (&rest filters)

Given a list of filters created by where-filter this returns true if any of them is true.

Package

cl-simple-table.

Source

query.lisp.


5.2 Internals


5.2.1 Ordinary functions

Function: split-string (separator str)

Splits a string using the given separator, returns a list with the substrings.

Package

cl-simple-table.

Source

utils.lisp.


5.2.2 Types

Type: row ()

Table row type.

Package

cl-simple-table.

Source

table.lisp.

Type: table ()

Table type.

Package

cl-simple-table.

Source

table.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   A   D   F   G   M   N   O   R   S   T   W  
Index Entry  Section

A
add-to-row: Public ordinary functions
add-to-table: Public ordinary functions

D
distinct: Public ordinary functions

F
Function, add-to-row: Public ordinary functions
Function, add-to-table: Public ordinary functions
Function, distinct: Public ordinary functions
Function, get-row: Public ordinary functions
Function, get-row-column: Public ordinary functions
Function, make-row: Public ordinary functions
Function, make-table: Public ordinary functions
Function, num-cols: Public ordinary functions
Function, num-rows: Public ordinary functions
Function, order-by: Public ordinary functions
Function, read-csv: Public ordinary functions
Function, read-tsv: Public ordinary functions
Function, rectangular-table-p: Public ordinary functions
Function, row-sequence->table: Public ordinary functions
Function, select: Public ordinary functions
Function, sequence->row: Public ordinary functions
Function, set-row-column: Public ordinary functions
Function, split-string: Private ordinary functions
Function, table-from-file: Public ordinary functions
Function, top: Public ordinary functions
Function, where: Public ordinary functions
Function, where-and: Public ordinary functions
Function, where-filter: Public ordinary functions
Function, where-or: Public ordinary functions

G
get-row: Public ordinary functions
get-row-column: Public ordinary functions

M
Macro, with-rows: Public macros
make-row: Public ordinary functions
make-table: Public ordinary functions

N
num-cols: Public ordinary functions
num-rows: Public ordinary functions

O
order-by: Public ordinary functions

R
read-csv: Public ordinary functions
read-tsv: Public ordinary functions
rectangular-table-p: Public ordinary functions
row-sequence->table: Public ordinary functions

S
select: Public ordinary functions
sequence->row: Public ordinary functions
set-row-column: Public ordinary functions
split-string: Private ordinary functions

T
table-from-file: Public ordinary functions
top: Public ordinary functions

W
where: Public ordinary functions
where-and: Public ordinary functions
where-filter: Public ordinary functions
where-or: Public ordinary functions
with-rows: Public macros


A.3 Variables