From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 8B60CBC32 for ; Wed, 16 Mar 2005 02:38:59 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j2G1cxbA030849 for ; Wed, 16 Mar 2005 02:38:59 +0100 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 CAA31310 for ; Wed, 16 Mar 2005 02:38:58 +0100 (MET) Received: from tomts20-srv.bellnexxia.net (tomts20.bellnexxia.net [209.226.175.74]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j2G1cvNd008523 for ; Wed, 16 Mar 2005 02:38:58 +0100 Received: from ZENO.hamann.ca ([65.93.210.62]) by tomts20-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050316013856.SSZH2034.tomts20-srv.bellnexxia.net@ZENO.hamann.ca> for ; Tue, 15 Mar 2005 20:38:56 -0500 Message-Id: <5.2.0.9.2.20050315203859.02a28190@mail.berlove.com> X-Sender: gmh@berlove.com@mail.berlove.com (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Tue, 15 Mar 2005 20:39:05 -0500 To: caml-list@inria.fr From: Marc Hamann Subject: Re:Tail Calls Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Miltered: at concorde with ID 42378E33.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42378E31.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; compiler:01 tail:01 expressions:03 side-effects:04 wrong:08 function:08 returns:11 some:12 case:13 sequence:13 would:17 would:17 don't:18 don't:18 two:18 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: >I don't understand why the compiler don't do himself those transformations. >Why is it so hard to take a non-tail-recursive-function and make it a >tail-recursive-one ? Because in the general case that would change the intent of the program. Imagine if you have a sequence of two expressions with side-effects, or with significant order (e.g. consing a value to a function that returns a list). Changing the order automatically would have the wrong effect. Boy, some people want computers to do ALL our thinking. ;-) Marc