Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jerome Vouillon <Jerome.Vouillon@inria.fr>
To: Ubik <u009731@alpcom.it>, caml-list@inria.fr
Subject: Re: Events, method iterator
Date: Tue, 1 Jun 1999 11:39:45 +0200	[thread overview]
Message-ID: <19990601113945.59920@pauillac.inria.fr> (raw)
In-Reply-To: <4.1.19990530212605.009311e0@email.alpcom.it>; 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
"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




  reply	other threads:[~1999-06-01 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-26 12:07 Random.int on non unix platform Damien Doligez
1999-06-28 22:35 ` Martin Quinson
1999-05-30 19:44   ` Events, method iterator Ubik
1999-06-01  9:39     ` Jerome Vouillon [this message]
     [not found] <4.1.19990531191134.00939130@email.alpcom.it>
1999-05-31 20:17 ` Markus Mottl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19990601113945.59920@pauillac.inria.fr \
    --to=jerome.vouillon@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=u009731@alpcom.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox