From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA13205; Tue, 13 Jul 2004 09:20:43 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA12816 for ; Tue, 13 Jul 2004 09:20:42 +0200 (MET DST) Received: from yquem.inria.fr (yquem.inria.fr [128.93.8.37]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6D7KfEV029368; Tue, 13 Jul 2004 09:20:41 +0200 Received: by yquem.inria.fr (Postfix, from userid 18180) id 39854BBD8; Tue, 13 Jul 2004 09:20:41 +0200 (CEST) Date: Tue, 13 Jul 2004 09:20:41 +0200 From: Xavier Leroy To: skaller Cc: caml-list@inria.fr Subject: Re: Tail calls (Was Re: [Caml-list] Does Caml have slow arithmetics ?) Message-ID: <20040713072041.GA28848@yquem.inria.fr> References: <20040707145803.GB27498@yquem.inria.fr> <1089227778.29648.81.camel@pelican.wigram> <20040708034455.GB29942@davidb.org> <40ED190E.3080005@ps.uni-sb.de> <20040708140408.GA2386@davidb.org> <20040708163653.A1260@beaune.inria.fr> <20040712170738.GA3699@yquem.inria.fr> <1089666807.29648.381.camel@pelican.wigram> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1089666807.29648.381.camel@pelican.wigram> User-Agent: Mutt/1.3.28i X-Miltered: at nez-perce with ID 40F38D49.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 arithmetics:01 -inline:01 inlining:01 inlining:01 tail-call:01 optimised:01 tail-call:01 caml:01 rec:01 inline:03 tail:03 tail:03 let:04 let:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > 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