The cl-debug-print Reference Manual

This is the cl-debug-print Reference Manual, version 0.2.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 04:49:56 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cl-debug-print

A reader-macro for debug print

Author

Satoshi Imai

License

MIT

Long Description

* cl-debug-print

A reader macro package for debug printing.

** Install

When install by Roswell,

#+begin_src
ros install masatoi/cl-debug-print
#+end_src

** Usage

#+BEGIN_SRC lisp
(ql:quickload :cl-debug-print)
(debug-print:use-debug-print)

;;; Debug print

(defun fact (n)
(if (= #>n 0)
1
(* n #>(fact (1- n)))))

(fact 10)

;; N => 10
;; N => 9
;; N => 8
;; N => 7
;; N => 6
;; N => 5
;; N => 4
;; N => 3
;; N => 2
;; N => 1
;; N => 0
;; (FACT (1- N)) => 1
;; (FACT (1- N)) => 1
;; (FACT (1- N)) => 2
;; (FACT (1- N)) => 6
;; (FACT (1- N)) => 24
;; (FACT (1- N)) => 120
;; (FACT (1- N)) => 720
;; (FACT (1- N)) => 5040
;; (FACT (1- N)) => 40320
;; (FACT (1- N)) => 362880

;;; Debug push

(defun fact2 (n)
(if (= n 0)
1
(* n #!(fact2 (1- n)))))

(fact2 10)
;; => 3628800

;;; Debug push results are stored to *dbg*

cl-debug-print:*dbg*
;; => (362880 40320 5040 720 120 24 6 2 1 1)

;;; Clearing debug push list

(cl-debug-print:clear-dbg)

cl-debug-print:*dbg*
;; => nil
#+END_SRC

*** Configure variables

#+begin_src lisp
;;; Setting destination stream (default value is *standard-output*)

(setf cl-debug-print:*destination* *error-output*)

;;; Setting for using DESCRIBE instead of mere value (default value is nil)

(setf cl-debug-print:*use-describe* t)

#>’sin

;; ’SIN => COMMON-LISP:SIN
;; [symbol]
;;
;; SIN names a compiled function:
;; Lambda-list: (NUMBER)
;; Declared type: (FUNCTION (NUMBER)
;; (VALUES
;; (OR (SINGLE-FLOAT -1.0 1.0)
;; (DOUBLE-FLOAT -1.0d0 1.0d0)
;; (COMPLEX SINGLE-FLOAT) (COMPLEX DOUBLE-FLOAT))
;; &OPTIONAL))
;; Derived type: (FUNCTION (T)
;; (VALUES
;; (OR (SINGLE-FLOAT -1.0 1.0)
;; (DOUBLE-FLOAT -1.0d0 1.0d0)
;; (COMPLEX DOUBLE-FLOAT) (COMPLEX SINGLE-FLOAT))
;; &OPTIONAL))
;; Documentation:
;; Return the sine of NUMBER.
;; Known attributes: foldable, flushable, unsafely-flushable, movable, recursive ;; Source file: SYS:SRC;CODE;IRRAT.LISP
#+end_src

Version

0.2.0

Dependency

cl-syntax (system).

Source

cl-debug-print.asd.

Child Component

src (module).


3 Modules

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


3.1 cl-debug-print/src

Source

cl-debug-print.asd.

Parent Component

cl-debug-print (system).

Child Component

cl-debug-print.lisp (file).


4 Files

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


4.1 Lisp


4.1.1 cl-debug-print/cl-debug-print.asd

Source

cl-debug-print.asd.

Parent Component

cl-debug-print (system).

ASDF Systems

cl-debug-print.


4.1.2 cl-debug-print/src/cl-debug-print.lisp

Source

cl-debug-print.asd.

Parent Component

src (module).

Packages

cl-debug-print.

Public Interface

5 Packages

Packages are listed by definition order.


5.1 cl-debug-print

Source

cl-debug-print.lisp.

Nickname

debug-print

Use List
  • cl-syntax.
  • common-lisp.
  • editor-hints.named-readtables.
Public Interface

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: *dbg*

*DBG* is a list, and using DEBUG-PUSH(#!) will be pushed to this list. To clear this variable, use the CLEAR-DBG function.

Package

cl-debug-print.

Source

cl-debug-print.lisp.

Special Variable: *destination*

*DESTINATION* allows to configure destination stream for debug prints.

Package

cl-debug-print.

Source

cl-debug-print.lisp.

Special Variable: *use-describe*

When *USE-DESCRIBE* is true, describe is used for debug prints.

Package

cl-debug-print.

Source

cl-debug-print.lisp.

Special Variable: debug-print-syntax
Package

cl-debug-print.

Source

cl-debug-print.lisp.


6.1.2 Ordinary functions

Function: clear-dbg ()
Package

cl-debug-print.

Source

cl-debug-print.lisp.

Function: debug-print (pre-exp exp)
Package

cl-debug-print.

Source

cl-debug-print.lisp.

Function: debug-print-reader (stream char1 char2)
Package

cl-debug-print.

Source

cl-debug-print.lisp.

Function: debug-push (obj)
Package

cl-debug-print.

Source

cl-debug-print.lisp.

Function: debug-push-reader (stream char1 char2)
Package

cl-debug-print.

Source

cl-debug-print.lisp.

Function: use-debug-print ()
Package

cl-debug-print.

Source

cl-debug-print.lisp.


Appendix A Indexes


A.1 Concepts