File: pp.scm

package info (click to toggle)
slib 2c3-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,636 kB
  • ctags: 1,551
  • sloc: lisp: 18,617; makefile: 300; sh: 135
file content (12 lines) | stat: -rw-r--r-- 376 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
;"pp.scm" Pretty-print

(require 'generic-write)

; (pretty-print obj port) pretty prints 'obj' on 'port'.  The current
; output port is used if 'port' is not specified.

(define (pp:pretty-print obj . opt)
  (let ((port (if (pair? opt) (car opt) (current-output-port))))
    (generic-write obj #f 79 (lambda (s) (display s port) #t))))

(define pretty-print pp:pretty-print)