The vivid-colors Reference Manual

Table of Contents

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

The vivid-colors Reference Manual

This is the vivid-colors Reference Manual, version 7.1.6, generated automatically by Declt version 3.0 "Montgomery Scott" on Sun May 15 06:26:27 2022 GMT+0.


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

1 Introduction

VIVID-COLORS 2.0.0

What is this?

Colored object printer.

Alternatives and differences.

Please tell me if exists.

Usage

* (vprint '(:keyword :keyword
            :character #\A
	    :string "string"
	    :number 1/3
	    :pathname #P"foo/bar"))

image of the command result.

* (vprint '(defun vprint-structure (output structure)
             (vprint-logical-block (output nil :prefix "#S(" :suffix ")")
               (vprint (type-of structure) output t)
               (write-char #\Space output)
               (vprint-newline :linear output)
               (loop :for (slot . rest) :on (c2mop:class-slots (class-of structure))
                     :for name = (c2mop:slot-definition-name slot)
                     :do (vprint (intern (symbol-name name) :keyword) output t)
                         (write-char #\Space output)
                         (vprint (slot-value structure name) output t)
                         (when rest
                           (write-char #\Space output)
                           (vprint-newline :linear output))))))

image of the command result.

How to extend.

Ideally, I want to use a pretty-printing system for this coloring feature but it does not match for this purpose because

  1. Pretty printer counts escape sequence length too. (Indentation will be broken.)
  2. Pretty printing system does not provide ways to customizing. (especially the way to supersede the class for pretty-printing streams.)

In other words, at least I am satisfied with pretty-printing API. So vivid-colors APIs are designed almost the same with common lisp pretty printing APIs.

For detailed examples, see source code.

A tiny example to print the common lisp symbols as blue is bellow.

* (defun vprint-cl-symbol (output symbol)
    (put symbol output :color cl-colors2:+blue+))
VPRINT-CL-SYMBOL

* (handler-bind ((dispatch-key-confliction #'replace-by-new))
    (define-vprint-dispatch blue-cl-symbols
      (:merge :pretty :standard)
      (:set `(member ,@(loop :for s :being :each :external-symbols :of :cl
                             :collect s))
            'vprint-cl-symbol)))
BLUE-CL-SYMBOLS

* (in-vprint-dispatch blue-cl-symbols)
#<VPRINT-DISPATCH BLUE-CL-SYMBOLS entry 19>

* (vprint '(defun vprint-structure (output structure)
             (vprint-logical-block (output nil :prefix "#S(" :suffix ")")
               (vprint (type-of structure) output t)
               (write-char #\Space output)
               (vprint-newline :linear output)
               (loop :for (slot . rest) :on (c2mop:class-slots (class-of structure))
                     :for name = (c2mop:slot-definition-name slot)
                     :do (vprint (intern (symbol-name name) :keyword) output t)
                         (write-char #\Space output)
                         (vprint (slot-value structure name) output t)
                         (when rest
                           (write-char #\Space output)
                           (vprint-newline :linear output))))))

image of the command result.

PUT vs VPRINT.

PUT is used to control atomic representation coloring. 'Atomic representation' is roughly the representation that is not changed its representation by the variable CL:*PRINT-PRETTY* e.g. symbol, character, number, pathname or string.

For controlling the non-atomic representation coloring, you need to use VPRINT with binding the variable *COLOR*.

If you do not control coloring (i.e. using global one), use VPRINT.

From developer

Product's goal

License

MIT

Developed with

SBCL

Tested with

Installation


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

2 Systems

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


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

2.1 vivid-colors

Author

SATO Shinichi

Source Control

(:git "git@github.com:hyotang666/vivid-colors")

Bug Tracker

https://github.com/hyotang666/vivid-colors/issues

License

MIT

Description

Colored object printer.

Version

7.1.6

Dependencies
Source

vivid-colors.asd (file)

Component

vivid-colors.lisp (file)


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

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 files   [Contents][Index]

3.1.1 vivid-colors.asd

Location

/home/quickref/quicklisp/dists/quicklisp/software/vivid-colors-20220220-git/vivid-colors.asd

Systems

vivid-colors (system)


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

3.1.2 vivid-colors/vivid-colors.lisp

Parent

vivid-colors (system)

Location

vivid-colors.lisp

Packages

vivid-colors

Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 vivid-colors

Source

vivid-colors.lisp (file)

Use List

common-lisp

Internal Definitions

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

5 Definitions

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


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

5.1 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

5.1.1 Functions

Function: count-pre-body-forms LAMBDA-LIST
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: default-printer OUTPUT EXP
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: non-printable-char-p CHAR
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-array OUTPUT ARRAY
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-backquote OUTPUT BACKQUOTE
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-block OUTPUT EXP
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-char OUTPUT CHAR
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-comma OUTPUT COMMA
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-funcall OUTPUT FORM
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-function OUTPUT FUNCTION
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-if OUTPUT EXP
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-keyword OUTPUT KEYWORD
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-let OUTPUT EXP
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-list OUTPUT LIST &optional NEWLINE-KIND
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-loop OUTPUT EXP
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-macrocall OUTPUT FORM
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-pathname OUTPUT PATHNAME
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-progn OUTPUT EXP
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-quote OUTPUT QUOTE
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-real OUTPUT REAL
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-reference OUTPUT REF
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-string OUTPUT STRING
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-structure OUTPUT STRUCTURE
Package

vivid-colors

Source

vivid-colors.lisp (file)

Function: vprint-vector OUTPUT VECTOR
Package

vivid-colors

Source

vivid-colors.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   V  
Index Entry  Section

F
File, Lisp, vivid-colors.asd: The vivid-colors․asd file
File, Lisp, vivid-colors/vivid-colors.lisp: The vivid-colors/vivid-colors․lisp file

L
Lisp File, vivid-colors.asd: The vivid-colors․asd file
Lisp File, vivid-colors/vivid-colors.lisp: The vivid-colors/vivid-colors․lisp file

V
vivid-colors.asd: The vivid-colors․asd file
vivid-colors/vivid-colors.lisp: The vivid-colors/vivid-colors․lisp file

Jump to:   F   L   V  

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

A.2 Functions

Jump to:   C   D   F   N   V  
Index Entry  Section

C
count-pre-body-forms: Internal functions

D
default-printer: Internal functions

F
Function, count-pre-body-forms: Internal functions
Function, default-printer: Internal functions
Function, non-printable-char-p: Internal functions
Function, vprint-array: Internal functions
Function, vprint-backquote: Internal functions
Function, vprint-block: Internal functions
Function, vprint-char: Internal functions
Function, vprint-comma: Internal functions
Function, vprint-funcall: Internal functions
Function, vprint-function: Internal functions
Function, vprint-if: Internal functions
Function, vprint-keyword: Internal functions
Function, vprint-let: Internal functions
Function, vprint-list: Internal functions
Function, vprint-loop: Internal functions
Function, vprint-macrocall: Internal functions
Function, vprint-pathname: Internal functions
Function, vprint-progn: Internal functions
Function, vprint-quote: Internal functions
Function, vprint-real: Internal functions
Function, vprint-reference: Internal functions
Function, vprint-string: Internal functions
Function, vprint-structure: Internal functions
Function, vprint-vector: Internal functions

N
non-printable-char-p: Internal functions

V
vprint-array: Internal functions
vprint-backquote: Internal functions
vprint-block: Internal functions
vprint-char: Internal functions
vprint-comma: Internal functions
vprint-funcall: Internal functions
vprint-function: Internal functions
vprint-if: Internal functions
vprint-keyword: Internal functions
vprint-let: Internal functions
vprint-list: Internal functions
vprint-loop: Internal functions
vprint-macrocall: Internal functions
vprint-pathname: Internal functions
vprint-progn: Internal functions
vprint-quote: Internal functions
vprint-real: Internal functions
vprint-reference: Internal functions
vprint-string: Internal functions
vprint-structure: Internal functions
vprint-vector: Internal functions

Jump to:   C   D   F   N   V  

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

A.3 Variables


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

A.4 Data types

Jump to:   P   S   V  
Index Entry  Section

P
Package, vivid-colors: The vivid-colors package

S
System, vivid-colors: The vivid-colors system

V
vivid-colors: The vivid-colors system
vivid-colors: The vivid-colors package

Jump to:   P   S   V