[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Implement SRFI 28
From: |
Mark H Weaver |
Subject: |
Re: [PATCH] Implement SRFI 28 |
Date: |
Mon, 01 Dec 2014 13:52:08 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Hi Chris,
"Chris K. Jester-Young" <address@hidden> writes:
> Here's a simple implementation of SRFI 28, which I think would be useful
> to provide in-tree for portability. Feedback welcome. :-)
Sounds good, thanks! See below for comments.
> From b13b3cc1e362775ee06c446460d0926a8d67b569 Mon Sep 17 00:00:00 2001
> From: Chris Jester-Young <address@hidden>
> Date: Sun, 30 Nov 2014 05:20:54 -0500
> Subject: [PATCH] Implement SRFI 28.
Please add "Basic Format Strings" to the summary line here.
> * module/srfi/srfi-28.scm: New module.
> * module/Makefile.am: Build the (srfi srfi-28) module.
> * doc/ref/srfi-modules.texi: Add documentation for (srfi srfi-28).
These last two lines should include the variable and node names,
respectively, like this:
* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-28.scm.
* doc/ref/srfi-modules.texi (SRFI-28): New node.
> ---
> doc/ref/srfi-modules.texi | 37 +++++++++++++++++++++++++++++++++++++
> module/Makefile.am | 1 +
> module/srfi/srfi-28.scm | 34 ++++++++++++++++++++++++++++++++++
> 3 files changed, 72 insertions(+)
> create mode 100644 module/srfi/srfi-28.scm
>
> diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi
> index 2cf9fd1..95a795d 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
>
> address@hidden SRFI-28
> address@hidden SRFI-28 - Basic Format Strings
> address@hidden SRFI-28
> +
> +SRFI-28 provides a basic @code{format} function that provides only the
> address@hidden, @code{~s}, @code{~%}, and @code{~~} format specifiers. You
> +can import this function by using:
The Scheme standards call them "procedures" not "functions", and it
would be good to follow this convention. Also, please put two spaces
between sentences.
> +
> address@hidden
> +(use-modules (srfi srfi-28))
> address@hidden lisp
> +
> address@hidden format message arg @dots{}
Please use "@deffn {Scheme Procedure}" instead of "@defun". I can see
that @defun is used about 8% of the time, but it would be good not to
add more.
> +Returns a formatted message, using @var{message} as the format string,
> +which can contain the following format specifiers:
> +
> address@hidden @code
> address@hidden ~a
> +Insert the textual representation of the next @var{arg}, as if printed
> +by @code{display}.
> +
> address@hidden ~s
> +Insert the textual representation of the next @var{arg}, as if printed
> +by @code{write}.
> +
> address@hidden ~%
> +Insert a newline.
> +
> address@hidden ~~
> +Insert a tilde.
> address@hidden table
> +
> +This function is the same as calling @code{simple-format} (@pxref{Writing})
> +with @code{#f} as the destination.
> address@hidden defun
function --> procedure and defun --> deffn.
The rest looks good to me. Can you post an updated patch?
Thanks!
Mark
- Re: [PATCH] Implement SRFI 28,
Mark H Weaver <=