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.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 19B07BC0A for ; Sat, 19 May 2007 16:47:02 +0200 (CEST) Received: from einhorn.in-berlin.de (einhorn.in-berlin.de [192.109.42.8]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4JEl1Ov015596 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sat, 19 May 2007 16:47:01 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from first (dslb-088-073-123-172.pools.arcor-ip.net [88.73.123.172]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id l4JEkw02017198 for ; Sat, 19 May 2007 16:46:59 +0200 Received: by first (Postfix, from userid 501) id 478B53B7DEA; Sat, 19 May 2007 16:46:52 +0200 (CEST) Date: Sat, 19 May 2007 16:46:51 +0200 From: Oliver Bandel To: caml-list@inria.fr Subject: Re: [Caml-list] tail rec Message-ID: <20070519144651.GD335@first.in-berlin.de> References: <1179543365.26755.33.camel@rosella.wigram> <20070519142827.GA335@first.in-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070519142827.GA335@first.in-berlin.de> User-Agent: Mutt/1.5.6i X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Miltered: at concorde with ID 464F0DE5.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bandel:01 in-berlin:01 0200,:01 bandel:01 compiler:01 camlp:01 wrote:01 wrote:01 imho:01 oliver:01 oliver:01 rec:01 rec:01 caml-list:01 tail:01 On Sat, May 19, 2007 at 04:28:27PM +0200, Oliver Bandel wrote: > On Sat, May 19, 2007 at 12:56:05PM +1000, skaller wrote: > > I have a silly idea. Introduce a new construction: > > > > let tailrec f .. > > > > This is the same as let rec except it checks every direct call to f > > is in tail position (and bombs out the compiler if not). > > > > [Maybe this can be done with camlp4, though I think it might > > be hard?] > > > > I think this could be useful for newbies learning functional > > programming, and perhaps even experts looking for performance > > issues. > [...] > > I think this is blocking understanding of how ressources > are allocated, when one uses a certain style of programming > and datastructures. Forget these words: I misunderstood your email, because I did not read until end before I answered. Sorry for the unnecessary traffic. I thought you want to automatically *convert* code to tailrec-code. Even if this would also be a fine thing, it could block understanding, as mentioned above. But you only want to have warnings... ...that might be a good helper. But it might also be annoying? Such warnings should be off per default, IMHO. Ciao, Oliver