From: David Fox <dsf@foxthompson.net>
To: leary@nwlink.com
Cc: caml <caml-list@inria.fr>
Subject: Re: [Caml-list] Newbie: declarations
Date: 17 Jun 2001 08:33:36 -0700 [thread overview]
Message-ID: <lun177m88f.fsf@dsf.net> (raw)
In-Reply-To: leary@nwlink.com's message of "Sat, 16 Jun 2001 17:09:09 -0700"
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
next prev parent reply other threads:[~2001-06-18 8:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-17 0:09 leary
2001-06-17 10:08 ` Vitaly Lugovsky
2001-06-18 2:19 ` leary
2001-06-18 15:18 ` Remi VANICAT
2001-06-18 20:19 ` [Caml-list] Good introduction for the working programmer in Objective CAML Mattias Waldau
2001-06-18 20:35 ` Miles Egan
2001-06-18 20:49 ` leary
2001-06-17 15:33 ` David Fox [this message]
2001-06-18 14:52 ` [Caml-list] Newbie: declarations FabienFleutot
2001-06-19 8:11 ` Frédéric van der Plancke
2001-06-19 10:22 ` Sven LUTHER
2001-06-19 12:25 ` Frank Atanassow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=lun177m88f.fsf@dsf.net \
--to=dsf@foxthompson.net \
--cc=caml-list@inria.fr \
--cc=leary@nwlink.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox