From: Francois Pessaux <pessaux@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 [thread overview]
Message-ID: <199806180740.JAA29703@mouton.inria.fr> (raw)
In-Reply-To: Your message of "Wed, 17 Jun 1998 15:17:58." <01BD9A03.1CEE4A80@FB>
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) *)
;;
prev parent reply other threads:[~1998-06-19 0:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-06-17 13:17 fbesnard
1998-06-18 2:05 ` Donald Syme
1998-06-22 8:51 ` per-line comments Xavier Leroy
1998-06-23 0:24 ` Pierre Weis
1998-06-18 6:40 ` Francois Pessaux [this message]
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=199806180740.JAA29703@mouton.inria.fr \
--to=pessaux@mouton.inria.fr \
--cc=caml-list@inria.fr \
--cc=fbesnard@ac-nice.fr \
/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