Date: Tue, 1 Jun 1999 11:39:45 +0200
From: Jerome Vouillon <Jerome.Vouillon@inria.fr>
To: Ubik <firstname.lastname@example.org>, email@example.com
Subject: Re: Events, method iterator
In-Reply-To: <firstname.lastname@example.org>; from Ubik on Sun, May 30, 1999 at 09:44:25PM +0200
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
> let paintObject x = x#paint
> class container = object
> inherit shape
> val mutable _objs:shape list = 
> method paint = List.iter paintObject _objs
> 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
This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:23 MET