From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hartwig Newsgroups: gmane.lisp.guile.user Subject: Re: A better way to run shell cmd? Date: Wed, 13 Jun 2012 18:12:52 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1339582391 15596 80.91.229.3 (13 Jun 2012 10:13:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jun 2012 10:13:11 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Jun 13 12:13:07 2012 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SekZW-0001Gq-Gs for guile-user@m.gmane.org; Wed, 13 Jun 2012 12:13:06 +0200 Original-Received: from localhost ([::1]:36235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SekZW-0008FG-9H for guile-user@m.gmane.org; Wed, 13 Jun 2012 06:13:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SekZM-00088Q-Nw for guile-user@gnu.org; Wed, 13 Jun 2012 06:13:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SekZK-0005JA-RE for guile-user@gnu.org; Wed, 13 Jun 2012 06:12:56 -0400 Original-Received: from mail-gg0-f169.google.com ([209.85.161.169]:56058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SekZK-0005Iu-JU for guile-user@gnu.org; Wed, 13 Jun 2012 06:12:54 -0400 Original-Received: by ggm4 with SMTP id 4so300396ggm.0 for ; Wed, 13 Jun 2012 03:12:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=hFZ/iYtCzPSvfzop9lnaWaduo448ozAlDROym89rTX0=; b=hMOuZcoA7MW0zEQychlcge5JkfO8CdLoMQjBjDAThr9e06aA8m3M7aiaCznGnZN31Y 7Bvs/33vBdmrJXX6Q4ZDR4m2atHdmNpqKoH2OLytu803f31z3rL6iwHujKy3Lwet8+LQ WUZgVqRJiCQug/8yxUePekGqUcLGC+zO2euaP+4ksIPSfVqZyO9g9SujFFAFn/1KQ6NO OeZOBqQKDROujxoX1yckzV6mGaSndJzHO4WbcBGeacrA+AMUjJ0RVD7qWmEl6G0xCNSO TWJ7asXfiuVAzgpkygOGL8xQSPRL39QJDAIGE8vb5XW2GUdX53z1DFbGoUOonp9TBDqG qMNA== Original-Received: by 10.50.11.202 with SMTP id s10mr6300421igb.4.1339582372508; Wed, 13 Jun 2012 03:12:52 -0700 (PDT) Original-Received: by 10.231.206.198 with HTTP; Wed, 13 Jun 2012 03:12:52 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.161.169 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:9502 Archived-At: On 13 June 2012 18:02, Nala Ginrut wrote: > hi Daniel, thanks for reply! > I tried guile-lib just now, it's nice. I'll use it. Yes, guile-lib has lots of great code in it. :-) > > Besides, do you think pipe is the proper way to implement "sed" function? > Or it's better to implement a module with pure Guile? This depends on how often you use it, and on how much data. On the one hand, sed is very powerful, already written, and works well. On the other hand, opening the pipe has some overhead, but you won't notice this unless you are processing lots of very short strings individually. The main thing I have used pipes for is compressing data. This is done once per file, and the files are relatively large. In this case the overhead for creating each pipe is tiny, much less than writing and debugging my own version of gzip in Scheme. Regards