Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] extensible records?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Cannasse <warplayer@f...>
Subject: Re: [Caml-list] extensible records?
[...]
> I thought of using polymorphic variant types, but my (limited)
understanding
> is that you either declare all possible variants straight up in the .mli
file
> (which totally defeats my purpose) or you don't declare anything and let
the
> compiler infer the type (which I don't know how to write into a .mli
file).
> If this can be done with polymorphic variants, how would I do it?
> Alternatively, if this can be done with objects, how would I do it?  Or
> should I just stick with abusing exceptions?

There is a nice paper from Jacques Garrigue about extensions using
polymorphic variants.
"Code reuse through polymorphic variants. "
http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/papers/
That might be what you're loooking for.

Regards,
Nicolas Cannasse

-------------------
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