This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Shell-style programming in Kawa


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]