Browse thread
[Caml-list] Open types and methods
-
jmarant@n...
- Stefano Zacchiroli
-
Olivier Andrieu
- jmarant@n...
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | jmarant@n... |
| Subject: | Re: [Caml-list] Open types and methods |
Olivier Andrieu <andrieu@ijm.jussieu.fr> writes:
> Jérôme Marant [Sunday 3 November 2002] :
> >
> >
> > Hi,
> >
> > I know that I cannot use open types as method parameter types,
> > like:
> >
> > method foo (w : #mother) = ....
> >
> > So, how can I pass to a method an object of a given class or
> > of its inherited classes, i.e. how to work this limitation
> > around?
>
> Polymorphic methods ?
>
> method foo : 'a. (#mother as 'a) -> ... = fun w -> ...
I'll have a look at this. Thanks.
Cheers,
--
Jérôme Marant
http://marant.org
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners