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: Wed, 12 Feb 2014 11:16:43 -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:
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}
is kind of unwieldy.
I checked in a new 'pipe-process' macro. I updated the blog page
(search for the "Pipe-lines" section):
http://per.bothner.com/blog/2014/Kawa-shell-programming/
You might also find interesting the implementation: It's
my first macro/function combination where the "validate"
handler is written in Scheme. See kawa/lib/system.scm.
It's a little klunky, but not too bad.
--
--Per Bothner
per@bothner.com http://per.bothner.com/