summaryrefslogtreecommitdiff
path: root/doc/ref/api-io.texi
diff options
context:
space:
mode:
authorAdam Faiz <adam.faiz@disroot.org>2024-12-19 22:36:38 +0100
committerMikael Djurfeldt <mikael@djurfeldt.com>2024-12-19 22:36:38 +0100
commitc2829e4a86d6fc72520930825bd44900d876db1d (patch)
tree9a4882c7a6202346cb9d254a08654ccc0e7552db /doc/ref/api-io.texi
parenta9c079b13b74e46ccdea6e2d4b5209b0f7a2005a (diff)
downloadguile-c2829e4a86d6fc72520930825bd44900d876db1d.tar.gz
New line or field iteration procedures in (ice-9 rdelim)
* NEWS: Update * module/ice-9/rdelim (for-rdelim-from-port, for-delimited-from-port, for-line-in-file): New procedures. * doc/ref/api-io.texi: Documentation of `for-rdelim-for-port`-related procedures. * test-suite/tests/rdelim.test: Tests for `for-rdelim-for-port`-related procedures. Signed-off-by: Mikael Djurfeldt <mikael@djurfeldt.com>
Diffstat (limited to 'doc/ref/api-io.texi')
-rw-r--r--doc/ref/api-io.texi22
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/ref/api-io.texi b/doc/ref/api-io.texi
index 79bc9e9d6..0a9773f62 100644
--- a/doc/ref/api-io.texi
+++ b/doc/ref/api-io.texi
@@ -984,6 +984,28 @@ used. This procedure is equivalent to:
@end lisp
@end deffn
+@deffn {Scheme Procedure} for-rdelim-from-port port proc rdelim-proc @
+ [#:stop-pred=eof-object?]
+For every unit provided by @code{(rdelim-proc port)}, provide
+this unit(rdelim) to @var{proc} to be processed. This will continue throughout
+@var{port} until @var{stop-pred} returns @code{#t}.
+@var{stop-pred} is @code{eof-object?} by default.
+@var{rdelim-proc} has to advance through @var{port} with every call made to it.
+@end deffn
+
+@deffn {Scheme Procedure} for-delimited-from-port port proc @
+ [#:delims=''\n''] [#:handle-delim='trim]
+Call @var{proc} for every line delimited by @var{delims} from @var{port}.
+@end deffn
+
+@deffn {Scheme Procedure} for-line-in-file file proc @
+ [#:encoding=#f] [#:guess-encoding=#f]
+Call @var{proc} for every line in @var{file}.
+@var{file} must be a filename string.
+
+The line provided to @var{proc} is guaranteed to be a string.
+@end deffn
+
@node Default Ports
@subsection Default Ports for Input, Output and Errors
@cindex Default ports