guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filter IO through an external command


From: Thien-Thi Nguyen
Subject: Re: Filter IO through an external command
Date: Thu, 23 Feb 2012 18:16:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux)

() Tristan Colgate <address@hidden>
() Thu, 23 Feb 2012 14:26:28 +0000

   Comments very welcome:

     (let* ((read-pipe (pipe))
            (read-in  (car read-pipe))
            (read-out  (cdr read-pipe))

You might try SRFI 1 ‘car+cdr’ for this (and also for the write side)
in conjunction w/ SRFI 11 ‘let-values’, to improve code readability.

       (if (= child-pid 0)

You can use ‘zero?’ here.  Small nit: ‘child-pid’
as a variable name is misleading; better simply ‘pid’.

             (apply execlp (append (list cmd) (append (list cmd) args)))

This can be simplified to ‘(apply execlp cmd cmd args)’,
Also, i would add ‘(exit #f)’ afterwards, to appease Murphy.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]