From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Newsgroups: gmane.lisp.guile.devel Subject: Re: guile pipeline do-over Date: Thu, 26 Mar 2020 10:09:53 +0100 Message-ID: <87pnczeb32.fsf@gnu.org> References: <8736al24jt.fsf@verum.com> <87imjgi2vs.fsf@gnu.org> <877dzsy84v.fsf@verum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="76809"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: Andy Wingo , Guile Devel To: Rutger van Beusekom Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Thu Mar 26 10:10:12 2020 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 1jHOWh-000Jrx-OZ for guile-devel@m.gmane-mx.org; Thu, 26 Mar 2020 10:10:11 +0100 Original-Received: from localhost ([::1]:48260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHOWg-0003aj-CM for guile-devel@m.gmane-mx.org; Thu, 26 Mar 2020 05:10:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43321) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHOWV-0003aZ-MY for guile-devel@gnu.org; Thu, 26 Mar 2020 05:10:00 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jHOWS-00064y-KR; Thu, 26 Mar 2020 05:09:56 -0400 Original-Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36224 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jHOWS-00080z-5J; Thu, 26 Mar 2020 05:09:56 -0400 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 Germinal an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu In-Reply-To: <877dzsy84v.fsf@verum.com> (Rutger van Beusekom's message of "Tue, 10 Mar 2020 08:35:44 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.lisp.guile.devel:20470 Archived-At: Hi Rutger, (+Cc: Andy.) Rutger van Beusekom skribis: > From d351c0a5ecde62e63368bec0e1f15108495a1a71 Mon Sep 17 00:00:00 2001 > From: Rutger van Beusekom > Date: Mon, 2 Mar 2020 10:38:57 +0100 > Subject: [PATCH] Add pipeline procedure. > > * libguile/posix.c (scm_open_process): Remove. > (scm_piped_process): Add to replace open_process. > * module/ice-9/popen.scm (pipe->fdes): Add to convert pipe pair to fdes p= air. > (open-process): Add open-process for backwards compatibility. > (pipeline): Add to implement a pipeline using piped-process. There are a couple super minor issues that I comment on below, but otherwise LGTM! If Andy agrees, we can apply it once the copyright assignment is on file, so maybe it won=E2=80=99t be in 3.0.2, we=E2=80=99ll= see! > +@deffn (Scheme Procedure) pipeline commands ^ ^ Should be braces. > +Execute a @code{pipeline} of @var{commands} -- where each command is a > +list of a program and its arguments as strings -- returning an input s/--/---/ so we get an em dash and not an en dash (I=E2=80=99m a typography nitpicker :-)). > +port to the end of the pipeline, an output port to the beginning of the > +pipeline and a list of PIDs of the processes executing the @var{commands= }. > + > +@example > +(let ((commands '(("git" "ls-files") > + ("tar" "-cf-" "-T-") > + ("sha1sum" "-"))) ^ There=E2=80=99s an extra space on these lines > + (pipe-fail? (compose not > + zero? > + status:exit-val > + cdr > + waitpid))) I don=E2=80=99t think we should encourage this style, which could also look obscure to newcomers. I=E2=80=99d just make it a regular lambda. That=E2=80=99s all for me. Thanks again, Rutger! Ludo=E2=80=99.