summaryrefslogtreecommitdiff
path: root/doc/ref
diff options
context:
space:
mode:
authorChris Jester-Young <cky944@gmail.com>2014-11-30 05:20:54 -0500
committerMark H Weaver <mhw@netris.org>2014-12-02 11:49:05 -0500
commitcffa9bd6a36d0ab38d700851beb0fcc44a191c17 (patch)
tree4a8cd00be2e473573835a4abab6be8fcc0107403 /doc/ref
parentd1447c717bd90f00b53da87b8b9a80d5fcb41f39 (diff)
downloadguile-cffa9bd6a36d0ab38d700851beb0fcc44a191c17.tar.gz
Implement SRFI 28: Basic Format Strings.
* module/srfi/srfi-28.scm: New module. * module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-28.scm. * doc/ref/srfi-modules.texi (SRFI-28): New node.
Diffstat (limited to 'doc/ref')
-rw-r--r--doc/ref/srfi-modules.texi37
1 files changed, 37 insertions, 0 deletions
diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi
index 2cf9fd154..d8ed8e1cc 100644
--- a/doc/ref/srfi-modules.texi
+++ b/doc/ref/srfi-modules.texi
@@ -38,6 +38,7 @@ get the relevant SRFI documents from the SRFI home page
* SRFI-23:: Error reporting
* SRFI-26:: Specializing parameters
* SRFI-27:: Sources of Random Bits
+* SRFI-28:: Basic format strings.
* SRFI-30:: Nested multi-line block comments
* SRFI-31:: A special form `rec' for recursive evaluation
* SRFI-34:: Exception handling.
@@ -3276,6 +3277,42 @@ reasonably small value (related to the width of the mantissa of an
efficient number format).
@end defun
+@node SRFI-28
+@subsection SRFI-28 - Basic Format Strings
+@cindex SRFI-28
+
+SRFI-28 provides a basic @code{format} procedure that provides only
+the @code{~a}, @code{~s}, @code{~%}, and @code{~~} format specifiers.
+You can import this procedure by using:
+
+@lisp
+(use-modules (srfi srfi-28))
+@end lisp
+
+@deffn {Scheme Procedure} format message arg @dots{}
+Returns a formatted message, using @var{message} as the format string,
+which can contain the following format specifiers:
+
+@table @code
+@item ~a
+Insert the textual representation of the next @var{arg}, as if printed
+by @code{display}.
+
+@item ~s
+Insert the textual representation of the next @var{arg}, as if printed
+by @code{write}.
+
+@item ~%
+Insert a newline.
+
+@item ~~
+Insert a tilde.
+@end table
+
+This procedure is the same as calling @code{simple-format} (@pxref{Writing})
+with @code{#f} as the destination.
+@end deffn
+
@node SRFI-30
@subsection SRFI-30 - Nested Multi-line Comments
@cindex SRFI-30