are initial values in class fields mandatory ? (ocaml)

From: fbesnard (fbesnard@ac-nice.fr)
Date: Wed Jun 17 1998 - 19:17:58 MET DST


From: fbesnard <fbesnard@ac-nice.fr>
To: "'caml-list@inria.fr'" <caml-list@inria.fr>
Subject: are initial values in class fields mandatory ? (ocaml)
Date: Wed, 17 Jun 1998 15:17:58 +-200

I'd like to define a class in Ocaml without giving intial values to its fields. Is it possible ?

For example, as far as I've seen, a class with a int and an int list fields would look like this:

class dummy () =
        val mutable v = 0
        val mutable l = ([] : int list)
end;;

but what about a field of type t, for which there is no default value ?
i.e.

        val mutable v = ( ??? : t )

other questions:
- are documentations available in pdf (Acrobat Reader) format ?
- there is no 'per line' comment (like Ada's "--" or C++'s "//" ) ?



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:14 MET