* doc pretty-print new options
@ 2003-11-06 23:52 Kevin Ryde
0 siblings, 0 replies; only message in thread
From: Kevin Ryde @ 2003-11-06 23:52 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 608 bytes --]
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.
[-- Attachment #2: NEWS.pretty.diff --]
[-- Type: text/plain, Size: 430 bytes --]
--- 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?'.
[-- Attachment #3: misc-modules.texi.pretty.diff --]
[-- Type: text/plain, Size: 1330 bytes --]
--- 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
[-- Attachment #4: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-11-06 23:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-06 23:52 doc pretty-print new options Kevin Ryde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).