Improve doc of `string-index', `string-index-right', and `string-rindex'.
authorLudovic Courtès <ludo@gnu.org>
Tue, 4 Jan 2011 17:08:58 +0000 (18:08 +0100)
committerLudovic Courtès <ludo@gnu.org>
Tue, 4 Jan 2011 17:08:58 +0000 (18:08 +0100)
Suggested by Noah Lavine <noah.b.lavine@gmail.com>.

* doc/ref/api-data.texi (String Searching): Mention the return value of
  `string-index', `string-index-right', and `string-rindex' when no
  match is found.

* libguile/srfi-13.c (scm_string_index, scm_string_index_right,
  scm_string_rindex): Adjust docstring accordingly.

doc/ref/api-data.texi
libguile/srfi-13.c

index 14b81f5..2c990f9 100755 (executable)
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
-@c Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010
+@c Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
 
@@ -3398,6 +3398,8 @@ satisfies the predicate @var{char_pred}, if it is a procedure,
 @item
 is in the set @var{char_pred}, if it is a character set.
 @end itemize
+
+Return @code{#f} if no match is found.
 @end deffn
 
 @deffn {Scheme Procedure} string-rindex s char_pred [start [end]]
@@ -3415,6 +3417,8 @@ satisfies the predicate @var{char_pred}, if it is a procedure,
 @item
 is in the set if @var{char_pred} is a character set.
 @end itemize
+
+Return @code{#f} if no match is found.
 @end deffn
 
 @deffn {Scheme Procedure} string-prefix-length s1 s2 [start1 [end1 [start2 [end2]]]]
@@ -3476,6 +3480,8 @@ satisfies the predicate @var{char_pred}, if it is a procedure,
 @item
 is in the set if @var{char_pred} is a character set.
 @end itemize
+
+Return @code{#f} if no match is found.
 @end deffn
 
 @deffn {Scheme Procedure} string-skip s char_pred [start [end]]
index afeb804..dfe948b 100644 (file)
@@ -1,6 +1,6 @@
 /* srfi-13.c --- SRFI-13 procedures for Guile
  *
- * Copyright (C) 2001, 2004, 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -1651,7 +1651,8 @@ SCM_DEFINE (scm_string_index, "string-index", 2, 2, 0,
            "\n"
            "@item\n"
            "is in the set @var{char_pred}, if it is a character set.\n"
-           "@end itemize")
+           "@end itemize\n\n"
+           "Return @code{#f} if no match is found.")
 #define FUNC_NAME s_scm_string_index
 {
   size_t cstart, cend;
@@ -1715,7 +1716,8 @@ SCM_DEFINE (scm_string_index_right, "string-index-right", 2, 2, 0,
            "\n"
            "@item\n"
            "is in the set if @var{char_pred} is a character set.\n"
-           "@end itemize")
+           "@end itemize\n\n"
+           "Return @code{#f} if no match is found.")
 #define FUNC_NAME s_scm_string_index_right
 {
   size_t cstart, cend;
@@ -1779,7 +1781,8 @@ SCM_DEFINE (scm_string_rindex, "string-rindex", 2, 2, 0,
            "\n"
            "@item\n"
            "is in the set if @var{char_pred} is a character set.\n"
-           "@end itemize")
+           "@end itemize\n\n"
+           "Return @code{#f} if no match is found.")
 #define FUNC_NAME s_scm_string_rindex
 {
   return scm_string_index_right (s, char_pred, start, end);