English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2004-02-27 (08:40)
From: Nicolas Cannasse <warplayer@f...>
Subject: Re: [Caml-list] extensible records?
> I thought of using polymorphic variant types, but my (limited)
> is that you either declare all possible variants straight up in the .mli
> (which totally defeats my purpose) or you don't declare anything and let
> compiler infer the type (which I don't know how to write into a .mli
> 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. "
That might be what you're loooking for.

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