Browse thread
OO programming
[
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: | 2008-03-03 (10:35) |
From: | Tiphaine.Turpin <Tiphaine.Turpin@f...> |
Subject: | Re: [Caml-list] OO programming |
Jacques Garrigue a écrit : > From: "Tiphaine.Turpin" <Tiphaine.Turpin@free.fr> > > >> I don't know if there is an equivalent to inherit for >> polymorphic variants: "type t' = private [> t | ...] doesn't seem to >> work. And using objects to encode variants is possible, but you may be >> used to more serious solutions... >> > > It's actually simple with polymorphic variants than with objects. > You just write > type t' = private [> t ] > but t has to be a non-private polymorphic variant type. > So you have to maintain a hierarchy of non-private types, to be > able to build your private types. This should be already apparent in > my code for event. > Yes, indeed. So, no need for another bad hack :-). > Jacques > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >