Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Newbie: declarations
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-06-18 (08:57)
From: David Fox <dsf@f...>
Subject: Re: [Caml-list] Newbie: declarations 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:  FAQ:
To unsubscribe, mail  Archives: