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 RAA16807 for caml-redistribution; Tue, 1 Jun 1999 17:22:41 +0200 (MET DST) 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 LAA13201 for ; Tue, 1 Jun 1999 11:40:01 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id LAA08262; Tue, 1 Jun 1999 11:39:46 +0200 (MET DST) Received: (from vouillon@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA12349; Tue, 1 Jun 1999 11:39:45 +0200 (MET DST) Message-ID: <19990601113945.59920@pauillac.inria.fr> Date: Tue, 1 Jun 1999 11:39:45 +0200 From: Jerome Vouillon To: Ubik , caml-list@inria.fr Subject: Re: Events, method iterator References: <"Your <199905261207.OAA17846@tobago.inria.fr> <4.1.19990530212605.009311e0@email.alpcom.it> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 0.89.1 In-Reply-To: <4.1.19990530212605.009311e0@email.alpcom.it>; from Ubik on Sun, May 30, 1999 at 09:44:25PM +0200 Sender: weis On Sun, May 30, 1999 at 09:44:25PM +0200, Ubik wrote: > a) How can i get the value associated with an event (if an event actually > "carries" a value ...) ? > i tried to send out a function through an int->int->int channel, i > receive it from the other side with > an int->int->int event, but i can't apply it ... An event is something that may happen on a channel. You have to wait for it to get a value from the channel. You can either wait for one event using the function "Event.sync", wait for any of a list of events with "select" or check if an event has already happen with "poll". [...] > let paintObject x = x#paint > > class container = object > inherit shape > val mutable _objs:shape list = [] > method paint = List.iter paintObject _objs > ... > end > I have to define a function for every method to iterate, in this way ? > There's no way to define an > explicit function to send messages to objects ? Yes, you need to define a function each time. But you can do it inline : method paint = List.iter (fun x -> x#paint) _objs -- Jérôme