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 KAA15033; Mon, 18 Jun 2001 10:57:29 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA14563 for caml-list@pauillac.inria.fr; Mon, 18 Jun 2001 10:57:28 +0200 (MET DST) 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 RAA05605 for ; Sun, 17 Jun 2001 17:34:44 +0200 (MET DST) Received: from dsf.net (adsl-63-196-84-93.dsl.sndg02.pacbell.net [63.196.84.93]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f5HFYhv06138 for ; Sun, 17 Jun 2001 17:34:43 +0200 (MET DST) Received: (from dsf@localhost) by dsf.net (8.11.2/8.11.2) id f5HFXaO03061; Sun, 17 Jun 2001 08:33:36 -0700 To: leary@nwlink.com Cc: caml Subject: Re: [Caml-list] Newbie: declarations References: <20010616170909.B10922@jean> From: David Fox Date: 17 Jun 2001 08:33:36 -0700 In-Reply-To: leary@nwlink.com's message of "Sat, 16 Jun 2001 17:09:09 -0700" Message-ID: X-Mailer: Gnus v5.7/Emacs 20.7 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk leary@nwlink.com writes: > Is there a way to declare a variable and not initialize it, like C? > > int i; > i = 0; > > More to the point, is there a way to declare a record variable without > listing/initializing all the fields? If yes, what are the default values? This is a problem I have run into when translating programs from non functional languages. My first pass solution is to create a reference to a dummy object: let dummy = {field1=0; field2=0...} let current = ref dummy ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr