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=1.5 required=5.0 tests=AWL,HTML_10_20,HTML_MESSAGE, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 6BE2CBC6E for ; Tue, 2 Oct 2007 00:29:12 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CALkQAUfRVZK1mGdsb2JhbACCOjeLQQICBwQEERg X-IronPort-AV: E=Sophos;i="4.21,218,1188770400"; d="scan'208";a="17162315" Received: from discorde.inria.fr ([192.93.2.38]) by mail4-smtp-sop.national.inria.fr with ESMTP; 02 Oct 2007 00:29:12 +0200 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l91MT9Ae009131 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 2 Oct 2007 00:29:11 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CALkQAUfRVZK1mGdsb2JhbACCOjeLQQICBwQEERg X-IronPort-AV: E=Sophos;i="4.21,218,1188770400"; d="scan'208";a="17162309" Received: from wa-out-1112.google.com ([209.85.146.181]) by mail4-smtp-sop.national.inria.fr with ESMTP; 02 Oct 2007 00:29:11 +0200 Received: by wa-out-1112.google.com with SMTP id m34so5486812wag for ; Mon, 01 Oct 2007 15:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=VIxg7ZZc8BDIN2WGBOBL0JCcjAbhoHEw0v+I71NWbaY=; b=HucUtc0VX7X/y6MALpM2Hb5pbRBdKJ2iKvSOB0N88HBOhgFS2GQ7UHS2dOZiKgpxwILtPcYyyQRSC5HK26XlGmu9DMsH6mM2IrMhuENIe6bEeGIKmq9nEr9T1BnYasbipJnUkC9rGyAceY/ybxd/aWeI5Gnv7MGK/6y5q1+PFp4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=MAEOcswTWcr/RHfXDFT9jZ+Iq2HYTct8DI4QoNeP1Zt5BQJs6z8GazmQJMHsqde6z5pRihiYxK4AXnK4YRvy3PgybVZmebmmZUiLbp1gvzwa5Fnd8cFjZaUOLRrWLjfy9aI8Qd8jaqZT7mY6RUIKRNewHpfoX0suFcoh+rnSA8g= Received: by 10.115.90.1 with SMTP id s1mr290946wal.1191277749700; Mon, 01 Oct 2007 15:29:09 -0700 (PDT) Received: by 10.115.54.5 with HTTP; Mon, 1 Oct 2007 15:29:09 -0700 (PDT) Message-ID: <779bf2730710011529o74c08c2ah2fcfb086687b796b@mail.gmail.com> Date: Mon, 1 Oct 2007 15:29:09 -0700 From: YC To: "=?ISO-8859-1?Q?Daniel_B=FCnzli?=" Subject: Re: [Caml-list] best and fastest way to read lines from a file? Cc: "caml-list List" In-Reply-To: <2045B477-66BF-4A22-912F-DFB5E6D30570@epfl.ch> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_10951_20625885.1191277749692" References: <779bf2730710011427g5983da4cw6ad8b715a9e38771@mail.gmail.com> <2045B477-66BF-4A22-912F-DFB5E6D30570@epfl.ch> X-Miltered: at discorde with ID 470174B5.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; recursive:01 recursive:01 exception:01 exception:01 caml-list:01 tail:01 tail:01 handler:03 handler:03 pattern:04 pattern:04 correction:05 correction:05 function:08 function:08 ------=_Part_10951_20625885.1191277749692 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks to everyone replied - your answers are extremely helpful. > Your function is not tail recursive. A function is tail-recursive if > there is nothing to do after the recursive call. You might believe > this is the case in your function, but it is not the case because of > the exception handler. Try this instead : I did wonder whether my function was tail recursive but thought maybe it is. Thanks for the correction from everyone on this point. And the pattern of returning Some or None makes sense to me now. Rerun the test makes me feel better ;) Thanks, yc ------=_Part_10951_20625885.1191277749692 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks to everyone replied - your answers are extremely helpful.

> Your function is not tail recursive. A function is tail-recursive if
> there is nothing to do after the recursive call. You might believe
> this is the case in your function, but it is not the case because of
> the exception handler. Try this instead :


I did wonder whether my function was tail recursive but thought maybe it is.  Thanks for the correction from everyone on this point.  And the pattern of returning Some or None makes sense to me now.  Rerun the test makes me feel better ;)

Thanks,
yc

------=_Part_10951_20625885.1191277749692--