Version franηaise
Home     About     Download     Resources     Contact us    
Browse thread
self in classes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: ξΙΛΟΜΑΚ γΙΠΑΞΟΧ <nicholas@p...>
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