From: "Ludovic Courtès" <ludo@gnu.org>
To: Rutger van Beusekom <rutger.van.beusekom@verum.com>
Cc: Andy Wingo <wingo@igalia.com>, Guile Devel <guile-devel@gnu.org>
Subject: Re: guile pipeline do-over
Date: Thu, 26 Mar 2020 10:09:53 +0100 [thread overview]
Message-ID: <87pnczeb32.fsf@gnu.org> (raw)
In-Reply-To: <877dzsy84v.fsf@verum.com> (Rutger van Beusekom's message of "Tue, 10 Mar 2020 08:35:44 +0100")
Hi Rutger,
(+Cc: Andy.)
Rutger van Beusekom <rutger.van.beusekom@verum.com> skribis:
> From d351c0a5ecde62e63368bec0e1f15108495a1a71 Mon Sep 17 00:00:00 2001
> From: Rutger van Beusekom <rutger.van.beusekom@verum.com>
> 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 pair.
> (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’t be in 3.0.2, we’ll 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’m 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’s an extra space on these lines
> + (pipe-fail? (compose not
> + zero?
> + status:exit-val
> + cdr
> + waitpid)))
I don’t think we should encourage this style, which could also look
obscure to newcomers. I’d just make it a regular lambda.
That’s all for me.
Thanks again, Rutger!
Ludo’.
next prev parent reply other threads:[~2020-03-26 9:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 9:52 guile pipeline do-over Rutger van Beusekom
2020-03-07 15:46 ` Ludovic Courtès
2020-03-10 7:35 ` Rutger van Beusekom
2020-03-10 8:54 ` Linus Björnstam
2020-03-10 10:37 ` Rutger van Beusekom
2020-03-26 9:09 ` Ludovic Courtès [this message]
2020-04-04 8:01 ` Rutger van Beusekom
2020-05-16 20:38 ` Ludovic Courtès
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=87pnczeb32.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guile-devel@gnu.org \
--cc=rutger.van.beusekom@verum.com \
--cc=wingo@igalia.com \
/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).