Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
tail rec
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-05-21 (13:20)
From: Basile STARYNKEVITCH <basile@s...>
Subject: Re: [Caml-list] tail rec
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.

email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 
8, rue de la Fa_encerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***