Re: are initial values in class fields mandatory ? (ocaml)

From: Francois Pessaux (pessaux@mouton.inria.fr)
Date: Thu Jun 18 1998 - 08:40:55 MET DST


Message-Id: <199806180740.JAA29703@mouton.inria.fr>
To: fbesnard@ac-nice.fr, caml-list@inria.fr
Subject: Re: are initial values in class fields mandatory ? (ocaml)
Date: Thu, 18 Jun 1998 09:40:55 +0300
From: Francois Pessaux <pessaux@mouton.inria.fr>

Hello,

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

> 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 )
>
That the same problem than trying to create an int ref with no default value.
You can't and you don't want !

> other questions:
> - are documentations available in pdf (Acrobat Reader) format ?
No

> - there is no 'per line' comment (like Ada's "--" or C++'s "//" ) ?
No

-- 
(*                      Francois PESSAUX (Francois.Pessaux@inria.fr) *)
(*                               INRIA Rocquencourt - Projet CRISTAL *)
(*                               (http://pauillac.inria.fr/~pessaux) *)
;;



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