self in classes

From: ξΙΛΟΜΑΚ γΙΠΑΞΟ (nicholas@post.tepkom.ru)
Date: Sat Feb 06 1999 - 15:09:54 MET


Date: Sat, 6 Feb 1999 17:09:54 +0300 (MSK)
From: =?KOI8-r?B?7snLz8zByiDjydDBzs/X?= <nicholas@post.tepkom.ru>
To: Caml list <caml-list@pauillac.inria.fr>
Subject: self in classes

Hi!
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
                .... ^^^^^^^^^^^^^^^^^^
end

class bar = object
        method register ob =
                (* add something *)
end

When i'm trying to write something like that ocamlc says me that
self canot escape of it's definition



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:19 MET