From: Luca Pascali <pasckosky2000@yahoo.it>
To: caml-list@inria.fr
Subject: Re: [Caml-list] string_of_polymorphic
Date: Mon, 03 Jan 2005 12:06:41 +0100 [thread overview]
Message-ID: <41D92741.5010600@yahoo.it> (raw)
In-Reply-To: <200501031100.27306.jon@jdh30.plus.com>
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
>variant:
>
># Marshal.to_string `dkdfbgkadjfbgljbfgljkabhvlkjblvbalvbvlabalbvaslbk [];;
>- : string =
>"\132\149¦¾\000\000\000\005\000\000\000\000\000\000\000\000\000\000\000\000\002í\014âí"
># Marshal.to_string `abcd [];;
>- : string =
>"\132\149¦¾\000\000\000\005\000\000\000\000\000\000\000\000\000\000\000\000\002ÀheÂ"
>
>Cheers,
>Jon.
>
>
>
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.
Tkanks.
I will probably insert in a tuple a string with the name of the construtor.
Luca
--
*********************************************************************
Luca Pascali
luca@barettadeit.com
asxcaml-guru@barettadeit.com
http://www.barettadeit.com/
Baretta DE&IT
A division of Baretta SRL
tel. 02 370 111 55
fax. 02 370 111 54
Our technology:
http://www.asxcaml.org/
http://www.freerp.org/
next prev parent reply other threads:[~2005-01-03 11:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-03 9:52 string_of_polymorphic Luca Pascali
2005-01-03 10:18 ` [Caml-list] string_of_polymorphic Jon Harrop
2005-01-03 11:01 ` Luca Pascali
[not found] ` <41D9211D.7060003@yahoo.it>
[not found] ` <200501031100.27306.jon@jdh30.plus.com>
2005-01-03 11:06 ` Luca Pascali [this message]
2005-01-03 16:27 ` pad
2005-01-05 18:17 ` Alex Baretta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41D92741.5010600@yahoo.it \
--to=pasckosky2000@yahoo.it \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox