* scheme-io.texi (Block Reading and Writing): Moved the
authorMartin Grabmüller <mgrabmue@cs.tu-berlin.de>
Fri, 4 May 2001 04:57:39 +0000 (04:57 +0000)
committerMartin Grabmüller <mgrabmue@cs.tu-berlin.de>
Fri, 4 May 2001 04:57:39 +0000 (04:57 +0000)
documentation for read-string!/partial from the node `Reading'.

* scheme-data.texi (List/String Conversion): Added docstring for
`string-split'.

doc/ChangeLog
doc/scheme-data.texi
doc/scheme-io.texi

index d097ace..4a1fffb 100644 (file)
@@ -1,3 +1,11 @@
+2001-05-04  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>
+
+       * scheme-io.texi (Block Reading and Writing): Moved the
+       documentation for read-string!/partial from the node `Reading'.
+
+       * scheme-data.texi (List/String Conversion): Added docstring for
+       `string-split'.
+
 2001-05-02  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>
 
        * srfi-13-14.texi: Added @bullet to various @itemize lists.
index 88b331a..3032a02 100755 (executable)
@@ -1436,6 +1436,27 @@ the given string @var{str}. @code{string->list} and
 concerned.
 @end deffn
 
+@deffn primitive string-split str chr
+Split the string @var{str} into the a list of the substrings delimited
+by appearances of the character @var{chr}.  Note that an empty substring
+between separator characters will result in an empty string in the
+result list.
+@lisp
+(string-split "root:x:0:0:root:/root:/bin/bash" #\:)
+@result{}
+("root" "x" "0" "0" "root" "/root" "/bin/bash")
+
+(string-split "::" #\:)
+@result{}
+("" "" "")
+
+(string-split "" #\:)
+@result{}
+("")
+@end lisp
+@end deffn
+
+
 @node String Selection
 @subsection String Selection
 
index 809b5f1..3562e57 100644 (file)
@@ -141,41 +141,6 @@ Set the current column or line number of @var{port}, using the
 current input port if none is specified.
 @end deffn
 
-@deffn primitive read-string!/partial str [port_or_fdes [start [end]]]
-Read characters from an fport or file descriptor into a
-string @var{str}.  This procedure is scsh-compatible
-and can efficiently read large strings.  It will:
-
-@itemize
-@item
-attempt to fill the entire string, unless the @var{start}
-and/or @var{end} arguments are supplied.  i.e., @var{start}
-defaults to 0 and @var{end} defaults to
-@code{(string-length str)}
-@item
-use the current input port if @var{port_or_fdes} is not
-supplied.
-@item
-read any characters that are currently available,
-without waiting for the rest (short reads are possible).
-
-@item
-wait for as long as it needs to for the first character to
-become available, unless the port is in non-blocking mode
-@item
-return @code{#f} if end-of-file is encountered before reading
-any characters, otherwise return the number of characters
-read.
-@item
-return 0 if the port is in non-blocking mode and no characters
-are immediately available.
-@item
-return 0 if the request is for 0 bytes, with no
-end-of-file check
-@end itemize
-@end deffn
-
-
 @node Writing
 @section Writing
 
@@ -442,8 +407,40 @@ It currently contains a single procedure which helps implement
 the @code{(scsh rw)} module in guile-scsh.
 
 @deffn primitive read-string!/partial str [port_or_fdes] [start] [end]
+Read characters from an fport or file descriptor into a
+string @var{str}.  This procedure is scsh-compatible
+and can efficiently read large strings.  It will:
+
+@itemize
+@item
+attempt to fill the entire string, unless the @var{start}
+and/or @var{end} arguments are supplied.  i.e., @var{start}
+defaults to 0 and @var{end} defaults to
+@code{(string-length str)}
+@item
+use the current input port if @var{port_or_fdes} is not
+supplied.
+@item
+read any characters that are currently available,
+without waiting for the rest (short reads are possible).
+
+@item
+wait for as long as it needs to for the first character to
+become available, unless the port is in non-blocking mode
+@item
+return @code{#f} if end-of-file is encountered before reading
+any characters, otherwise return the number of characters
+read.
+@item
+return 0 if the port is in non-blocking mode and no characters
+are immediately available.
+@item
+return 0 if the request is for 0 bytes, with no
+end-of-file check
+@end itemize
 @end deffn
 
+
 @node Default Ports
 @section Default Ports for Input, Output and Errors