From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id CAA12145 for caml-redistribution; Fri, 19 Jun 1998 02:29:25 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA01886 for ; Thu, 18 Jun 1998 09:40:58 +0200 (MET DST) Received: from mouton.inria.fr (mouton.inria.fr [128.93.11.37]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id JAA17926; Thu, 18 Jun 1998 09:40:56 +0200 (MET DST) Received: from mouton.inria.fr (pessaux@localhost.inria.fr [127.0.0.1]) by mouton.inria.fr (8.8.7/8.6.6) with ESMTP id JAA29703; Thu, 18 Jun 1998 09:40:55 +0200 Message-Id: <199806180740.JAA29703@mouton.inria.fr> X-Mailer: exmh version 2.0zeta 7/24/97 To: fbesnard@ac-nice.fr, caml-list@inria.fr Subject: Re: are initial values in class fields mandatory ? (ocaml) In-reply-to: Your message of "Wed, 17 Jun 1998 15:17:58." <01BD9A03.1CEE4A80@FB> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 18 Jun 1998 09:40:55 +0300 From: Francois Pessaux Sender: weis 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) *) ;;