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


Basile STARYNKEVITCH -- basile dot starynkevitch at inria dot fr
Project - (temporarily) --- all opinions are only mine 

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: