The utilities.print-tree Reference Manual

This is the utilities.print-tree Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 07:02:09 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 utilities.print-tree

This system provides simple facilities for printing tree structures.

Maintainer

Jan Moringen <>

Author

Jan Moringen <>

License

LLGPLv3

Version

0.1.0

Dependency

alexandria (system).

Source

utilities.print-tree.asd.

Child Components

3 Modules

Modules are listed depth-first from the system components tree.


3.1 utilities.print-tree/src

Source

utilities.print-tree.asd.

Parent Component

utilities.print-tree (system).

Child Components

3.2 utilities.print-tree/examples

Source

utilities.print-tree.asd.

Parent Component

utilities.print-tree (system).

Child Components

4 Files

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


4.1 Lisp


4.1.1 utilities.print-tree/utilities.print-tree.asd

Source

utilities.print-tree.asd.

Parent Component

utilities.print-tree (system).

ASDF Systems

utilities.print-tree.


4.1.2 utilities.print-tree/src/package.lisp

Source

utilities.print-tree.asd.

Parent Component

src (module).

Packages

utilities.print-tree.


4.1.3 utilities.print-tree/src/print-tree.lisp

Dependency

package.lisp (file).

Source

utilities.print-tree.asd.

Parent Component

src (module).

Public Interface
Internals

4.2 Static


4.2.1 utilities.print-tree/README.org

Source

utilities.print-tree.asd.

Parent Component

utilities.print-tree (system).


4.2.2 utilities.print-tree/examples/minimal.lisp

Source

utilities.print-tree.asd.

Parent Component

examples (module).


4.2.3 utilities.print-tree/examples/asdf.lisp

Source

utilities.print-tree.asd.

Parent Component

examples (module).


5 Packages

Packages are listed by definition order.


5.1 utilities.print-tree

This package provides functions for printing tree structures.

The main entry point is the ‘print-tree’ function. It accepts a stream, a tree object and a printer function.

In common cases, tree printer functions can be creating using ‘make-node-printer’ or ‘make-folding-node-printer’.

Source

package.lisp.

Use List
  • alexandria.
  • common-lisp.
Public Interface
Internals

6 Definitions

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


6.1 Public Interface


6.1.1 Special variables

Special Variable: *use-unicode?*
Package

utilities.print-tree.

Source

print-tree.lisp.


6.1.2 Ordinary functions

Function: make-folding-node-printer (first-line-printer rest-printer children predicate)

Like ‘make-node-printer’, return a node printer function that used FIRST-LINE-PRINTER, REST-PRINTER and CHILDREN.

PREDICATE is called to determine whether and to what extend nodes should be printed. When called with the depth of a node and node as its arguments, PREDICATE must return a list of "bits" of the node that should be printed. The following bits are recognized:

:first

Print first line of the node by calling FIRST-LINE-PRINTER?

:content

Print more details for the node by calling REST-PRINTER?

:children

Print children of the node?

:children-ellipsis

Print ellipsis of the form "…", if the node has children butlast the :children bit has not been specified?

When PREDICATE returns T, all bits are printed.

Package

utilities.print-tree.

Source

print-tree.lisp.

Function: make-node-printer (first-line-printer rest-printer children)

Return a node printer function that used FIRST-LINE-PRINTER, REST-PRINTER and CHILDREN.

FIRST-LINE-PRINTER is called with the destination stream, the depth of the node and the node and should print a one-line representation of the node to the stream. The function should return true if REST-PRINTER should be called to print more details for the node.

REST-PRINTER is also called with the destination stream, the depth of the node and node. It is not restricted to only producing a single line, however.

CHILDREN is called with a node and must return a (possibly empty) list of children of the node.

Package

utilities.print-tree.

Source

print-tree.lisp.

Function: print-node-contents (stream printer &optional final? depth)
Package

utilities.print-tree.

Source

print-tree.lisp.

Function: print-subtree (stream nodes printer &optional final? depth)
Package

utilities.print-tree.

Source

print-tree.lisp.

Function: print-tree (stream root printer)

Print the tree ROOT to STREAM using PRINTER.

PRINTER is called with four arguments, STREAM, ROOT, the keyword :root and the integer 0, indicating depth zero. PRINTER will usually call ‘print-node’, ‘print-subree’ and ‘print-node-contents’ to do the actual work.

Functions suitable for use as PRINTER can, for many common cases, be constructed via ‘make-node-printer’ and ‘make-folding-node-printer’.

Package

utilities.print-tree.

Source

print-tree.lisp.


6.2 Internals


6.2.1 Constants

Constant: +tree-child/final+
Package

utilities.print-tree.

Source

print-tree.lisp.

Constant: +tree-child/final/ascii+
Package

utilities.print-tree.

Source

print-tree.lisp.

Constant: +tree-child/inner+
Package

utilities.print-tree.

Source

print-tree.lisp.

Constant: +tree-child/inner/ascii+
Package

utilities.print-tree.

Source

print-tree.lisp.

Constant: +tree-prefix/final+
Package

utilities.print-tree.

Source

print-tree.lisp.

Constant: +tree-prefix/final/ascii+
Package

utilities.print-tree.

Source

print-tree.lisp.

Constant: +tree-prefix/inner+
Package

utilities.print-tree.

Source

print-tree.lisp.

Constant: +tree-prefix/inner/ascii+
Package

utilities.print-tree.

Source

print-tree.lisp.


6.2.2 Ordinary functions

Function: print-nodes (stream nodes printer depth)
Package

utilities.print-tree.

Source

print-tree.lisp.

Function: tree-child (kind)
Package

utilities.print-tree.

Source

print-tree.lisp.

Function: tree-child/ascii (kind)
Package

utilities.print-tree.

Source

print-tree.lisp.

Function: tree-child/unicode (kind)
Package

utilities.print-tree.

Source

print-tree.lisp.

Function: tree-prefix (kind)
Package

utilities.print-tree.

Source

print-tree.lisp.

Function: tree-prefix/ascii (kind)
Package

utilities.print-tree.

Source

print-tree.lisp.

Function: tree-prefix/unicode (kind)
Package

utilities.print-tree.

Source

print-tree.lisp.


Appendix A Indexes


A.1 Concepts


A.4 Data types