The utilities.print-items Reference Manual

This is the utilities.print-items Reference Manual, version 0.3.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 08:00:59 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 utilities.print-items

A protocol for flexible and composable printing.

Maintainer

Jan Moringen <>

Author

Jan Moringen <>

License

LGPLv3

Version

0.3.0

Dependency

alexandria (system).

Source

utilities.print-items.asd.

Child Components

3 Modules

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


3.1 utilities.print-items/code

Source

utilities.print-items.asd.

Parent Component

utilities.print-items (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-items/utilities.print-items.asd

Source

utilities.print-items.asd.

Parent Component

utilities.print-items (system).

ASDF Systems

utilities.print-items.


4.1.2 utilities.print-items/code/package.lisp

Source

utilities.print-items.asd.

Parent Component

code (module).

Packages

utilities.print-items.


4.1.3 utilities.print-items/code/util.lisp

Dependency

package.lisp (file).

Source

utilities.print-items.asd.

Parent Component

code (module).

Internals

4.1.4 utilities.print-items/code/protocol.lisp

Dependency

util.lisp (file).

Source

utilities.print-items.asd.

Parent Component

code (module).

Public Interface

4.2 Static


4.2.1 utilities.print-items/README.org

Source

utilities.print-items.asd.

Parent Component

utilities.print-items (system).


5 Packages

Packages are listed by definition order.


5.1 utilities.print-items

Utilities for composable printing.

The interface consists of

* ‘print-items’ [generic function]

Methods extend the printed representation of an object in a composable manner.

* ‘print-items-mixin’ [class]

Can be used to make subclasses the print items mechanism when passed to ‘print-object’.

* ‘format-items’ [function]

Utility function for formatting print items onto a stream.

Source

package.lisp.

Nickname

print-items

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 Ordinary functions

Function: format-item (stream item &optional colon? at?)
Package

utilities.print-items.

Source

protocol.lisp.

Function: format-items (stream items &optional colon? at?)

Print ITEMS onto STREAM.

ITEMS is a list of items of the form

(KEY-AND-OPTIONS FORMAT-CONTROL ARGUMENT*)

where

KEY-AND-OPTIONS ::= KEY
| (KEY OPTION*)
KEY ::= any Lisp object
OPTION ::= CONSTRAINT
CONSTRAINT ::= ((:before | :after) KEY)

FORMAT-CONTROL ::= ‘nil’
| a format control string or a formatter function ARGUMENT ::= any Lisp object

Package

utilities.print-items.

Source

protocol.lisp.

Function: format-print-items (stream items &optional colon? at?)

Alias for ‘format-items’.

Package

utilities.print-items.

Source

protocol.lisp.


6.1.2 Generic functions

Generic Function: effective-print-items (object)

Return a list of items like ‘print-items’, but filtered and sorted.

Filtering removes all but the first occurrence of multiple items using the same key.

Sorting arranges the filtered items according to their specified constraints.

Package

utilities.print-items.

Source

protocol.lisp.

Methods
Method: effective-print-items (object)
Generic Function: print-items (object)

Return a list of items that should appear in the printed
representation of OBJECT.

Each method should return a list of items of the form

ITEM ::= (KEY-AND-OPTIONS FORMAT-CONTROL ARGUMENT*)

KEY-AND-OPTIONS ::= KEY
| (KEY OPTION*)
KEY ::= any Lisp object
OPTION ::= CONSTRAINT
CONSTRAINT ::= ((:before | :after) KEY)

FORMAT-CONTROL ::= ‘nil’
| a format control string or a formatter function ARGUMENT ::= any Lisp object

When multiple items have ‘eql’ KEYs, items appearing closer to the beginning of the item list take precedence. This mechanism can be used by subclasses to replace print items produced by superclasses.

When FORMAT-CONTROL is ‘nil’ the whole item is ignored. This mechanism can be used by subclasses to disable print items
produced by superclasses.

Package

utilities.print-items.

Source

protocol.lisp.

Method Combination

append.

Options

:most-specific-first

Methods
Method: print-items append (object)

6.1.3 Standalone methods

Method: print-object ((object print-items-mixin) stream)
Source

protocol.lisp.


6.1.4 Classes

Class: print-items-mixin

This mixin class adds printing via ‘print-items’ to classes.

Package

utilities.print-items.

Source

protocol.lisp.

Direct methods

print-object.


6.2 Internals


6.2.1 Macros

Macro: destructure-item ((key &optional enabled? format-control values options) item &body body)
Package

utilities.print-items.

Source

util.lisp.


6.2.2 Ordinary functions

Function: item-< (left right)

Return non-nil if the left item should be placed before the right.

Package

utilities.print-items.

Source

util.lisp.

Function: make-node (object)
Package

utilities.print-items.

Source

util.lisp.

Function: maybe-convert-legacy-item (item)
Package

utilities.print-items.

Source

util.lisp.

Reader: node-edges (instance)
Writer: (setf node-edges) (instance)
Package

utilities.print-items.

Source

util.lisp.

Target Slot

edges.

Reader: node-object (instance)
Package

utilities.print-items.

Source

util.lisp.

Target Slot

object.

Reader: node-state (instance)
Writer: (setf node-state) (instance)
Package

utilities.print-items.

Source

util.lisp.

Target Slot

state.

Function: parse-item (item)
Package

utilities.print-items.

Source

util.lisp.

Function: sort-with-partial-order (sequence predicate)
Package

utilities.print-items.

Source

util.lisp.

Function: topological-sort (nodes)
Package

utilities.print-items.

Source

util.lisp.


6.2.3 Generic functions

Generic Reader: cycle-error-path (condition)
Package

utilities.print-items.

Methods
Reader Method: cycle-error-path ((condition cycle-error))
Source

util.lisp.

Target Slot

%path.


6.2.4 Conditions

Condition: cycle-error
Package

utilities.print-items.

Source

util.lisp.

Direct superclasses

error.

Direct methods

cycle-error-path.

Direct Default Initargs
InitargValue
:path(error missing required initarg for class ~s: ~s (quote cycle-error) path)
Direct slots
Slot: %path
Initargs

:path

Readers

cycle-error-path.

Writers

This slot is read-only.


6.2.5 Structures

Structure: node
Package

utilities.print-items.

Source

util.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: object
Readers

node-object.

Writers

This slot is read-only.

Slot: edges
Type

list

Initform

(quote nil)

Readers

node-edges.

Writers

(setf node-edges).

Slot: state
Type

(member :new :in-progress :done)

Initform

:new

Readers

node-state.

Writers

(setf node-state).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
C   D   E   F   G   I   M   N   P   S   T  
Index Entry  Section

(
(setf node-edges): Private ordinary functions
(setf node-state): Private ordinary functions

C
cycle-error-path: Private generic functions
cycle-error-path: Private generic functions

D
destructure-item: Private macros

E
effective-print-items: Public generic functions
effective-print-items: Public generic functions

F
format-item: Public ordinary functions
format-items: Public ordinary functions
format-print-items: Public ordinary functions
Function, (setf node-edges): Private ordinary functions
Function, (setf node-state): Private ordinary functions
Function, format-item: Public ordinary functions
Function, format-items: Public ordinary functions
Function, format-print-items: Public ordinary functions
Function, item-<: Private ordinary functions
Function, make-node: Private ordinary functions
Function, maybe-convert-legacy-item: Private ordinary functions
Function, node-edges: Private ordinary functions
Function, node-object: Private ordinary functions
Function, node-state: Private ordinary functions
Function, parse-item: Private ordinary functions
Function, sort-with-partial-order: Private ordinary functions
Function, topological-sort: Private ordinary functions

G
Generic Function, cycle-error-path: Private generic functions
Generic Function, effective-print-items: Public generic functions
Generic Function, print-items: Public generic functions

I
item-<: Private ordinary functions

M
Macro, destructure-item: Private macros
make-node: Private ordinary functions
maybe-convert-legacy-item: Private ordinary functions
Method, cycle-error-path: Private generic functions
Method, effective-print-items: Public generic functions
Method, print-items: Public generic functions
Method, print-object: Public standalone methods

N
node-edges: Private ordinary functions
node-object: Private ordinary functions
node-state: Private ordinary functions

P
parse-item: Private ordinary functions
print-items: Public generic functions
print-items: Public generic functions
print-object: Public standalone methods

S
sort-with-partial-order: Private ordinary functions

T
topological-sort: Private ordinary functions


A.4 Data types