From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.lisp.guile.user Subject: Re: Filter IO through an external command Date: Thu, 23 Feb 2012 18:16:10 +0100 Message-ID: <87boopbhd1.fsf@gnuvola.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1330017459 6543 80.91.229.3 (23 Feb 2012 17:17:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 23 Feb 2012 17:17:39 +0000 (UTC) Cc: guile-user@gnu.org To: Tristan Colgate Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Feb 23 18:17:36 2012 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S0cIP-0004w6-GR for guile-user@m.gmane.org; Thu, 23 Feb 2012 18:17:33 +0100 Original-Received: from localhost ([::1]:57871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0cIO-00021e-Uo for guile-user@m.gmane.org; Thu, 23 Feb 2012 12:17:32 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:51201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0cIK-00021Y-4t for guile-user@gnu.org; Thu, 23 Feb 2012 12:17:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0cIF-0005E9-Th for guile-user@gnu.org; Thu, 23 Feb 2012 12:17:28 -0500 Original-Received: from smtp206.alice.it ([82.57.200.102]:42014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0cIF-0005BP-8o for guile-user@gnu.org; Thu, 23 Feb 2012 12:17:23 -0500 Original-Received: from ambire (95.244.65.190) by smtp206.alice.it (8.6.023.02) id 4F1836AD047DEA2F; Thu, 23 Feb 2012 18:17:02 +0100 Original-Received: from ttn by ambire with local (Exim 4.72) (envelope-from ) id 1S0cH5-0002fN-CN; Thu, 23 Feb 2012 18:16:11 +0100 In-Reply-To: (Tristan Colgate's message of "Thu, 23 Feb 2012 14:26:28 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.102 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:9301 Archived-At: () Tristan Colgate () 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 =E2=80=98car+cdr=E2=80=99 for this (and also for the w= rite side) in conjunction w/ SRFI 11 =E2=80=98let-values=E2=80=99, to improve code rea= dability. (if (=3D child-pid 0) You can use =E2=80=98zero?=E2=80=99 here. Small nit: =E2=80=98child-pid=E2= =80=99 as a variable name is misleading; better simply =E2=80=98pid=E2=80=99. (apply execlp (append (list cmd) (append (list cmd) args))) This can be simplified to =E2=80=98(apply execlp cmd cmd args)=E2=80=99, Also, i would add =E2=80=98(exit #f)=E2=80=99 afterwards, to appease Murphy.