Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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,
"To err is human, to compute divine.  Trust your computer but not its 
  - Morris Kingston

Get your FREE download of MSN Explorer at

Bug reports:  FAQ:
To unsubscribe, mail  Archives: