summaryrefslogtreecommitdiff
path: root/libguile/srfi-13.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2005-08-12 01:14:02 +0000
committerKevin Ryde <user42@zip.com.au>2005-08-12 01:14:02 +0000
commit1729055bcf3e24c97a55462409381f6a0c420a6e (patch)
tree174285ac617d4acebf4b84e30a7afafdf94050cb /libguile/srfi-13.c
parent036482e9cdcb8bd1761fc6b85a60ae9c3d908086 (diff)
downloadguile-1729055bcf3e24c97a55462409381f6a0c420a6e.tar.gz
(scm_string_for_each_index): Correction to docstring.
Diffstat (limited to 'libguile/srfi-13.c')
-rw-r--r--libguile/srfi-13.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libguile/srfi-13.c b/libguile/srfi-13.c
index ee4a09a09..a98b75546 100644
--- a/libguile/srfi-13.c
+++ b/libguile/srfi-13.c
@@ -3010,8 +3010,22 @@ SCM_DEFINE (scm_string_for_each, "string-for-each", 2, 2, 0,
SCM_DEFINE (scm_string_for_each_index, "string-for-each-index", 2, 2, 0,
(SCM proc, SCM s, SCM start, SCM end),
- "@var{proc} is mapped over @var{s} in left-to-right order. The\n"
- "return value is not specified.")
+ "Call @code{(@var{proc} i)} for each index i in @var{s}, from\n"
+ "left to right.\n"
+ "\n"
+ "For example, to change characters to alternately upper and\n"
+ "lower case,\n"
+ "\n"
+ "@example\n"
+ "(define str (string-copy \"studly\"))\n"
+ "(string-for-each-index\n"
+ " (lambda (i)\n"
+ " (string-set! str i\n"
+ " ((if (even? i) char-upcase char-downcase)\n"
+ " (string-ref str i))))\n"
+ " str)\n"
+ "str @result{} \"StUdLy\"\n"
+ "@end example")
#define FUNC_NAME s_scm_string_for_each_index
{
size_t cstart, cend;