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 TAA26643; Wed, 7 Apr 2004 19:46:24 +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 TAA26744 for ; Wed, 7 Apr 2004 19:46:23 +0200 (MET DST) Received: from qrnik.knm.org.pl (paf87.warszawa.sdi.tpnet.pl [217.96.225.87]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i37HkKYM027918 for ; Wed, 7 Apr 2004 19:46:22 +0200 Received: from qrnik ([192.168.0.1] ident=qrczak) by qrnik.knm.org.pl with esmtp (Exim 3.36 #1) id 1BBH80-0002US-00 for caml-list@inria.fr; Wed, 07 Apr 2004 19:46:20 +0200 Subject: Re: [Caml-list] Function forward declaration? From: "Marcin 'Qrczak' Kowalczyk" To: caml-list@inria.fr In-Reply-To: <20040407172648.GA12511@bourg.inria.fr> References: <60532B15DF92FD4693AA89B2F7E01D8F013F29EC@tmex02> <00cf01c41bd6$391b53a0$0203a8c0@hoedic> <20040406175320.GA19840@redhat.com> <1081279717.16531.6.camel@qrnik> <002901c41c65$b53e4c50$19b0e152@warp> <1081345936.19232.579.camel@pelican> <20040407141519.GA6618@redhat.com> <20040407172648.GA12511@bourg.inria.fr> Content-Type: text/plain; charset=iso-8859-13 Message-Id: <1081359979.20356.37.camel@qrnik> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.5.6 Date: Wed, 07 Apr 2004 19:46:20 +0200 Content-Transfer-Encoding: quoted-printable X-Miltered: at concorde 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 basile:01 analogous:01 marcin:01 kowalczyk:01 qrczak:01 compiler:01 bindings:01 ocaml:01 mutable:01 mutable:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 101 W li=FAcie z =FAro, 07-04-2004, godz. 19:26 +0200, Basile Starynkevitch napisa=F9: > Regarding this thread, a useful trick (somehow a hack, but used in the > compiler itself) is to declare a reference to a function initialised > to a function throwing an exception: It's a pity that using such a reference requires explicit "!"=B7 IMHO it would be nice if OCaml had mutable bindings, using the syntax analogous to mutable record fields. let mutable r =3D 0 in ... r <- r + 1 ... would be equivalent to let r =3D ref 0 in ... r :=3D !r + 1 ... --=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