From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Linus_Bj=C3=B6rnstam?= Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Extensions for SRFI-171 (Transducers) Date: Wed, 21 Dec 2022 11:00:24 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13493"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.7.0-alpha0-1185-g841157300a-fm-20221208.002-g84115730 To: "Colin Woodbury" , guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Dec 21 11:01:26 2022 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 1p7vud-0003Hk-U5 for guile-devel@m.gmane-mx.org; Wed, 21 Dec 2022 11:01:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7vuD-00050S-T2; Wed, 21 Dec 2022 05:00:57 -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 1p7vuB-000503-On for guile-devel@gnu.org; Wed, 21 Dec 2022 05:00:55 -0500 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7vu7-0005pU-QR for guile-devel@gnu.org; Wed, 21 Dec 2022 05:00:55 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 1BD203200938; Wed, 21 Dec 2022 05:00:45 -0500 (EST) Original-Received: from imap51 ([10.202.2.101]) by compute2.internal (MEProxy); Wed, 21 Dec 2022 05:00:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veryfast.biz; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1671616844; x= 1671703244; bh=Ub1kOo/zvBCA6KygSJC6D2XQHy3o0o0DdN/bFqKIF68=; b=R J5PMYY90zhCaIJUP8ATehtR9bgm9vexIhAXvo1v+aYxC/8F17HlxnclUPxPWMGjd G8DkDK6nVLdzJ1CCqS8XjcEAUGHzp+RYFdOrjAxFWIMdY442LXJOjJVuOZ9ai7vS 0/maYQrDtjVLMo8a1FFuCeU6gJ9hDjPRA9oy9+t6lH/dRvI/jnSBz1jcssc3m+d6 26P5M/v1uwHRij/ZKzYH8BLs+R6gAlQZUoYzospkWm5vJzhPDEIoJip/E+vM9l9x Lbaz/u4IUClwqlb47A22Q/INmQi3GD8Ew8Oy5y4txn9GF24sjshcu6KrwJ2wRnyc M4p0eJwQejGDYVy/fTKyQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1671616844; x=1671703244; bh=U b1kOo/zvBCA6KygSJC6D2XQHy3o0o0DdN/bFqKIF68=; b=uyQ2SlNQy1M+9CA7b byQTdcgjc8VUg9sy/iPEKfqkgkUdq5DRYKqOOKkvSuYzJemT4YsE7G6ktBY70weV sStDWhGTsfeBXj39DT1Be9GWLrqtVzZ0QzUgdkdz8Pp4SnrOSi/RoCBrqX/ez76/ ZT6syMYcvLtFTJep1jYYr4Wf6RGTmnryOYj9gxKlgM6zYeJArtW/OhmV0iVhtvhD SUexJD3egeh/8NT2nYpaNrbaPEuqqx8lXdUm5QTXOqVYLl7jP3fL36RAH6PtY+1/ klGKefrBnJhk2bZO7dBbLNka64L6q2TxOtJveCo7vH7ORFvLlGohDlUKS7g90Xe3 wH1Cg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgeekgdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepnfhinhhu shcuuehjnphrnhhsthgrmhcuoehlihhnuhhsrdgsjhhorhhnshhtrghmsehvvghrhihfrg hsthdrsghiiieqnecuggftrfgrthhtvghrnhepleefvefffffgkeeguddvhfdvleevleej hffgieejteekteejfefhffethfdtieefnecuvehluhhsthgvrhfuihiivgepudenucfrrg hrrghmpehmrghilhhfrhhomheplhhinhhushdrsghjohhrnhhsthgrmhesvhgvrhihfhgr shhtrdgsihii X-ME-Proxy: Feedback-ID: i51694465:Fastmail Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5EB08B60086; Wed, 21 Dec 2022 05:00:44 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: Received-SPF: pass client-ip=64.147.123.20; envelope-from=linus.bjornstam@veryfast.biz; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-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:21514 Archived-At: As the author of both the SRFI and the guile code I am very happy you li= ke it. I don't have a computer at the moment, but I looked through the c= ode and it looked great. All additions should have been included in the original SRFI :) one comment: your code uses define-public, which the rest of SRFI-171 co= de does not. I am not in any position to sign code off for inclusion in guile proper,= but if the define-public thing is fixed it very much has my blessing. Best regards=20 Linus Bj=C3=B6rnstam On Wed, 21 Dec 2022, at 01:48, Colin Woodbury wrote: > Happy holidays everyone, I hope everything is going well for you. > > Since discovering SRFI-171 (Transducers) I have fallen in love with it= .=20 > Transducers let me "talk the way I want to talk" while knowing that I'= m=20 > being efficient underneath w.r.t. to iteration and allocation. In usin= g=20 > Guile's implementation, I noticed a few common idioms missing that are=20 > otherwise present in other languages, so I've added them in a series o= f=20 > patches. I've been using these often for a number of weeks without=20 > issue, but of course have added unit tests as well. > > The full details are in the commit messages, but here are the main hig= hlights: > > * rfold: The fundamental reducer. This allows the user to turn any=20 > two-arg function into a valid reducer, so that they don't need to worr= y=20 > about hand-writing reducers via case-lambda.=20 > * rfind: Yields the first item in the transduction that matches some=20 > predicate. Nice for locating some specific value from a potentially=20 > large data source (e.g. a port).=20 > * twindow: Like tsegment, but yields overlapping slices into the data= .=20 > Cheers, and have a great holiday. > > Colin > > Attachments: > * 0001-srfi-171-add-twindow-and-various-reducers.patch > * 0002-doc-add-new-SRFI-171-reducers-to-the-manual.patch > * 0003-srfi-171-add-unit-tests-for-new-functions.patch