guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Little patch to make (ice-9 pretty-print) more flexible


From: Marius Vollmer
Subject: Re: Little patch to make (ice-9 pretty-print) more flexible
Date: 26 Dec 2001 17:02:57 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Matthias Koeppe <address@hidden> writes:

> Recently I needed some pretty-printing facility, not quite as general
> as the Common Lisp one, but a little more flexible than that of (ice-9
> pretty-print).  In fact, almost everything I needed was there, yet not
> nicely exported.  The new procedure PRETTY-PRINT-WITH-OPTIONS allows
> specifying the line width, a per-line prefix and whether to use WRITE
> or DISPLAY. 

Nice, we should include this.  However, the name
pretty-print-with-options sounds a bit unfortunate.  Would it make
sense to extend the original pretty-print to also take the new
options?  We could make it so that when the second arg is not a
keyword, we use it as the port to print to.  Like

  (define (pretty-print obj . opts)
    (if (pair? opts)
        (if (keyword? (car opts))
            (apply pretty-print-with-options obj opts)
            (apply pretty-print-with-options obj #:port (car opts) (cdr opts)))
        (pretty-print-with-options obj)))

and don't export pretty-print-with-options.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]