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 PAA15574 for caml-redistribution; Mon, 8 Feb 1999 15:18:24 +0100 (MET) 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 LAA01039 for ; Mon, 8 Feb 1999 11:32:35 +0100 (MET) Received: from morgon.inria.fr (morgon.inria.fr [128.93.8.33]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id LAA14613; Mon, 8 Feb 1999 11:32:34 +0100 (MET) Received: (from remy@localhost) by morgon.inria.fr (8.8.7/8.8.7) id LAA05094; Mon, 8 Feb 1999 11:34:42 +0100 Message-ID: <19990208113442.38523@morgon.inria.fr> Date: Mon, 8 Feb 1999 11:34:42 +0100 From: Didier Remy To: =?iso-8859-1?Q?=EE=C9=CB=CF=CC=C1=CA_=E3=C9=D0=C1=CE=CF=D7?= Cc: Caml list Subject: Re: self in classes Reply-To: Didier.Remy@inria.fr References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.85e In-Reply-To: =?iso-8859-1?Q?=3CPine.LNX.4.03.9901151302590.11682-100000=40p?= =?iso-8859-1?Q?ost.tepkom.ru=3E=3B_from_=EE=C9=CB=CF=CC=C1=CA_=E3=C9?= =?iso-8859-1?Q?=D0=C1=CE=CF=D7_on_Sat=2C_Feb_06=2C_1999_at_05=3A09=3A54P?= =?iso-8859-1?Q?M_+0300?= Organization: INRIA, BP 105, F-78153 Le Chesnay Cedex Phone: (33) 1 3963 5317 -- Sec: (33) 1 3963 5570 -- Fax: (33) 1 3963 5684 Web: http://cristal.inria.fr/~remy Sender: weis > Are there any ways to call the methods of other objects with self as an > argument ? > I mean situation like that: > class foo = object (self) > val observers : bar list = [] > method register = > Array.iter (function o -> o#register self ) observers > .... ^^^^^^^^^^^^^^^^^^ There is a similar example (the subject/observer pattern) in the advanced tutorial http://caml.inria.fr/ocaml/htmlman/node5.html -Didier