From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: doc pretty-print new options Date: Fri, 07 Nov 2003 09:52:17 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87sml1qclq.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1068162803 8476 80.91.224.253 (6 Nov 2003 23:53:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Nov 2003 23:53:23 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Nov 07 00:53:20 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AHtwG-0005RA-00 for ; Fri, 07 Nov 2003 00:53:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AHtw6-0007QT-0S for guile-devel@m.gmane.org; Thu, 06 Nov 2003 18:53:10 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AHtvx-0007NC-R6 for guile-devel@gnu.org; Thu, 06 Nov 2003 18:53:01 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AHtvP-00075M-Ts for guile-devel@gnu.org; Thu, 06 Nov 2003 18:52:59 -0500 Original-Received: from [61.8.0.36] (helo=snoopy.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AHtvO-00074K-Tm for guile-devel@gnu.org; Thu, 06 Nov 2003 18:52:27 -0500 Original-Received: from mongrel.pacific.net.au (mongrel.pacific.net.au [61.8.0.107]) by snoopy.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id hA6NqMV0006482 for ; Fri, 7 Nov 2003 10:52:22 +1100 Original-Received: from localhost (ppp99.dyn228.pacific.net.au [203.143.228.99]) by mongrel.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id hA6NpYDJ024787 for ; Fri, 7 Nov 2003 10:51:35 +1100 Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 1AHtvF-0002us-00; Fri, 07 Nov 2003 09:52:17 +1000 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2978 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2978 --=-=-= More recent stuff not yet in the manual, * misc-modules.texi (Pretty Printing): Add new keyword options, break example to avoid long line. New text: The further KEYWORD-OPTIONS are keywords and parameters as follows, #:display? FLAG If FLAG is true then print using `display'. The default is `#f' which means use `write' style. (*note Writing::) #:per-line-prefix STRING Print the given STRING as a prefix on each line. The default is no prefix. #:width COLUMNS Print within the given COLUMNS. The default is 79. --=-=-= Content-Disposition: attachment; filename=NEWS.pretty.diff --- NEWS.~1.408.~ 1970-01-01 10:00:01.000000000 +1000 +++ NEWS 2003-11-04 09:57:11.000000000 +1000 @@ -432,7 +432,7 @@ The function pretty-print from the (ice-9 pretty-print) module can now also be invoked with keyword arguments that control things like -maximum output width. See its online documentation. +maximum output width. See the manual for details. ** Variables have no longer a special behavior for `equal?'. --=-=-= Content-Disposition: attachment; filename=misc-modules.texi.pretty.diff --- misc-modules.texi.~1.6.~ 1970-01-01 10:00:01.000000000 +1000 +++ misc-modules.texi 2003-11-04 09:55:41.000000000 +1000 @@ -21,7 +21,8 @@ @lisp (pretty-print '(define (foo) (lambda (x) -(cond ((zero? x) #t) ((negative? x) -x) (else (if (= x 1) 2 (* x x x))))))) +(cond ((zero? x) #t) ((negative? x) -x) (else +(if (= x 1) 2 (* x x x))))))) @print{} (define (foo) (lambda (x) @@ -30,10 +31,26 @@ (else (if (= x 1) 2 (* x x x)))))) @end lisp -@deffn {Scheme Procedure} pretty-print obj [port] +@deffn {Scheme Procedure} pretty-print obj [port] [keyword-options] Print the textual representation of the Scheme object @var{obj} to @var{port}. @var{port} defaults to the current output port, if not given. + +The further @var{keyword-options} are keywords and parameters as +follows, + +@table @asis +@item @nicode{#:display?} @var{flag} +If @var{flag} is true then print using @code{display}. The default is +@code{#f} which means use @code{write} style. (@pxref{Writing}) + +@item @nicode{#:per-line-prefix} @var{string} +Print the given @var{string} as a prefix on each line. The default is +no prefix. + +@item @nicode{#:width} @var{columns} +Print within the given @var{columns}. The default is 79. +@end table @end deffn Beware: Since @code{pretty-print} uses it's own write procedure, it's --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel --=-=-=--