From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Faiz Newsgroups: gmane.lisp.guile.devel Subject: [PATCH 2/2] doc: Add documentation for `for-rdelim-in-port` and, related procedures. Date: Mon, 16 Dec 2024 23:24:33 +0800 Message-ID: <43ad0b39-03cf-b648-3bc9-8c4a064519a8@disroot.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36140"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Ricardo Wurmus , Tomas Volf <~@wolfsden.cz>, Maxime Devos , Nala Ginrut To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Mon Dec 16 16:24:53 2024 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tNCxp-0009Ej-SG for guile-devel@m.gmane-mx.org; Mon, 16 Dec 2024 16:24:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNCxj-00055v-Tr; Mon, 16 Dec 2024 10:24:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNCxi-00055a-9I for guile-devel@gnu.org; Mon, 16 Dec 2024 10:24:46 -0500 Original-Received: from layka.disroot.org ([178.21.23.139]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNCxg-0000om-Q5 for guile-devel@gnu.org; Mon, 16 Dec 2024 10:24:46 -0500 Original-Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id BDE4924FA1; Mon, 16 Dec 2024 16:24:43 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Original-Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 3kWUr1VACQ-B; Mon, 16 Dec 2024 16:24:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1734362679; bh=UaUm8+q98Xx1F4KdGpUFvKEQG8ltxmz3185JDPtLgnk=; h=Date:Subject:From:To:Cc:References:In-Reply-To; b=g8Ms6Np0mXOGkT7EJKYzFK9ION8n59mz6mfO52TaOnI9PERghExMJYdClxk7GRea2 +4KzmHqwR0sMe3AshZLFUjecxNG2W9y01+biB22mt6GkTMnGS3RKzMYR8/e8FXbf/s OVl5K7k9lwyJiaH9PFxB3KGDnP5DTuId2m4kKncaFrRqWnhU9x8YxnAd7aid7xnaAy JwIMuoZi5RjnWcVCP8qKKzt5WGUA/MWDF5DOfE/iIQ6mLWskl70Mtjg26xKYarJq/j FohZN/Ev/as27MI7wLxb4WXVI4dXGBBxBsGAjGhl4wjVDFRCocAbnCpMmMiCVHzC+x WFLbuTONerB0A== Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=178.21.23.139; envelope-from=adam.faiz@disroot.org; helo=layka.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22833 Archived-At: >From b271d059615571d0d50027758494b8dbb5e8625e Mon Sep 17 00:00:00 2001 From: AwesomeAdam54321 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