Version franaise
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
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Luca Pascali <pasckosky2000@y...>
Subject: Re: [Caml-list] string_of_polymorphic
Jon Harrop wrote:

> [...]
>I believe that the name of a polymorphic variant, as a string, is not in the 
>marshalled string. Instead, the name is in the type, which is not conveyed by 
>marshalling. I think the marshalled string will actually contain a fixed-size 
>hash of the string name.
>In theory, two polymorphic variant names which produce the same hash should be 
>indistinguishable at run-time. Producing them will be tricky though.
>A consequence of this is the fixed-size (1-word) of a marshalled polymorphic 
># Marshal.to_string `dkdfbgkadjfbgljbfgljkabhvlkjblvbalvbvlabalbvaslbk [];;
>- : string =
># Marshal.to_string `abcd [];;
>- : string =
Ok, anyway I already dropped the way of analisis of marshalled string, 
because I don't even know if it is always done in the same way across 
platforms and ocaml versions.


I will probably insert in a tuple a string with the name of the construtor.


Luca Pascali
Baretta DE&IT
A division of Baretta SRL

tel. 02 370 111 55
fax. 02 370 111 54

Our technology: