From: Adam Faiz <adam.faiz@disroot.org>
To: guile-devel@gnu.org
Cc: Ricardo Wurmus <rekado@elephly.net>, Tomas Volf <~@wolfsden.cz>,
Maxime Devos <maximedevos@telenet.be>,
Nala Ginrut <nalaginrut@gmail.com>
Subject: [PATCH 2/2] doc: Add documentation for `for-rdelim-in-port` and, related procedures.
Date: Mon, 16 Dec 2024 23:24:33 +0800 [thread overview]
Message-ID: <43ad0b39-03cf-b648-3bc9-8c4a064519a8@disroot.org> (raw)
In-Reply-To: <d6abae37-02d8-a7e0-e184-9db06159b975@disroot.org>
From b271d059615571d0d50027758494b8dbb5e8625e Mon Sep 17 00:00:00 2001
From: AwesomeAdam54321 <adam.faiz@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
next prev parent reply other threads:[~2024-12-16 15:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-16 15:21 [PATCH 1/2] rdelim: Add new procedure `for-rdelim-in-port` Adam Faiz
2024-12-16 15:24 ` Adam Faiz [this message]
2024-12-17 4:31 ` [PATCH] test-suite: Add tests for `for-rdelim-in-port`-related functions Adam Faiz
2024-12-17 5:11 ` Nala Ginrut
2024-12-17 7:21 ` Mikael Djurfeldt
2024-12-17 16:43 ` Mikael Djurfeldt
2024-12-16 16:46 ` [PATCH 1/2] rdelim: Add new procedure `for-rdelim-in-port` Nala Ginrut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43ad0b39-03cf-b648-3bc9-8c4a064519a8@disroot.org \
--to=adam.faiz@disroot.org \
--cc=guile-devel@gnu.org \
--cc=maximedevos@telenet.be \
--cc=nalaginrut@gmail.com \
--cc=rekado@elephly.net \
--cc=~@wolfsden.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).