Events, method iterator

From: Ubik (u009731@alpcom.it)
Date: Sun May 30 1999 - 21:44:25 MET DST


Date: Sun, 30 May 1999 21:44:25 +0200
From: Ubik <u009731@alpcom.it>
Subject: Events, method iterator
To: caml-list@inria.fr

Hi everybody. I premise:
1) I'm a neophyte about caml
2) I can't speak French, so my mails will be mono-lingual.

Now the questions :
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 ...
b) Is there a way to iterate a method upon a list of objects of some type ?
Suppose i have a hierarchy
    with many overridden methods, and that i use containers of base-type,
like this :
    class shape = object
        method virtual paint : unit
        ...
    end
    class circle = object
        inherit shape
        method paint = ...
        ...
    end
    ...
    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 ?

Thank you

Emiliano



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