caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] marshalling polymorphic variants
@ 2004-06-28 21:02 henri dubois-ferriere
  2004-06-29  7:55 ` Basile Starynkevitch [local]
  2004-06-29  8:45 ` Richard Jones
  0 siblings, 2 replies; 6+ messages in thread
From: henri dubois-ferriere @ 2004-06-28 21:02 UTC (permalink / raw)
  To: caml-list

hi, 
in the simple case below, it is possible to marshal out a ([`A | `B]
list), and then read it back as a [> `A | `B | `C] list.

can this behavior be counted on , or is it not something an
application can assume to always work?

thanks
henri



# Marshal.to_channel oc ([`A; `B] : [`A | `B] list) [];;
- : unit = ()

# let a = (Marshal.from_channel ic : [> `A| `B | `C] list);;
val a : [> `A | `B | `C ] list = [`A; `B]

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-06-29 21:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-28 21:02 [Caml-list] marshalling polymorphic variants henri dubois-ferriere
2004-06-29  7:55 ` Basile Starynkevitch [local]
2004-06-29  8:54   ` Jacques GARRIGUE
2004-06-29  8:45 ` Richard Jones
2004-06-29 17:50   ` Alex Baretta
2004-06-29 21:54     ` henri dubois-ferriere

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).