PSEUDO-PRINT - print lisp as pseudo-code


 

Abstract

The PSEUDO-PRINT library uses the Common Lisp's pretty printing facilities to print pseudo code instead of lisp code. It relies heavily on the use of format strings. See cltl for a great reference on Common Lisp's pretty printer, and for more information on this library including examples see PSEUDO-PRINT.

Note: This library is early days, and many common macros and functions are not yet supported. Patches welcome.

The code is available under the GNU General Public License.

Source: http://github.com/eschulte/pseudo-print.
 

Contents

  1. Source
  2. Introduction
  3. The PSEUDO-PRINT dictionary
    1. pseudo-pprinters
  4. Acknowledgements

 

Source

PSEUDO-PRINT together with this documentation can be found at http://github.com/eschulte/pseudo-print.
 

Introduction

Use `with-pseudo-printer' to print lisp code as pseudo code using the normal printing facilities. E.g.,

PSEUDO-PRINT> (with-pseudo-pprinter
                  (pprint '(if (> a b) (+ a b c) 3/4)))

If (A > B) Then
  (A + B + C)
Else
  3/4
EndIf

PSEUDO-PRINT> (with-pseudo-pprinter
                  (pprint '(DEFUN EUCLIDS-GCD (A B)
                            (IF (= A 0)
                                B
                                (DO ()
                                    ((= B 0) A)
                                  (IF (> A B)
                                      (SETF A (- A B))
                                      (SETF B (- B A))))))))

Function: EUCLIDS-GCD (A, B)
  If (A ≡ 0) Then
    B
  Else
    Do
      If (A > B) Then
        A <- (A - B)
      Else
        B <- (B - A)
      EndIf
    Until (B ≡ 0)
    A
  EndIf
EndFunction

Customize using the `pseudo-pprinters' variable.

see http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node253.html


 

The PSEUDO-PRINT dictionary


[Special variable]
pseudo-pprinters


List of pseudo-printer functions.

 

Acknowledgements

This documentation was prepared with a hacked up version of DOCUMENTATION-TEMPLATE.