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
[Caml-list] Does Caml have slow arithmetics ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-07-12 (21:13)
From: skaller <skaller@u...>
Subject: Re: Tail calls (Was Re: [Caml-list] Does Caml have slow arithmetics ?)
On Tue, 2004-07-13 at 03:07, Xavier Leroy wrote:

> 2- When the function being tail-called is the current function
>    (tail recursion).
> 3- When the function being tail-called has no more than N arguments,
>    keeping in mind that a function with free variables has one extra
>    hidden argument representing its environment.

> Proper elimination of tail calls in ocamlopt in all cases is feasible
> but requires a bit of work.

Can you comment on the effect of -inline switch and inlining in general?

If you have 

let rec f a1 a2 a3 a4 ... = 
  let g b1 b2 ... = f b2 b2 ... in
  g a1 a2 ...

we have situation where the tail call in g isn't to g
but to its parent f .. however this is an obvious candidate
for inlining, and if we inline g into the body of f,
then the tail call is to f, which is itself, which might
then be tail-call optimised .. yes?

John Skaller,
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: