This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Shell-style programming in Kawa
- From: Per Bothner <per at bothner dot com>
- To: Jamison Hope <jrh at theptrgroup dot com>
- Cc: "kawa at sourceware dot org list" <kawa at sourceware dot org>
- Date: Sat, 25 Jan 2014 00:34:53 -0800
- Subject: Re: Shell-style programming in Kawa
- Authentication-results: sourceware.org; auth=none
- References: <52C4B518 dot 5080000 at bothner dot com> <A72FB562-9459-4C69-B346-A6C94DBD22C4 at theptrgroup dot com>
On 01/22/2014 04:01 PM, Jamison Hope wrote:
Hi Per,
On Jan 1, 2014, at 7:38 PM, Per Bothner <per@bothner.com> wrote:
I checked in some semi-experimental code for Shell-style programming,
and specifically running processes. Please play with it and let me
know how it works. I have only tested it on Fedora Linux.
I did find a minor typo in the blog post:
Thanks - I fixed that in the source file.
However, the syntax can get awfully verbose, especially setting up
a pipeline with more than two stages.
$ a | b
becoming
&`[in: &`{a}]{b}
isn't too bad, but
$ a | b | c | d | e
becoming
&`[in: &`[in: &`[in: &`[in: &`{a}]{b}]{c}]{d}]{e}
How about:
(pipe-process &`{a} `&{b} &`{c} &`{d} &`{e})
where:
(pipe-process e0 (run-process . arg1) .... (run-process . argn))
is:
(let ((t0 e0)
(t1 (run-process in: t0 . arg1)
...
(tn (run-process in: tn-1 . argn))
tn)
(The actual temporary variables aren't really needed of course.)
--
--Per Bothner
per@bothner.com http://per.bothner.com/