Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* about "new"
@ 1997-07-25  9:09 Pierre CASTERAN
  1997-07-25 10:02 ` Francois Pessaux
  1997-07-25 11:54 ` Didier Remy
  0 siblings, 2 replies; 3+ messages in thread
From: Pierre CASTERAN @ 1997-07-25  9:09 UTC (permalink / raw)
  To: caml-list

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 )





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-07-25 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-07-25  9:09 about "new" Pierre CASTERAN
1997-07-25 10:02 ` Francois Pessaux
1997-07-25 11:54 ` Didier Remy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox