Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Pierre CASTERAN <Pierre.Casteran@labri.u-bordeaux.fr>
To: caml-list@inria.fr
Subject: about "new"
Date: Fri, 25 Jul 1997 11:09:04 +0200	[thread overview]
Message-ID: <33D86D30.5889@labri.u-bordeaux.fr> (raw)

Hello,

 I'm a beginner in Objective Caml, but not in ML; my question is about
object building :
 Is there any way to define a class with some initializing function,
 which is to be called each time an instance is created by a "new" ;
 the interest would be of course to create a "consistent" state for
 a newly created object.

 Similarly, is it possible to attach a function to a class, which
 would be called before the creation of an instance ? it would be
 useful to check some preconditions to the creation of an instance.
 we can imagine that, if that function returns false, an exception
 is raised and the instance is not created.

 

-- 
Pierre Casteran,

LaBRI, Universite Bordeaux-I      |    12 place Puy Paulin
351 Cours de la Liberation        |    33000 Bordeaux
F-33405 TALENCE Cedex             |    France
France                            |    (+ 33) 5 56 81 15 80
tel : (+ 33) 5 56 84 69 31
fax : (+ 33) 5 56 84 66 69
email: casteran@labri.u-bordeaux.fr       
www: http://dept-info.labri.u-bordeaux.fr/~casteran

"Les rêves sont aussi beaux que la réalité, mais ils ne sont pas mieux".
( J.L.Borges )





             reply	other threads:[~1997-07-25  9:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-25  9:09 Pierre CASTERAN [this message]
1997-07-25 10:02 ` Francois Pessaux
1997-07-25 11:54 ` Didier Remy

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=33D86D30.5889@labri.u-bordeaux.fr \
    --to=pierre.casteran@labri.u-bordeaux.fr \
    --cc=caml-list@inria.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