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
Re: [Caml-list] Allowing many types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-02-11 (01:43)
From: Ryan Tarpine <rtarpine@h...>
Subject: Re: [Caml-list] Allowing many types
>polymorphic variant me be the answer, because you can get back the
>type :

I'm probably missing something obvious, but how do you store a polymorphic 
variant in a field in a record?  Before, when I just used a normal variant 
type I called "primitive", all I did was
  type my_object = { object_data : primitive; (* etc. *) }

Is there a type that means "any polymorphic variant"?  Trying to set
  type primitive = [ `PTest ]
forces only `PTest to be the value of object_data.  How can I allow anything 
to be stored there?


Ryan Tarpine, rtarpine@hotmail.com
"To err is human, to compute divine.  Trust your computer but not its 
  - Morris Kingston

Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr