The cl-ascii-table Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-ascii-table Reference Manual

This is the cl-ascii-table Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Wed Jun 15 03:30:52 2022 GMT+0.

Table of Contents


1 Introduction

cl-ascii-table


Common Lisp library to present tabular data in ascii-art table.

Installation

  1. Clone into a directory visible to quicklisp
git clone https://github.com/telephil/cl-ascii-table
  1. Load the library
(ql:quickload "cl-ascii-table")

API


function
make-table columns &key header => ascii-table

Create a new table


method
add-row (table ascii-table) columns

Add a row of values to table


method
add-separator (table ascii-table)

Add a separating line in the table


method
display-table (table ascii-table) &optional out

Display the table to out.

Sample


(let ((table (ascii-table:make-table '("Id" "Name" "Amount") :header "Infos")))
  (ascii-table:add-row table '(1 "Bob" 150))
  (ascii-table:add-row table '(2 "Joe" 200))
  (ascii-table:add-separator table)
  (ascii-table:add-row table '("" "Total" 350))
  (ascii-table:display table))

; => outputs
.---------------------.  
|        Infos        |
+----+-------+--------+  
| ID | Name  | Amount |  
+----+-------+--------+  
|  1 | Bob   |    150 |  
|  2 | Joe   |    200 |  
+----+-------+--------+  
|    | TOTAL |    350 |  
+----+-------+--------+ 

License

Copyright (C) 2014, Philippe MECHAI All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 cl-ascii-table

Common Lisp library to present tabular data in ascii-art table.

Author

Philippe MECHAI <philippe.mechai@gmail.com>

Home Page

https://github.com/telephil/cl-ascii-table/

Source Control

(GIT git@github.com:telephil/cl-ascii-table.git)

Bug Tracker

https://github.com/telephil/cl-ascii-table/issues

License

MIT

Source

cl-ascii-table.asd.

Child Components

3 Files

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


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.1 cl-ascii-table/cl-ascii-table.asd

Source

cl-ascii-table.asd.

Parent Component

cl-ascii-table (system).

ASDF Systems

cl-ascii-table.


3.1.2 cl-ascii-table/package.lisp

Source

cl-ascii-table.asd.

Parent Component

cl-ascii-table (system).

Packages

ascii-table.


3.1.3 cl-ascii-table/cl-ascii-table.lisp

Dependency

package.lisp (file).

Source

cl-ascii-table.asd.

Parent Component

cl-ascii-table (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 ascii-table

Source

package.lisp.

Nickname

table

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Special variables

Special Variable: *default-value-formatter*
Package

ascii-table.

Source

cl-ascii-table.lisp.


5.1.2 Ordinary functions

Function: make-table (columns &key header formatters)
Package

ascii-table.

Source

cl-ascii-table.lisp.


5.1.3 Generic functions

Generic Function: add-row (ascii-table columns)
Package

ascii-table.

Source

cl-ascii-table.lisp.

Methods
Method: add-row ((table ascii-table) columns)
Generic Function: add-separator (ascii-table)
Package

ascii-table.

Source

cl-ascii-table.lisp.

Methods
Method: add-separator ((table ascii-table))
Generic Function: display (ascii-table &optional out)
Package

ascii-table.

Source

cl-ascii-table.lisp.

Methods
Method: display ((table ascii-table) &optional out)

5.1.4 Standalone methods

Method: print-object ((obj ascii-table) out)
Source

cl-ascii-table.lisp.


5.2 Internals


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.1 Ordinary functions

Function: compute-col-width (col &optional len formatter)
Package

ascii-table.

Source

cl-ascii-table.lisp.

Function: display-col (value len out &optional formatter)
Package

ascii-table.

Source

cl-ascii-table.lisp.

Function: display-header (table out)
Package

ascii-table.

Source

cl-ascii-table.lisp.

Function: display-row (table row out)
Package

ascii-table.

Source

cl-ascii-table.lisp.

Function: display-separator (table out)
Package

ascii-table.

Source

cl-ascii-table.lisp.

Function: string-pad (text len)
Package

ascii-table.

Source

cl-ascii-table.lisp.

Function: string-pad-right (text len)
Package

ascii-table.

Source

cl-ascii-table.lisp.

Function: test ()
Package

ascii-table.

Source

cl-ascii-table.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.2 Generic functions

Generic Reader: cols (object)
Package

ascii-table.

Methods
Reader Method: cols ((ascii-table ascii-table))

automatically generated reader method

Source

cl-ascii-table.lisp.

Target Slot

cols.

Generic Writer: (setf cols) (object)
Package

ascii-table.

Methods
Writer Method: (setf cols) ((ascii-table ascii-table))

automatically generated writer method

Source

cl-ascii-table.lisp.

Target Slot

cols.

Generic Reader: cols-count (object)
Package

ascii-table.

Methods
Reader Method: cols-count ((ascii-table ascii-table))

automatically generated reader method

Source

cl-ascii-table.lisp.

Target Slot

cols-count.

Generic Writer: (setf cols-count) (object)
Package

ascii-table.

Methods
Writer Method: (setf cols-count) ((ascii-table ascii-table))

automatically generated writer method

Source

cl-ascii-table.lisp.

Target Slot

cols-count.

Generic Reader: cols-formatters (object)
Package

ascii-table.

Methods
Reader Method: cols-formatters ((ascii-table ascii-table))

automatically generated reader method

Source

cl-ascii-table.lisp.

Target Slot

cols-formatters.

Generic Writer: (setf cols-formatters) (object)
Package

ascii-table.

Methods
Writer Method: (setf cols-formatters) ((ascii-table ascii-table))

automatically generated writer method

Source

cl-ascii-table.lisp.

Target Slot

cols-formatters.

Generic Reader: cols-widths (object)
Package

ascii-table.

Methods
Reader Method: cols-widths ((ascii-table ascii-table))

automatically generated reader method

Source

cl-ascii-table.lisp.

Target Slot

cols-widths.

Generic Writer: (setf cols-widths) (object)
Package

ascii-table.

Methods
Writer Method: (setf cols-widths) ((ascii-table ascii-table))

automatically generated writer method

Source

cl-ascii-table.lisp.

Target Slot

cols-widths.

Generic Reader: header (object)
Package

ascii-table.

Methods
Reader Method: header ((ascii-table ascii-table))

automatically generated reader method

Source

cl-ascii-table.lisp.

Target Slot

header.

Generic Reader: rows (object)
Package

ascii-table.

Methods
Reader Method: rows ((ascii-table ascii-table))

automatically generated reader method

Source

cl-ascii-table.lisp.

Target Slot

rows.

Generic Writer: (setf rows) (object)
Package

ascii-table.

Methods
Writer Method: (setf rows) ((ascii-table ascii-table))

automatically generated writer method

Source

cl-ascii-table.lisp.

Target Slot

rows.


Previous: , Up: Internals   [Contents][Index]

5.2.3 Classes

Class: ascii-table
Package

ascii-table.

Source

cl-ascii-table.lisp.

Direct methods
Direct slots
Slot: header
Initargs

:header

Readers

header.

Writers

This slot is read-only.

Slot: cols
Initargs

:cols

Readers

cols.

Writers

(setf cols).

Slot: cols-count
Initform

0

Initargs

:cols-count

Readers

cols-count.

Writers

(setf cols-count).

Slot: cols-widths
Initargs

:cols-widths

Readers

cols-widths.

Writers

(setf cols-widths).

Slot: rows
Readers

rows.

Writers

(setf rows).

Slot: cols-formatters
Initargs

:cols-formatters

Readers

cols-formatters.

Writers

(setf cols-formatters).


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   C   D   F   G   H   M   P   R   S   T  
Index Entry  Section

(
(setf cols): Private generic functions
(setf cols): Private generic functions
(setf cols-count): Private generic functions
(setf cols-count): Private generic functions
(setf cols-formatters): Private generic functions
(setf cols-formatters): Private generic functions
(setf cols-widths): Private generic functions
(setf cols-widths): Private generic functions
(setf rows): Private generic functions
(setf rows): Private generic functions

A
add-row: Public generic functions
add-row: Public generic functions
add-separator: Public generic functions
add-separator: Public generic functions

C
cols: Private generic functions
cols: Private generic functions
cols-count: Private generic functions
cols-count: Private generic functions
cols-formatters: Private generic functions
cols-formatters: Private generic functions
cols-widths: Private generic functions
cols-widths: Private generic functions
compute-col-width: Private ordinary functions

D
display: Public generic functions
display: Public generic functions
display-col: Private ordinary functions
display-header: Private ordinary functions
display-row: Private ordinary functions
display-separator: Private ordinary functions

F
Function, compute-col-width: Private ordinary functions
Function, display-col: Private ordinary functions
Function, display-header: Private ordinary functions
Function, display-row: Private ordinary functions
Function, display-separator: Private ordinary functions
Function, make-table: Public ordinary functions
Function, string-pad: Private ordinary functions
Function, string-pad-right: Private ordinary functions
Function, test: Private ordinary functions

G
Generic Function, (setf cols): Private generic functions
Generic Function, (setf cols-count): Private generic functions
Generic Function, (setf cols-formatters): Private generic functions
Generic Function, (setf cols-widths): Private generic functions
Generic Function, (setf rows): Private generic functions
Generic Function, add-row: Public generic functions
Generic Function, add-separator: Public generic functions
Generic Function, cols: Private generic functions
Generic Function, cols-count: Private generic functions
Generic Function, cols-formatters: Private generic functions
Generic Function, cols-widths: Private generic functions
Generic Function, display: Public generic functions
Generic Function, header: Private generic functions
Generic Function, rows: Private generic functions

H
header: Private generic functions
header: Private generic functions

M
make-table: Public ordinary functions
Method, (setf cols): Private generic functions
Method, (setf cols-count): Private generic functions
Method, (setf cols-formatters): Private generic functions
Method, (setf cols-widths): Private generic functions
Method, (setf rows): Private generic functions
Method, add-row: Public generic functions
Method, add-separator: Public generic functions
Method, cols: Private generic functions
Method, cols-count: Private generic functions
Method, cols-formatters: Private generic functions
Method, cols-widths: Private generic functions
Method, display: Public generic functions
Method, header: Private generic functions
Method, print-object: Public standalone methods
Method, rows: Private generic functions

P
print-object: Public standalone methods

R
rows: Private generic functions
rows: Private generic functions

S
string-pad: Private ordinary functions
string-pad-right: Private ordinary functions

T
test: Private ordinary functions

Jump to:   (  
A   C   D   F   G   H   M   P   R   S   T