From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 08797BC69 for ; Thu, 23 Aug 2007 01:26:55 +0200 (CEST) Received: from tenhost.net (tenhost.net [64.246.28.52]) by discorde.inria.fr (8.13.6/8.13.6) with SMTP id l7MNQqIC021149 for ; Thu, 23 Aug 2007 01:26:54 +0200 Received: (qmail 17477 invoked by uid 502); 22 Aug 2007 17:52:48 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 22 Aug 2007 17:52:48 -0500 Date: Wed, 22 Aug 2007 17:52:48 -0500 (CDT) From: Dave Benjamin X-X-Sender: ramen@tenhost.net To: Eric Cooper Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] commands.getoutput () in ocaml? In-Reply-To: <20070822230418.GC10505@stratocaster.home> Message-ID: References: <28fa90930708221256t497e8356k84861abd6b2e91b8@mail.gmail.com> <95513600708221535t7508e900h192554da73d37fcf@mail.gmail.com> <20070822230418.GC10505@stratocaster.home> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at discorde with ID 46CCC63C.007 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 0200,:01 andrieu:01 buffer:01 buffer:01 2007,:98 23,:98 wrote:01 wrote:01 caml-list:01 benjamin:01 strings:01 string:02 string:02 let:03 On Wed, 22 Aug 2007, Eric Cooper wrote: > On Thu, Aug 23, 2007 at 12:35:14AM +0200, Olivier Andrieu wrote: >> you could use Buffer.add_substring instead of add_string, that will >> avoid an intermediate copy of the string > > And you can use Buffer.add_channel to avoid intermediate strings > altogether (until the final Buffer.to_string). Thanks, guys! I really appreciate the feedback, and will make these suggested improvements (though it may take awhile to show up on the site). If you find any other mistakes, please let me know. Dave