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 JAA06496; Sat, 1 May 2004 09:08:51 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA07671 for ; Sat, 1 May 2004 09:08:50 +0200 (MET DST) Received: from nexus.stwing.upenn.edu (NEXUS.STWING.UPENN.EDU [165.123.132.61]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i4178mSH011462 for ; Sat, 1 May 2004 09:08:49 +0200 Received: from force.stwing.upenn.edu (root@force.stwing.upenn.edu [165.123.132.65]) by nexus.stwing.upenn.edu (8.12.10/8.12.9) with ESMTP id i4178lqx004463 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 1 May 2004 03:08:47 -0400 (EDT) Received: from force.stwing.upenn.edu (wlovas@localhost [127.0.0.1]) by force.stwing.upenn.edu (8.12.10/8.12.9) with ESMTP id i4178k5p019994 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 1 May 2004 03:08:47 -0400 (EDT) Received: (from wlovas@localhost) by force.stwing.upenn.edu (8.12.10/8.12.9/Submit) id i4178kCd019993 for caml-list@inria.fr; Sat, 1 May 2004 03:08:46 -0400 (EDT) Date: Sat, 1 May 2004 03:08:45 -0400 From: William Lovas To: caml-list Subject: Re: [Caml-list] List.rev Message-ID: <20040501070844.GB19707@force.stwing.upenn.edu> Mail-Followup-To: caml-list References: <20040430175429.GB11118@online.fr> <4092A448.6080909@1969.ws> <1083376750.2581.183.camel@pelican.wigram> <1083388377.2581.383.camel@pelican.wigram> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1083388377.2581.383.camel@pelican.wigram> User-Agent: Mutt/1.5.4i X-Miltered: at concorde with ID 40934D00.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; lovas:01 wlovas:01 stwing:01 caml-list:01 2004:99 abnormally:01 behaviour:01 overflow:02 optimized:02 stack:02 stack:02 o'caml:02 wrote:03 allocate:03 recursive:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sat, May 01, 2004 at 03:12:57PM +1000, skaller wrote: > The term has no meaning without exhibiting implementation > code, and it is usual for libraries to quite pointedly > NOT do that: instead the behaviour is specified in > terms of input and output of the function, and also > side effects in terms of time and storage requirements > are sometimes thrown in for more detail. In many functional languages, O'Caml included, it's assumed that tail calls are optimized to jumps, so that tail recursive functions do not allocate any stack space for each recursive call. (I believe in Scheme this is even included in the language specification.) With that in mind, you can read "This function is not tail recursive" as a behavioral specification, "This function might terminate abnormally due to stack overflow" -- and that's a useful side effect to document. William ------------------- 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