>From b271d059615571d0d50027758494b8dbb5e8625e Mon Sep 17 00:00:00 2001 From: AwesomeAdam54321 <adam.f...@disroot.org> Date: Mon, 16 Dec 2024 22:55:41 +0800 Subject: [PATCH 2/2] doc: Add documentation for `for-rdelim-in-port` and related procedures.
* doc/ref/api-io.texi (for-rdelim-in-port): Document API. (for-delimited-in-port): Likewise. (for-line-in-file): Likewise. --- doc/ref/api-io.texi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/ref/api-io.texi b/doc/ref/api-io.texi index 79bc9e9d6..23e316c27 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-in-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-in-port port proc @ + [#:delims=''\n''] [#:handle-delim='trim] +Call @var{proc} for every line delimited by @var{delims} in @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 -- 2.41.0