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 (01:04)
From: Kenneth Knowles <kknowles@u...>
Subject: Re: [Caml-list] extensible records?
Hi Mike,

What I did, which may or not be powerful enough for you, was to use classes.
I'm actually hoping that this thread comes up with something better for me to

class type opaque_type =
	... various methods required of all data items ...

type datavalue =
	| Int of int
	| Float of float
	| Opaque of opaque_type

So it is fairly easy to add a new type, or some kind of weird opaque reference.
I haven't really used it much, so I don't know of its limitations.


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