From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id FAA03015; Thu, 8 Jul 2004 05:45:31 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id FAA02853 for ; Thu, 8 Jul 2004 05:45:30 +0200 (MET DST) Received: from mail.davidb.org (adsl-64-172-240-129.dsl.sndg02.pacbell.net [64.172.240.129]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i683jSEV021038; Thu, 8 Jul 2004 05:45:29 +0200 Received: from davidb by mail.davidb.org with local (Exim 3.36 #1 (Debian)) id 1BiPqB-0007oe-00; Wed, 07 Jul 2004 20:44:55 -0700 Date: Wed, 7 Jul 2004 20:44:55 -0700 From: David Brown To: skaller Cc: Xavier Leroy , caml-list Subject: Re: [Caml-list] Does Caml have slow arithmetics ? Message-ID: <20040708034455.GB29942@davidb.org> References: <20040707091308.GA26172@bourg.inria.fr> <20040707145803.GB27498@yquem.inria.fr> <1089227778.29648.81.camel@pelican.wigram> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1089227778.29648.81.camel@pelican.wigram> User-Agent: Mutt/1.5.4i X-Miltered: at nez-perce with ID 40ECC358.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 caml-list:01 arithmetics:01 2004:99 2004:99 tail-rec:01 recursion:01 implemented:01 gcc:01 caml:01 dave:03 wrote:03 wrote:03 tail:03 08,:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, Jul 08, 2004 at 05:16:19AM +1000, skaller wrote: > On Thu, 2004-07-08 at 00:58, Xavier Leroy wrote: > > > On the other hand, reducing inefficiencies already present in the > > source code isn't a priority. > > Of course that argument fails totally in one important > case -- Q: if you wanted a loop why didn't you use one? > A: tail-rec functional code is considered cute :) In some functional languages (Scheme, specifically), tail recursion is required to be implemented iteratively. It is a common enough idiom, and easy enough to implement, that it is generally done in functional languages. In fact, gcc does it in C, with enough optimization. Dave ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners