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,MISSING_HEADERS 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 3E5FFBC0A for ; Mon, 21 May 2007 15:20:55 +0200 (CEST) Received: from kraid.nerim.net (smtp-101-monday.nerim.net [62.4.16.101]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4LDKsPA028557 for ; Mon, 21 May 2007 15:20:55 +0200 Received: from hector.lesours (ours.starynkevitch.net [213.41.244.95]) by kraid.nerim.net (Postfix) with ESMTP id E871C41092 for ; Mon, 21 May 2007 15:20:53 +0200 (CEST) Received: from glinka.lesours ([192.168.0.1] ident=basile) by hector.lesours with smtp (Exim 4.63) (envelope-from ) id 1Hq7on-0005w5-RF for caml-list@inria.fr; Mon, 21 May 2007 15:20:57 +0200 Date: Mon, 21 May 2007 15:21:16 +0200 From: Basile STARYNKEVITCH Cc: caml-list@inria.fr Subject: Re: [Caml-list] tail rec Message-Id: <20070521152116.70d642b0.basile@starynkevitch.net> In-Reply-To: <465198E5.3010004@SmokejumperIT.com> References: <1179543365.26755.33.camel@rosella.wigram> <4651973F.9010503@janestcapital.com> <465198E5.3010004@SmokejumperIT.com> X-Mailer: Sylpheed 2.4.2 (GTK+ 2.10.12; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 46519CB6.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; basile:01 basile:01 recursion:01 recursive:01 recursion:01 recursive:01 annotation:01 emacs:01 beginner's:01 experimented:01 ocaml:01 92340:01 reine:01 wrote:01 imho:01 On Mon, 21 May 2007 08:04:37 -0500 Robert Fischer wrote: > I'm with Brian on this, although it the "tailrec" specification needs to be optional. I use tail recursion by accident a lot when I'm coding > ("Oh, hey, I guess this is tail recursive. Nifty!"), and I would be really annoyed to have to think about whether my recursion is tail > recursive or not every time I use it. I'm repeating my suggestion: extend the typing annotation (produced by -dtypes) to flag every tail recursive call, and have the emacs mode and ocamlbrowser display every tail call particularily (e.g. in a different color or font). This don't require any additional language construct. And BTW, I'm not sure such thing will happen, because I am not sure that the Gallium team is interested in coding it :-) Also, tail recursion is IMHO a beginner's puzzle. I'm pretty sure every experimented Ocaml programmer does know inside his code what are his tail recursive calls. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Fa_encerie, 92340 Bourg La Reine, France *** opinions {are only mines, sont seulement les miennes} ***