Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] marshalling polymorphic variants
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Basile Starynkevitch [local] <basile.starynkevitch@i...>
Subject: Re: [Caml-list] marshalling polymorphic variants
On Mon, Jun 28, 2004 at 11:02:25PM +0200, henri dubois-ferriere wrote:

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


I think that yes, because:

  1. marshalling don't care about type casts (hence you can shot in
     your leg if you abuse it) and is not type safe.

  2. polymorphic variants are (IIRC) represented by using the hashcode
     of their name, so `A is always `A in any polymorphic variant
     context.

Regards.

-- 
Basile STARYNKEVITCH -- basile dot starynkevitch at inria dot fr
Project cristal.inria.fr - (temporarily)
http://cristal.inria.fr/~starynke --- all opinions are only mine 

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