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 JAA16727; Wed, 7 Apr 2004 09:31:37 +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 JAA16732 for ; Wed, 7 Apr 2004 09:31:36 +0200 (MET DST) Received: from qrnik.knm.org.pl (paf87.warszawa.sdi.tpnet.pl [217.96.225.87]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i377WPjq028593 for ; Wed, 7 Apr 2004 09:32:28 +0200 Received: from qrnik ([192.168.0.1] ident=qrczak) by qrnik.knm.org.pl with esmtp (Exim 3.36 #1) id 1BB7X2-0005a7-00 for caml-list@inria.fr; Wed, 07 Apr 2004 09:31:32 +0200 Subject: Re: [Caml-list] Function forward declaration? From: "Marcin 'Qrczak' Kowalczyk" To: caml-list@inria.fr In-Reply-To: <002901c41c65$b53e4c50$19b0e152@warp> References: <60532B15DF92FD4693AA89B2F7E01D8F013F29EC@tmex02> <00cf01c41bd6$391b53a0$0203a8c0@hoedic> <20040406175320.GA19840@redhat.com> <1081279717.16531.6.camel@qrnik> <002901c41c65$b53e4c50$19b0e152@warp> Content-Type: text/plain; charset=ISO-8859-2 Message-Id: <1081323092.20354.8.camel@qrnik> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.5.6 Date: Wed, 07 Apr 2004 09:31:32 +0200 Content-Transfer-Encoding: quoted-printable X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 marcin:01 'qrczak':01 kowalczyk:01 qrczak:01 cannasse:01 val:01 runtime:01 runtime:01 avoided:01 recursion:01 marcin:01 kowalczyk:01 qrczak:01 nicolas:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 87 W li=B6cie z =B6ro, 07-04-2004, godz. 08:01 +0200, Nicolas Cannasse napisa= =B3: > > val g : unit -> int > > let f () =3D g () > > let x =3D f () > > let y =3D x + 1 > > let g () =3D y >=20 > What about "compilation error : recursive calls in forward declaration" ? At which point? What are the correctness criteria in general? For forward declarations to be useful, they would need to give something more than let rec. But I don't see a safe subset which is larger than let rec and doesn't need runtime checking. (In my language something like the above is legal, even without a forward declaration. Using g from f does a runtime check that the definition of g has been already executed. The check is avoided in cases it's easy to be proven unnecessary, e.g. with mutual recursion between successive function definitions.) --=20 __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ ------------------- 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