The monkeylib-text-output Reference Manual

This is the monkeylib-text-output Reference Manual, version 1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 17:22:56 2024 GMT+0.

Table of Contents


1 Systems

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


1.1 monkeylib-text-output

Formatted text output.

Author

Peter Seibel <>

License

BSD

Version

1.0

Dependencies
  • com.gigamonkeys.macro-utilities (system).
  • com.gigamonkeys.test-framework (system).
  • com.gigamonkeys.pathnames (system).
  • com.gigamonkeys.utilities (system).
Source

monkeylib-text-output.asd.

Child Components

2 Files

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


2.1 Lisp


2.1.1 monkeylib-text-output/monkeylib-text-output.asd

Source

monkeylib-text-output.asd.

Parent Component

monkeylib-text-output (system).

ASDF Systems

monkeylib-text-output.


2.1.2 monkeylib-text-output/packages.lisp

Source

monkeylib-text-output.asd.

Parent Component

monkeylib-text-output (system).

Packages

monkeylib-text-output.


2.1.3 monkeylib-text-output/text-output.lisp

Dependency

packages.lisp (file).

Source

monkeylib-text-output.asd.

Parent Component

monkeylib-text-output (system).

Public Interface
Internals

3 Packages

Packages are listed by definition order.


3.1 monkeylib-text-output

Source

packages.lisp.

Use List

common-lisp.

Public Interface
Internals

4 Definitions

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


4.1 Public Interface


4.1.1 Special variables

Special Variable: *pretty*

Controls whether output is generated with indentation and tracking of newlines for emitting freshlines.

Package

monkeylib-text-output.

Source

text-output.lisp.

Special Variable: *text-output*

The stream to which output is sent. Can be bound to any character output stream.

Package

monkeylib-text-output.

Source

text-output.lisp.

Special Variable: *text-pretty-printer*

The current instance of text-pretty-printer wrapped around *text-output* when *pretty* is true.

Package

monkeylib-text-output.

Source

text-output.lisp.


4.1.2 Macros

Macro: with-text-output ((stream &key pretty) &body body)
Package

monkeylib-text-output.

Source

text-output.lisp.


4.1.3 Ordinary functions

Function: codegen-text (ops pretty)

Given a vector of ops, return a Common Lisp translation, i.e. Common Lisp code that will emit the same output as the text-pretty-printer would if it was given the same ops.

Package

monkeylib-text-output.

Source

text-output.lisp.

Function: get-pretty-printer ()
Package

monkeylib-text-output.

Source

text-output.lisp.


4.1.4 Generic functions

Generic Function: embed-code (processor code)

Run arbitrary Lisp code which will presumably emit some output.

Package

monkeylib-text-output.

Source

text-output.lisp.

Methods
Method: embed-code ((compiler text-compiler) code)
Method: embed-code ((pp text-pretty-printer) code)
Generic Function: embed-value (processor value)

Emit a literal value.

Package

monkeylib-text-output.

Source

text-output.lisp.

Methods
Method: embed-value ((compiler text-compiler) value)
Method: embed-value ((pp text-pretty-printer) value)
Generic Function: freshline (processor)

Emit a newline unless the last character emitted was a newline.

Package

monkeylib-text-output.

Source

text-output.lisp.

Methods
Method: freshline ((compiler text-compiler))
Method: freshline ((pp text-pretty-printer))
Generic Function: indent (processor)

Increase the indentation level by some fixed amount.

Package

monkeylib-text-output.

Source

text-output.lisp.

Methods
Method: indent ((compiler text-compiler))
Method: indent ((pp text-pretty-printer))
Generic Function: newline (processor)

Unconditionally emit a newline.

Package

monkeylib-text-output.

Source

text-output.lisp.

Methods
Method: newline ((compiler text-compiler))
Method: newline ((pp text-pretty-printer))
Generic Reader: ops (object)
Package

monkeylib-text-output.

Methods
Reader Method: ops ((text-compiler text-compiler))

automatically generated reader method

Source

text-output.lisp.

Target Slot

ops.

Generic Writer: (setf ops) (object)
Package

monkeylib-text-output.

Methods
Writer Method: (setf ops) ((text-compiler text-compiler))

automatically generated writer method

Source

text-output.lisp.

Target Slot

ops.

Generic Function: raw-string (processor string &optional check-for-newlines)

Emit a string with no escaping. When
CHECK-FOR-NEWLINES is true, string should still be scanned for newlines in order to deal with indentation. In general CHECK-FOR-NEWLINES should be true unless the string is known not to contain newlines.

Package

monkeylib-text-output.

Source

text-output.lisp.

Methods
Method: raw-string ((compiler text-compiler) string &optional newlines-p)
Method: raw-string ((pp text-pretty-printer) string &optional newlines-p)
Generic Function: toggle-indenting (processor)

Temporarily turn of indentation without changing the current indentation value.

Package

monkeylib-text-output.

Source

text-output.lisp.

Methods
Method: toggle-indenting ((compiler text-compiler))
Method: toggle-indenting ((pp text-pretty-printer))
Generic Function: unindent (processor)

Decrease the indentation level by some fixed amount.

Package

monkeylib-text-output.

Source

text-output.lisp.

Methods
Method: unindent ((compiler text-compiler))
Method: unindent ((pp text-pretty-printer))

4.1.5 Classes

Class: text-compiler
Package

monkeylib-text-output.

Source

text-output.lisp.

Direct methods
Direct slots
Slot: ops
Initform

(monkeylib-text-output::make-op-buffer)

Readers

ops.

Writers

(setf ops).


4.2 Internals


4.2.1 Special variables

Special Variable: *default-tab-width*
Package

monkeylib-text-output.

Source

text-output.lisp.


4.2.2 Ordinary functions

Function: compile-buffer (buf ops)

Compile a string possibly containing newlines into a sequence of :raw-string and :newline ops.

Package

monkeylib-text-output.

Source

text-output.lisp.

Function: emit (ip string)
Package

monkeylib-text-output.

Source

text-output.lisp.

Function: emit-freshline (ip)
Package

monkeylib-text-output.

Source

text-output.lisp.

Function: emit-newline (ip)
Package

monkeylib-text-output.

Source

text-output.lisp.

Function: emit/no-newlines (ip string &key start end)
Package

monkeylib-text-output.

Source

text-output.lisp.

Function: generate-code (ops)
Package

monkeylib-text-output.

Source

text-output.lisp.

Function: indent-if-necessary (ip)
Package

monkeylib-text-output.

Source

text-output.lisp.

Function: make-op-buffer ()
Package

monkeylib-text-output.

Source

text-output.lisp.

Function: new-pretty-printer ()
Package

monkeylib-text-output.

Source

text-output.lisp.

Function: optimize-static-output (ops)
Package

monkeylib-text-output.

Source

text-output.lisp.

Function: push-op (op ops-buffer)
Package

monkeylib-text-output.

Source

text-output.lisp.


4.2.3 Generic functions

Generic Reader: beginning-of-line-p (object)
Package

monkeylib-text-output.

Methods
Reader Method: beginning-of-line-p ((indenting-printer indenting-printer))

automatically generated reader method

Source

text-output.lisp.

Target Slot

beginning-of-line-p.

Generic Writer: (setf beginning-of-line-p) (object)
Package

monkeylib-text-output.

Methods
Writer Method: (setf beginning-of-line-p) ((indenting-printer indenting-printer))

automatically generated writer method

Source

text-output.lisp.

Target Slot

beginning-of-line-p.

Generic Reader: indentation (object)
Package

monkeylib-text-output.

Methods
Reader Method: indentation ((indenting-printer indenting-printer))

automatically generated reader method

Source

text-output.lisp.

Target Slot

indentation.

Generic Writer: (setf indentation) (object)
Package

monkeylib-text-output.

Methods
Writer Method: (setf indentation) ((indenting-printer indenting-printer))

automatically generated writer method

Source

text-output.lisp.

Target Slot

indentation.

Generic Reader: indenting-p (object)
Package

monkeylib-text-output.

Methods
Reader Method: indenting-p ((indenting-printer indenting-printer))

automatically generated reader method

Source

text-output.lisp.

Target Slot

indenting-p.

Generic Writer: (setf indenting-p) (object)
Package

monkeylib-text-output.

Methods
Writer Method: (setf indenting-p) ((indenting-printer indenting-printer))

automatically generated writer method

Source

text-output.lisp.

Target Slot

indenting-p.

Generic Function: op->code (op &rest operands)
Package

monkeylib-text-output.

Source

text-output.lisp.

Methods
Method: op->code ((op (eql :embed-code)) &rest operands)
Method: op->code ((op (eql :embed-value)) &rest operands)
Method: op->code ((op (eql :toggle-indenting)) &rest operands)
Method: op->code ((op (eql :unindent)) &rest operands)
Method: op->code ((op (eql :indent)) &rest operands)
Method: op->code ((op (eql :freshline)) &rest operands)
Method: op->code ((op (eql :newline)) &rest operands)
Method: op->code ((op (eql :raw-string)) &rest operands)
Generic Reader: out (object)
Package

monkeylib-text-output.

Methods
Reader Method: out ((indenting-printer indenting-printer))

automatically generated reader method

Source

text-output.lisp.

Target Slot

out.

Generic Writer: (setf out) (object)
Package

monkeylib-text-output.

Methods
Writer Method: (setf out) ((indenting-printer indenting-printer))

automatically generated writer method

Source

text-output.lisp.

Target Slot

out.

Generic Reader: printer (object)
Package

monkeylib-text-output.

Methods
Reader Method: printer ((text-pretty-printer text-pretty-printer))

automatically generated reader method

Source

text-output.lisp.

Target Slot

printer.

Generic Writer: (setf printer) (object)
Package

monkeylib-text-output.

Methods
Writer Method: (setf printer) ((text-pretty-printer text-pretty-printer))

automatically generated writer method

Source

text-output.lisp.

Target Slot

printer.

Generic Reader: tab-width (object)
Package

monkeylib-text-output.

Methods
Reader Method: tab-width ((text-pretty-printer text-pretty-printer))

automatically generated reader method

Source

text-output.lisp.

Target Slot

tab-width.

Generic Writer: (setf tab-width) (object)
Package

monkeylib-text-output.

Methods
Writer Method: (setf tab-width) ((text-pretty-printer text-pretty-printer))

automatically generated writer method

Source

text-output.lisp.

Target Slot

tab-width.


4.2.4 Classes

Class: indenting-printer
Package

monkeylib-text-output.

Source

text-output.lisp.

Direct methods
Direct slots
Slot: out
Initargs

:out

Readers

out.

Writers

(setf out).

Slot: beginning-of-line-p
Initform

t

Readers

beginning-of-line-p.

Writers

(setf beginning-of-line-p).

Slot: indentation
Initform

0

Readers

indentation.

Writers

(setf indentation).

Slot: indenting-p
Initform

t

Readers

indenting-p.

Writers

(setf indenting-p).

Class: text-pretty-printer
Package

monkeylib-text-output.

Source

text-output.lisp.

Direct methods
Direct slots
Slot: printer
Initargs

:printer

Readers

printer.

Writers

(setf printer).

Slot: tab-width
Initform

monkeylib-text-output::*default-tab-width*

Initargs

:tab-width

Readers

tab-width.

Writers

(setf tab-width).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
B   C   E   F   G   I   M   N   O   P   R   T   U   W  
Index Entry  Section

(
(setf beginning-of-line-p): Private generic functions
(setf beginning-of-line-p): Private generic functions
(setf indentation): Private generic functions
(setf indentation): Private generic functions
(setf indenting-p): Private generic functions
(setf indenting-p): Private generic functions
(setf ops): Public generic functions
(setf ops): Public generic functions
(setf out): Private generic functions
(setf out): Private generic functions
(setf printer): Private generic functions
(setf printer): Private generic functions
(setf tab-width): Private generic functions
(setf tab-width): Private generic functions

B
beginning-of-line-p: Private generic functions
beginning-of-line-p: Private generic functions

C
codegen-text: Public ordinary functions
compile-buffer: Private ordinary functions

E
embed-code: Public generic functions
embed-code: Public generic functions
embed-code: Public generic functions
embed-value: Public generic functions
embed-value: Public generic functions
embed-value: Public generic functions
emit: Private ordinary functions
emit-freshline: Private ordinary functions
emit-newline: Private ordinary functions
emit/no-newlines: Private ordinary functions

F
freshline: Public generic functions
freshline: Public generic functions
freshline: Public generic functions
Function, codegen-text: Public ordinary functions
Function, compile-buffer: Private ordinary functions
Function, emit: Private ordinary functions
Function, emit-freshline: Private ordinary functions
Function, emit-newline: Private ordinary functions
Function, emit/no-newlines: Private ordinary functions
Function, generate-code: Private ordinary functions
Function, get-pretty-printer: Public ordinary functions
Function, indent-if-necessary: Private ordinary functions
Function, make-op-buffer: Private ordinary functions
Function, new-pretty-printer: Private ordinary functions
Function, optimize-static-output: Private ordinary functions
Function, push-op: Private ordinary functions

G
generate-code: Private ordinary functions
Generic Function, (setf beginning-of-line-p): Private generic functions
Generic Function, (setf indentation): Private generic functions
Generic Function, (setf indenting-p): Private generic functions
Generic Function, (setf ops): Public generic functions
Generic Function, (setf out): Private generic functions
Generic Function, (setf printer): Private generic functions
Generic Function, (setf tab-width): Private generic functions
Generic Function, beginning-of-line-p: Private generic functions
Generic Function, embed-code: Public generic functions
Generic Function, embed-value: Public generic functions
Generic Function, freshline: Public generic functions
Generic Function, indent: Public generic functions
Generic Function, indentation: Private generic functions
Generic Function, indenting-p: Private generic functions
Generic Function, newline: Public generic functions
Generic Function, op->code: Private generic functions
Generic Function, ops: Public generic functions
Generic Function, out: Private generic functions
Generic Function, printer: Private generic functions
Generic Function, raw-string: Public generic functions
Generic Function, tab-width: Private generic functions
Generic Function, toggle-indenting: Public generic functions
Generic Function, unindent: Public generic functions
get-pretty-printer: Public ordinary functions

I
indent: Public generic functions
indent: Public generic functions
indent: Public generic functions
indent-if-necessary: Private ordinary functions
indentation: Private generic functions
indentation: Private generic functions
indenting-p: Private generic functions
indenting-p: Private generic functions

M
Macro, with-text-output: Public macros
make-op-buffer: Private ordinary functions
Method, (setf beginning-of-line-p): Private generic functions
Method, (setf indentation): Private generic functions
Method, (setf indenting-p): Private generic functions
Method, (setf ops): Public generic functions
Method, (setf out): Private generic functions
Method, (setf printer): Private generic functions
Method, (setf tab-width): Private generic functions
Method, beginning-of-line-p: Private generic functions
Method, embed-code: Public generic functions
Method, embed-code: Public generic functions
Method, embed-value: Public generic functions
Method, embed-value: Public generic functions
Method, freshline: Public generic functions
Method, freshline: Public generic functions
Method, indent: Public generic functions
Method, indent: Public generic functions
Method, indentation: Private generic functions
Method, indenting-p: Private generic functions
Method, newline: Public generic functions
Method, newline: Public generic functions
Method, op->code: Private generic functions
Method, op->code: Private generic functions
Method, op->code: Private generic functions
Method, op->code: Private generic functions
Method, op->code: Private generic functions
Method, op->code: Private generic functions
Method, op->code: Private generic functions
Method, op->code: Private generic functions
Method, ops: Public generic functions
Method, out: Private generic functions
Method, printer: Private generic functions
Method, raw-string: Public generic functions
Method, raw-string: Public generic functions
Method, tab-width: Private generic functions
Method, toggle-indenting: Public generic functions
Method, toggle-indenting: Public generic functions
Method, unindent: Public generic functions
Method, unindent: Public generic functions

N
new-pretty-printer: Private ordinary functions
newline: Public generic functions
newline: Public generic functions
newline: Public generic functions

O
op->code: Private generic functions
op->code: Private generic functions
op->code: Private generic functions
op->code: Private generic functions
op->code: Private generic functions
op->code: Private generic functions
op->code: Private generic functions
op->code: Private generic functions
op->code: Private generic functions
ops: Public generic functions
ops: Public generic functions
optimize-static-output: Private ordinary functions
out: Private generic functions
out: Private generic functions

P
printer: Private generic functions
printer: Private generic functions
push-op: Private ordinary functions

R
raw-string: Public generic functions
raw-string: Public generic functions
raw-string: Public generic functions

T
tab-width: Private generic functions
tab-width: Private generic functions
toggle-indenting: Public generic functions
toggle-indenting: Public generic functions
toggle-indenting: Public generic functions

U
unindent: Public generic functions
unindent: Public generic functions
unindent: Public generic functions

W
with-text-output: Public macros