Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: Tail calls (Was Re: [Caml-list] Does Caml have slow arithmetics ?)
> 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?

Yes.  Tail-call elimination is performed after inlining.

- Xavier Leroy

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners